Hello
I run the sent2.py at the Box1.FCStd and the last line is:
"print(' Global Placement =',obj.getGlobalPlacement())".
And the response is:
"21:11:01 Global Placement = Placement [Pos=(0,0,0), Yaw-Pitch-Roll=(0,0,0)]"
So the question -obvious to me - is: What is at (Global) Pos=(0,0,0) ? It seems that any point of the pad is far from those coordinates.
I am afraid that I am again at square 1.
So what is the meaning of Global Placement Pos ?
Thanks in advance.
[SOLVED] What does it mean "Pos=(0,0,0)" ?
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
[SOLVED] What does it mean "Pos=(0,0,0)" ?
- Attachments
-
- sent2.py
- (1.31 KiB) Downloaded 16 times
-
- Box1.FCStd
- (18.39 KiB) Downloaded 15 times
Last edited by manos on Wed Sep 28, 2022 12:38 pm, edited 1 time in total.
-
- Veteran
- Posts: 3182
- Joined: Thu Sep 24, 2020 10:31 pm
- Location: Hawaii
- Contact:
Re: What does it mean "Pos=(0,0,0)" ?
The origin of Body is located at the origin of the sketch (which is outside your padded area). Its global placement is the zero vector, which says the origin of the body has not been moved. You could move it by changing its placement.
Re: What does it mean "Pos=(0,0,0)" ?
So in other words the global placement Position: 1) When referred to additive primitive, is the "distance" of a primitive's point from the real O(0,0,0) - i.e useful.edwilliams16 wrote: ↑Tue Sep 27, 2022 7:35 pm The origin of Body is located at the origin of the sketch (which is outside your padded area). Its global placement is the zero vector, which says the origin of the body has not been moved. You could move it by changing its placement.
2) When referred to pads, is the "distance" of a pad's point from an almost imaginary point (the sketche's (0,0,0) ) i.e. rather useless.
Is there any way to find that "Sketch Origin" and its Global Position ? Maybe using a Datum Point ?
edwilliams16 the news you brought are rather disappointing but thank you for the answer.
-
- Veteran
- Posts: 3182
- Joined: Thu Sep 24, 2020 10:31 pm
- Location: Hawaii
- Contact:
Re: What does it mean "Pos=(0,0,0)" ?
Body has its own internal coordinate system (displayed under it in the object tree). When you obtain its global Placement, you find its location and orientation relative to the global coordinate system. In your simple case, they are coincident. Inside your body, you placed a Pad of a sketch. The sketch has its own coordinate system. In your case, it is co-located with that of the Body since it is attached to the default XY-Plane with no offset.
The local coordinate system of any sketch is that it has an origin, x and y axes and z comes out of the screen.
if you want to know the global location of some vertex on your pad, from first principles, you would need two pieces of information - where is the vertex located in the body's coordinate system and how do body coordinates relate to global coordinates. The first piece of information is a vector, the second a placement.
gives the location of Vertex15 in body's coordinate system.
gives the global location of Vertex15. Change the Bodies placement and you will see this change with it.
It get more complicated when you use links, as you need to differentiate the location of the linked object from that of the original.
The local coordinate system of any sketch is that it has an origin, x and y axes and z comes out of the screen.
if you want to know the global location of some vertex on your pad, from first principles, you would need two pieces of information - where is the vertex located in the body's coordinate system and how do body coordinates relate to global coordinates. The first piece of information is a vector, the second a placement.
Code: Select all
doc = ActiveDocument
obj = doc.getObject("Body")
shp = obj.Shape
shp.Vertexes[14].Point
#Vector (-20.0, 10.0, 0.0)
Code: Select all
place = obj.getGlobalPlacement()
place * shp.Vertexes[14].Point
#Vector (-20.0, 10.0, 0.0)
It get more complicated when you use links, as you need to differentiate the location of the linked object from that of the original.
Re: What does it mean "Pos=(0,0,0)" ?
I think you have problem with meaning of "origin".
Anyway, how about using
Code: Select all
App.ActivementDocument.Pad.Shape.BoundingBox
[SOLVED] Re: What does it mean "Pos=(0,0,0)" ?
Of course I have problem with Origin: It is supposed to be cornerstone of Coordinates and it is almost unusable.(Non selectable with mouse etc)
I will remain loyal to points coordinates, they work fine for me so far.Anyway, how about usingCode: Select all
App.ActiveDocument.Pad.Shape.BoundingBox
OpenBrain thank for the help.