FreeCAD

Форк
0
/
PlacementPy.xml 
228 строк · 8.0 Кб
1
<?xml version="1.0" encoding="UTF-8"?>
2
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
3
    <PythonExport
4
        Father="PyObjectBase"
5
        Name="PlacementPy"
6
        Twin="Placement"
7
        TwinPointer="Placement"
8
        Include="Base/Placement.h"
9
        FatherInclude="Base/PyObjectBase.h"
10
        Namespace="Base"
11
        Constructor="true"
12
        Delete="true"
13
        NumberProtocol="true"
14
        RichCompare="true"
15
        FatherNamespace="Base">
16
    <Documentation>
17
        <Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
18
        <UserDocu>Base.Placement class.
19

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.
22

23
The following constructors are supported:
24

25
Placement()
26
Empty constructor.
27

28
Placement(placement)
29
Copy constructor.
30
placement : Base.Placement
31

32
Placement(matrix)
33
Define from a 4D matrix consisting of rotation and translation.
34
matrix : Base.Matrix
35

36
Placement(base, rotation)
37
Define from position and rotation.
38
base : Base.Vector
39
rotation : Base.Rotation
40

41
Placement(base, rotation, center)
42
Define from position and rotation with center.
43
base : Base.Vector
44
rotation : Base.Rotation
45
center : Base.Vector
46

47
Placement(base, axis, angle)
48
define position and rotation.
49
base : Base.Vector
50
axis : Base.Vector
51
angle : float</UserDocu>
52
        <DeveloperDocu>Placement</DeveloperDocu>
53
    </Documentation>
54
        <Methode Name="copy" Const="true">
55
            <Documentation>
56
                <UserDocu>copy() -> Base.Placement
57

58
Returns a copy of this placement.</UserDocu>
59
            </Documentation>
60
        </Methode>
61
        <Methode Name="move">
62
            <Documentation>
63
                <UserDocu>move(vector) -> None
64

65
Move the placement along a vector.
66

67
vector : Base.Vector
68
    Vector by which to move the placement.</UserDocu>
69
            </Documentation>
70
        </Methode>
71
        <Methode Name="translate">
72
            <Documentation>
73
                <UserDocu>translate(vector) -> None
74

75
Alias to move(), to be compatible with TopoShape.translate().
76

77
vector : Base.Vector
78
    Vector by which to move the placement.</UserDocu>
79
            </Documentation>
80
        </Methode>
81
        <Methode Name="rotate" Keyword="true">
82
        <Documentation>
83
            <UserDocu>rotate(center, axis, angle, comp) -> None
84

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).
88

89
center : Base.Vector, sequence of float
90
    Rotation center.
91
axis : Base.Vector, sequence of float
92
    Rotation axis.
93
angle : float
94
    Rotation angle in degrees.
95
comp : bool
96
    optional keyword only argument, if True (default=False),
97
behave like TopoShape.rotate() (i.e. the resulting placements are interchangeable).
98
</UserDocu>
99
        </Documentation>
100
        </Methode>
101
                <Methode Name="multiply" Const="true">
102
            <Documentation>
103
                <UserDocu>multiply(placement) -> Base.Placement
104

105
Right multiply this placement with another placement.
106
Also available as `*` operator.
107

108
placement : Base.Placement
109
    Placement by which to multiply this placement.</UserDocu>
110
            </Documentation>
111
        </Methode>
112
                <Methode Name="multVec" Const="true">
113
            <Documentation>
114
                <UserDocu>multVec(vector) -> Base.Vector
115

116
Compute the transformed vector using the placement.
117

118
vector : Base.Vector
119
    Vector to be transformed.</UserDocu>
120
            </Documentation>
121
        </Methode>
122
                <Methode Name="toMatrix" Const="true">
123
            <Documentation>
124
                <UserDocu>toMatrix() -> Base.Matrix
125

126
Compute the matrix representation of the placement.</UserDocu>
127
            </Documentation>
128
        </Methode>
129
        <Methode Name="inverse" Const="true">
130
            <Documentation>
131
                <UserDocu>inverse() -> Base.Placement
132

133
Compute the inverse placement.</UserDocu>
134
            </Documentation>
135
        </Methode>
136
        <Methode Name="pow" Const="true">
137
            <Documentation>
138
                <UserDocu>pow(t, shorten=True) -> Base.Placement
139

140
Raise this placement to real power using ScLERP interpolation.
141
Also available as `**` operator.
142

143
t : float
144
    Real power.
145
shorten : bool
146
    If True, ensures rotation quaternion is net positive to make
147
    the path shorter.</UserDocu>
148
            </Documentation>
149
        </Methode>
150
        <Methode Name="sclerp" Const="true">
151
            <Documentation>
152
                <UserDocu>sclerp(placement2, t, shorten=True) -> Base.Placement
153

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.
159

160
placement2 : Base.Placement
161
t : float
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.
164
shorten : bool
165
    If True, the signs are harmonized before interpolation and the interpolation
166
    takes the shorter path.</UserDocu>
167
            </Documentation>
168
        </Methode>
169
        <Methode Name="slerp" Const="true">
170
            <Documentation>
171
                <UserDocu>slerp(placement2, t) -> Base.Placement
172

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.
178

179
placement2 : Base.Placement
180
t : float
181
    Parameter of the path. t=0 returns this placement, t=1 returns `placement2`.</UserDocu>
182
            </Documentation>
183
        </Methode>
184
        <Methode Name="isIdentity" Const="true">
185
            <Documentation>
186
                <UserDocu>isIdentity([tol=0.0]) -> bool
187

188
Returns True if the placement has no displacement and no rotation.
189
Matrix representation is the 4D identity matrix.
190
tol : float
191
    Tolerance used to check for identity.
192
    If tol is negative or zero, no tolerance is used.</UserDocu>
193
            </Documentation>
194
        </Methode>
195
        <Methode Name="isSame" Const="true">
196
            <Documentation>
197
                <UserDocu>isSame(Base.Placement, [tol=0.0]) -> bool
198

199
Checks whether this and the given placement are the same.
200
The default tolerance is set to 0.0</UserDocu>
201
            </Documentation>
202
        </Methode>
203
        <Attribute Name="Base" ReadOnly="false">
204
            <Documentation>
205
                <UserDocu>Vector to the Base Position of the Placement.</UserDocu>
206
            </Documentation>
207
            <Parameter Name="Base" Type="Object" />
208
        </Attribute>
209
        <Attribute Name="Rotation" ReadOnly="false">
210
            <Documentation>
211
                <UserDocu>Orientation of the placement expressed as rotation.</UserDocu>
212
            </Documentation>
213
            <Parameter Name="Rotation" Type="Object" />
214
        </Attribute>
215
        <Attribute Name="Matrix" ReadOnly="false">
216
            <Documentation>
217
                <UserDocu>Set/get matrix representation of the placement.</UserDocu>
218
            </Documentation>
219
            <Parameter Name="Matrix" Type="Object" />
220
        </Attribute>
221
        <ClassDeclarations>public:
222
            PlacementPy(const Placement &amp; pla, PyTypeObject *T = &amp;Type)
223
            :PyObjectBase(new Placement(pla),T){}
224
            Placement value() const
225
            { return *(getPlacementPtr()); }
226
        </ClassDeclarations>
227
    </PythonExport>
228
</GenerateModel>
229

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.