Placement/it

Descrizione
 Placement (Posizionamento) è la funzione utilizzata da FreeCAD per specificare la localizzazione (dove si trova) e l'assetto (orientamento) di un oggetto nello spazio. Placement può essere specificato in diversi modi e manipolato tramite script, tramite la scheda delle Proprietà oppure il dialogo Placement del menu Modifica.

Accedere agli attributi di Placement
Gli attributi di Posizionamento di un oggetto sono accessibili in tre modi:





Il menu Modifica Posizionamento

che apre e mostra lo strumento Azioni di Posizionamento.

Angolo, Assi e Posizione
Placement = [Angle, Axis, Position]

La prima forma di Placement stabilisce la Posizione di un oggetto nello spazio e descrive il suo orientamento come una singola rotazione attorno ad un asse. Angle = r : è uno scalare che indica la quantità di rotazione dell'oggetto su Axis. Inserito in gradi, ma memorizzato internamente in radianti.

Axis = (ax,ay,az) : è un vettore unitario che descrive un asse di rotazione (vedere Nota relativa all'asse di rotazione).

Esempi: (1,0,0)      ==> sull'asse X (0,1,0)      ==> sull'asse Y (0,0,1)      ==> sull'asse Z (0.71,0.71,0) ==> sulla linea y=x Position = (x,y,z) è un vettore che descrive le coordinate (world) del punto di riferimento (punto base) dell'oggetto. Notare che negli script, Placement.Base è usato per indicare il componente di Posizione di un Placement. Il Property Editor chiama questo valore "Position".

Posizione con Imbardata, Beccheggio e Rollio
Placement = [Position, Yaw-Pitch-Roll]

La seconda forma di Placement fissa la posizione di un oggetto nello spazio con Position (come nella prima forma), ma descrive il suo orientamento con gli angoli di imbardata, beccheggio e rollio. Questi angoli sono anche denominati angoli Tait-Bryan o angoli di Eulero. Imbardata, beccheggio e rollio sono termini comuni nel settore dell'aviazione per descrivere l'orientamento (assetto) del veicolo.

Position = (x,y,z) is a Vector describing the world coordinates of the reference point of the object.

Yaw-Pitch-Roll = (y,p,r) is a tuple that specifies the attitude of the object. Values for y,p,r  specify degrees of rotation about each of the z,y,x axis (see note).

Matrix
Placement = Matrix

The third form of Placement describes the object's position and orientation with a 4x4 affine transformation matrix (Affine Transformation).

Matrix =

((r11,r12,r13,t1),   (r21,r22,r23,t2),    (r31,r32,r33,t3),    (0,0,0,1)), with rij specifying rotation and ti specifying translation.

The Placement Dialog
The Placement Dialog is invoked from the Edit menu. It is used to precisely rotate/translate objects. It is also used when we need to create a sketch on a "non standard" plane or change a sketch's orientation to a new plane. The Translation section adjusts the objects location in space. The Center section adjusts the rotational axis to one that does not pass through the object's reference point. The Rotation section adjusts the rotational angle(s) and the method of specifying those angles. The Apply incremental changes to object placement tick box is useful when translations/rotations are to be made relative the object's current position/attitude, rather than to the original position/attitude. Ticking this box resets the dialog's input fields to zero, but does not change the object's orientation or location. Subsequent entries do change the orientation/location, but are applied from the object's current position.

Examples
Rotations about a single axis:

Before Rotation (top view)

After Rotation about Z (top view)

After Rotation about y=x (right view)

Rotation with offset centre point:

Before Rotation (top view)

After Rotation about Z (top view)

Rotation using Euler angles:

Before Rotation

After Rotation

Placement.Base vs Shape Definition
Placement is not the only way to position a shape in space. Note the Python console in this image:



Both cubes have the same value for Placement, but are in different locations! This is because the 2 shapes are defined by different vertices. For the 2 shapes in the above illustration:

>>> ev = App.ActiveDocument.Extrude.Shape.Vertexes >>> for v in ev: print v.X,",",v.Y,",",v.Z ...   30.0,30.0,0.0 30.0,30.0,10.0 40.0,30.0,0.0  40.0,30.0,10.0  40.0,40.0,0.0  40.0,40.0,10.0  30.0,40.0,0.0  30.0,40.0,10.0  >>> e1v = App.ActiveDocument.Extrude001.Shape.Vertexes >>> for v in e1v: print v.X,",",v.Y,",",v.Z ...   0.0,10.0,0.0 0.0,10.0,10.0 10.0,10.0,0.0  10.0,10.0,10.0  10.0,0.0,0.0  10.0,0.0,10.0  0.0,0.0,0.0  0.0,0.0,10.0  >>> The Vertices (or Vectors) that define the shape use the Placement.Base attribute as their origin. So if you want to move a shape 10 units along the X axis, you could add 10 to the X coordinates of all the Vertices or you could set Placement.Position to (10,0,0).

Using "Center" to Control Axis of Rotation
By default, the axis of rotation isn't really the x/y/z axis. It is a line parallel to the selected axis, but passing through the reference point (Placement.Base) of the object to be rotated. This can be changed by using the Center fields in the Placement dialog or, in scripts, by using the Center parameter of the FreeCAD.Placement constructor.

For example, suppose we have a box (below) positioned at (20,20,10).

We wish to spin the box around it's own vertical centre line (ie local Z), while keeping it the same position. We can easily achieve this by specifying a Center value equal to the coordinates of the box's central point (25,25,15).

In a script, we would do:

Issues

 * As of version 0.13, update of Placement properties in the Data tab has been disabled for objects created with PartDesign, except for the initial sketch from which the solid will be created. Therefore the Placement of a solid created in PartDesign from a sketch can only be altered by adjusting Placement parameters of the initial construction sketch (the first sketch) from which the solid was created.
 * Placement functionality will eventually be handled in the Assembly workbench.

More

 * This tutorial: Aeroplane covers the mechanics of changing an object's Placement extensively.
 * A step-by-step explanation of the Placement Dialog can be found here Tasks_Placement.