1
<?xml version="1.0" encoding="UTF-8"?>
2
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
7
TwinPointer="Placement"
8
Include="Base/Placement.h"
9
FatherInclude="Base/PyObjectBase.h"
15
FatherNamespace="Base">
17
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
18
<UserDocu>Base.Placement class.
20
A Placement defines an orientation (rotation) and a position (base) in 3D space.
21
It is used when no scaling or other distortion is needed.
23
The following constructors are supported:
30
placement : Base.Placement
33
Define from a 4D matrix consisting of rotation and translation.
36
Placement(base, rotation)
37
Define from position and rotation.
39
rotation : Base.Rotation
41
Placement(base, rotation, center)
42
Define from position and rotation with center.
44
rotation : Base.Rotation
47
Placement(base, axis, angle)
48
define position and rotation.
51
angle : float</UserDocu>
52
<DeveloperDocu>Placement</DeveloperDocu>
54
<Methode Name="copy" Const="true">
56
<UserDocu>copy() -> Base.Placement
58
Returns a copy of this placement.</UserDocu>
63
<UserDocu>move(vector) -> None
65
Move the placement along a vector.
68
Vector by which to move the placement.</UserDocu>
71
<Methode Name="translate">
73
<UserDocu>translate(vector) -> None
75
Alias to move(), to be compatible with TopoShape.translate().
78
Vector by which to move the placement.</UserDocu>
81
<Methode Name="rotate" Keyword="true">
83
<UserDocu>rotate(center, axis, angle, comp) -> None
85
Rotate the current placement around center and axis with the given angle.
86
This method is compatible with TopoShape.rotate() if the (optional) keyword
87
argument comp is True (default=False).
89
center : Base.Vector, sequence of float
91
axis : Base.Vector, sequence of float
94
Rotation angle in degrees.
96
optional keyword only argument, if True (default=False),
97
behave like TopoShape.rotate() (i.e. the resulting placements are interchangeable).
101
<Methode Name="multiply" Const="true">
103
<UserDocu>multiply(placement) -> Base.Placement
105
Right multiply this placement with another placement.
106
Also available as `*` operator.
108
placement : Base.Placement
109
Placement by which to multiply this placement.</UserDocu>
112
<Methode Name="multVec" Const="true">
114
<UserDocu>multVec(vector) -> Base.Vector
116
Compute the transformed vector using the placement.
119
Vector to be transformed.</UserDocu>
122
<Methode Name="toMatrix" Const="true">
124
<UserDocu>toMatrix() -> Base.Matrix
126
Compute the matrix representation of the placement.</UserDocu>
129
<Methode Name="inverse" Const="true">
131
<UserDocu>inverse() -> Base.Placement
133
Compute the inverse placement.</UserDocu>
136
<Methode Name="pow" Const="true">
138
<UserDocu>pow(t, shorten=True) -> Base.Placement
140
Raise this placement to real power using ScLERP interpolation.
141
Also available as `**` operator.
146
If True, ensures rotation quaternion is net positive to make
147
the path shorter.</UserDocu>
150
<Methode Name="sclerp" Const="true">
152
<UserDocu>sclerp(placement2, t, shorten=True) -> Base.Placement
154
Screw Linear Interpolation (ScLERP) between this placement and `placement2`.
155
Interpolation is a continuous motion along a helical path parametrized by `t`
156
made of equal transforms if discretized.
157
If quaternions of rotations of the two placements differ in sign, the interpolation
158
will take a long path.
160
placement2 : Base.Placement
162
Parameter of helical path. t=0 returns this placement, t=1 returns
163
`placement2`. t can also be outside of [0, 1] range for extrapolation.
165
If True, the signs are harmonized before interpolation and the interpolation
166
takes the shorter path.</UserDocu>
169
<Methode Name="slerp" Const="true">
171
<UserDocu>slerp(placement2, t) -> Base.Placement
173
Spherical Linear Interpolation (SLERP) between this placement and `placement2`.
174
This function performs independent interpolation of rotation and movement.
175
Result of such interpolation might be not what application expects, thus this tool
176
might be considered for simple cases or for interpolating between small intervals.
177
For more complex cases you better use the advanced sclerp() function.
179
placement2 : Base.Placement
181
Parameter of the path. t=0 returns this placement, t=1 returns `placement2`.</UserDocu>
184
<Methode Name="isIdentity" Const="true">
186
<UserDocu>isIdentity([tol=0.0]) -> bool
188
Returns True if the placement has no displacement and no rotation.
189
Matrix representation is the 4D identity matrix.
191
Tolerance used to check for identity.
192
If tol is negative or zero, no tolerance is used.</UserDocu>
195
<Methode Name="isSame" Const="true">
197
<UserDocu>isSame(Base.Placement, [tol=0.0]) -> bool
199
Checks whether this and the given placement are the same.
200
The default tolerance is set to 0.0</UserDocu>
203
<Attribute Name="Base" ReadOnly="false">
205
<UserDocu>Vector to the Base Position of the Placement.</UserDocu>
207
<Parameter Name="Base" Type="Object" />
209
<Attribute Name="Rotation" ReadOnly="false">
211
<UserDocu>Orientation of the placement expressed as rotation.</UserDocu>
213
<Parameter Name="Rotation" Type="Object" />
215
<Attribute Name="Matrix" ReadOnly="false">
217
<UserDocu>Set/get matrix representation of the placement.</UserDocu>
219
<Parameter Name="Matrix" Type="Object" />
221
<ClassDeclarations>public:
222
PlacementPy(const Placement & pla, PyTypeObject *T = &Type)
223
:PyObjectBase(new Placement(pla),T){}
224
Placement value() const
225
{ return *(getPlacementPtr()); }