Placement/es

Introducción
nota de traducción: en esta página pretendemos mantener la siguiente correspondencia entre términos ingles-español

placement     emplazamiento

attitude      orientación

position      posición

Hasta la etapa final de aceptación de la traducción no sustituiremos los términos originales en inglés por sus equivalentes en español.

Placement es el modo en que FreeCAD especifica la position y la attitude (orientacion) de un objeto en el espacio. Placement puede ser especificado de varias formas y manipulado a través de scripting, el panel de Propiedades o el diálogo Placement (Edit menu).

Accediendo al Atributo Placement (emplazamiento)
El atributo Placement (emplazamiento) de un objeto puede ser visto y modificado de 3 maneras:







Forms of Placement
The placement is stored internally as a position, and a rotation (rotation axis and angle transformed into a quaternion ). While there are several forms to specify a rotation, for instance with a rotation center, this is only used to affect the rotation computation and is not stored for later operations. Similarly, if a rotation axis of (1,1,1) is specified, it may be normalized when stored in the quaternion and appear as (0.58, 0.58, 0.58) when browsing the object later.

Angle, Axis and Position
Placement = [Angle, Axis, Position]

The primera forma de Placement define la situación de un objeto en el espacio con una Position, y describe su orientacion como una simple rotación alrededor de un eje. Angle = r es un número que indica la magnitud de la rotación del objeto alrededor del eje. Se introduce en grados sexagesimales, pero internamente se almacena en radianes.

Axis = (ax,ay,az) is a vector describing an axis of rotation (See Note about axis of rotation). Examples are: (1,0,0)      ==> about X axis (0,1,0)      ==> about Y axis (0,0,1)      ==> about Z axis (0.71,0.71,0) ==> about the line y=x Position = (x,y,z) is a Vector describing the point from which the object's geometry will be calculated (in effect, a "local origin" for the object). Note that in scripts, Placement.Base is used to denote the Position component of a placement. The Property Editor calls this value "Position" and the Placement dialog calls it "Translation".

Position and Yaw, Pitch and Roll


Placement = [Position, Yaw-Pitch-Roll]

La segunda forma de Placement define la localización de un objeto en el espacio con una Position (como en la forma primera), pero describe su orientacion usando los ángulos de rumbo, asiento y escora (Yaw, Pitch and Roll) (Yaw, Pitch, Roll). A esto ángulos también se los denomina ángulos de Euler o de Tait-Bryan(Euler angles). Yaw, Pitch and Roll son términos usados en aviación (y navegación) para indicar la orientación (o attitude) de un cuerpo.

Position = (x,y,z) is a Vector describing the point from which the object's geometry will be calculated (in effect, a "local origin" for 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).

App.Rotation(10,20,30) = Euler Angle

Yaw = 10 degrees (Z)

Pitch = 20 degrees (Y)

Roll = 30 degrees (X)

Yaw is the rotation about the Z axis, that is to say a rotation from left to right. (The yaw angle is the Psi ψ).

Pitch is rotation about the Y axis, that is to say nose-up and nose-down. (The Pitch angle is the Phi φ).

Roll is rotation about the X axis, that is to say wing up and down. (The Roll angle is the Thêta θ).

Matrix
Placement = Matrix

La tercera forma de Placement define la posición y orientación de un objeto en el espacio con una matriz de dimensiones 4x4 que representa una transformación afín (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 object's 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:

Antes de la Rotation (visto desde arriba)

Después de Rotation respecto a Z (top view)

Después de Rotation respecto a y=x (vista desde la derecha)

Rotation con centro de giro desplazado:

antes de la Rotation (top view)

Después de Rotation respecto a Z (vista en planta)

Rotation usando ángulos de Euler:

Antes Rotation

Despues Rotation

Placement.Base vs Shape Definition
Placement no es la única manera de definir la posición de una forma en el espacio. Observa la consola de Python en esta imagen:



Both cubes have the same value for Placement, but are in different locations! This is because the 2 shapes are defined by different vertices (curves in more complex shapes). 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.Base 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.

Por ejemplo, supongamos que tenemos un bloque (ver ilustración debajo) en las coordenadas (20,20,10).

Queremos girarlo sobre su propio eje vertical (es decir el eje Z "local"), pero manteniéndolo en el mismo lugar. Podemos conseguirlo facilmente indicando como valor de Center las coordenadas del punto central del bloque, que son (25,25,15).

En un script, haríamos así: Same script with the file example RotateCoG2.fcstd (discussion on the forum)

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.