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="TopoShape"
8
Include="Mod/Part/App/TopoShape.h"
10
FatherInclude="Mod/Part/App/TopoShapePy.h"
11
FatherNamespace="Part"
14
<Author Licence="LGPL" Name="Juergen Riegel" EMail="Juergen.Riegel@web.de" />
15
<UserDocu>TopoShapeEdge is the OpenCasCade topological edge wrapper</UserDocu>
17
<Methode Name="getParameterByLength" Const="true">
19
<UserDocu>Get the value of the primary parameter at the given distance along the cartesian length of the edge.
20
getParameterByLength(pos, [tolerance = 1e-7]) -> Float
23
pos (float or int): The distance along the length of the edge at which to
24
determine the primary parameter value. See help for the FirstParameter or
25
LastParameter properties for more information on the primary parameter.
26
If the given value is positive, the distance from edge start is used.
27
If the given value is negative, the distance from edge end is used.
28
tol (float): Computing tolerance. Optional, defaults to 1e-7.
31
paramval (float): the value of the primary parameter defining the edge at the
32
given position along its cartesian length.
36
<Methode Name="tangentAt" Const="true">
38
<UserDocu>Get the tangent direction at the given primary parameter value along the Edge if it is defined
39
tangentAt(paramval) -> Vector
42
paramval (float or int): The parameter value along the Edge at which to
43
determine the tangent direction e.g:
45
x = Part.makeCircle(1, FreeCAD.Vector(0,0,0), FreeCAD.Vector(0,0,1), 0, 90)
46
y = x.tangentAt(x.FirstParameter + 0.5 * (x.LastParameter - x.FirstParameter))
48
y is the Vector (-0.7071067811865475, 0.7071067811865476, 0.0)
50
Values with magnitude greater than the Edge length return
51
values of the tangent on the curve extrapolated beyond its
52
length. This may not be valid for all Edges. Negative values
53
similarly return a tangent on the curve extrapolated backwards
54
(before the start point of the Edge). For example, using the
57
>>> x.tangentAt(x.FirstParameter + 3.5*(x.LastParameter - x.FirstParameter))
58
Vector (0.7071067811865477, 0.7071067811865474, 0.0)
60
Which gives the same result as
62
>>> x.tangentAt(x.FirstParameter -0.5*(x.LastParameter - x.FirstParameter))
63
Vector (0.7071067811865475, 0.7071067811865476, 0.0)
68
Vector: representing the tangent to the Edge at the given
69
location along its length (or extrapolated length)
73
<Methode Name="valueAt" Const="true">
75
<UserDocu>Get the value of the cartesian parameter value at the given parameter value along the Edge
76
valueAt(paramval) -> Vector
79
paramval (float or int): The parameter value along the Edge at which to
80
determine the value in terms of the main parameter defining
81
the edge, what the parameter value is depends on the type of
86
x = Part.makeCircle(1, FreeCAD.Vector(0,0,0), FreeCAD.Vector(0,0,1), 0, 90)
87
y = x.valueAt(x.FirstParameter + 0.5 * (x.LastParameter - x.FirstParameter))
89
y is theVector (0.7071067811865476, 0.7071067811865475, 0.0)
91
Values with magnitude greater than the Edge length return
92
values on the curve extrapolated beyond its length. This may
93
not be valid for all Edges. Negative values similarly return
94
a parameter value on the curve extrapolated backwards (before the
95
start point of the Edge). For example, using the same shape
98
>>> x.valueAt(x.FirstParameter + 3.5*(x.LastParameter - x.FirstParameter))
99
Vector (0.7071067811865474, -0.7071067811865477, 0.0)
101
Which gives the same result as
103
>>> x.valueAt(x.FirstParameter -0.5*(x.LastParameter - x.FirstParameter))
104
Vector (0.7071067811865476, -0.7071067811865475, 0.0)
109
Vector: representing the cartesian location on the Edge at the given
110
distance along its length (or extrapolated length)
114
<Methode Name="parameters" Const="true">
116
<UserDocu>Get the list of parameters of the tessellation of an edge.
117
parameters([face]) -> list
119
If the edge is part of a face then this face is required as argument.
120
An exception is raised if the edge has no polygon.
124
<Methode Name="parameterAt" Const="true">
126
<UserDocu>Get the parameter at the given vertex if lying on the edge
127
parameterAt(Vertex) -> Float
131
<Methode Name="normalAt" Const="true">
133
<UserDocu>Get the normal direction at the given parameter value along the Edge if it is defined
134
normalAt(paramval) -> Vector
137
paramval (float or int): The parameter value along the Edge at which to
138
determine the normal direction e.g:
140
x = Part.makeCircle(1, FreeCAD.Vector(0,0,0), FreeCAD.Vector(0,0,1), 0, 90)
141
y = x.normalAt(x.FirstParameter + 0.5 * (x.LastParameter - x.FirstParameter))
143
y is the Vector (-0.7071067811865476, -0.7071067811865475, 0.0)
145
Values with magnitude greater than the Edge length return
146
values of the normal on the curve extrapolated beyond its
147
length. This may not be valid for all Edges. Negative values
148
similarly return a normal on the curve extrapolated backwards
149
(before the start point of the Edge). For example, using the
152
>>> x.normalAt(x.FirstParameter + 3.5*(x.LastParameter - x.FirstParameter))
153
Vector (-0.7071067811865474, 0.7071067811865477, 0.0)
155
Which gives the same result as
157
>>> x.normalAt(x.FirstParameter -0.5*(x.LastParameter - x.FirstParameter))
158
Vector (-0.7071067811865476, 0.7071067811865475, 0.0)
163
Vector: representing the normal to the Edge at the given
164
location along its length (or extrapolated length)
168
<Methode Name="derivative1At" Const="true">
170
<UserDocu>Get the first derivative at the given parameter value along the Edge if it is defined
171
derivative1At(paramval) -> Vector
174
paramval (float or int): The parameter value along the Edge at which to
175
determine the first derivative e.g:
177
x = Part.makeCircle(1, FreeCAD.Vector(0,0,0), FreeCAD.Vector(0,0,1), 0, 90)
178
y = x.derivative1At(x.FirstParameter + 0.5 * (x.LastParameter - x.FirstParameter))
180
y is the Vector (-0.7071067811865475, 0.7071067811865476, 0.0)
182
Values with magnitude greater than the Edge length return
183
values of the first derivative on the curve extrapolated
184
beyond its length. This may not be valid for all Edges.
185
Negative values similarly return a first derivative on the
186
curve extrapolated backwards (before the start point of the
187
Edge). For example, using the same shape as above:
189
>>> x.derivative1At(x.FirstParameter + 3.5*(x.LastParameter - x.FirstParameter))
190
Vector (0.7071067811865477, 0.7071067811865474, 0.0)
192
Which gives the same result as
194
>>> x.derivative1At(x.FirstParameter -0.5*(x.LastParameter - x.FirstParameter))
195
Vector (0.7071067811865475, 0.7071067811865476, 0.0)
200
Vector: representing the first derivative to the Edge at the
201
given location along its length (or extrapolated length)
205
<Methode Name="derivative2At" Const="true">
207
<UserDocu>Get the second derivative at the given parameter value along the Edge if it is defined
208
derivative2At(paramval) -> Vector
211
paramval (float or int): The parameter value along the Edge at which to
212
determine the second derivative e.g:
214
x = Part.makeCircle(1, FreeCAD.Vector(0,0,0), FreeCAD.Vector(0,0,1), 0, 90)
215
y = x.derivative2At(x.FirstParameter + 0.5 * (x.LastParameter - x.FirstParameter))
217
y is the Vector (-0.7071067811865476, -0.7071067811865475, 0.0)
219
Values with magnitude greater than the Edge length return
220
values of the second derivative on the curve extrapolated
221
beyond its length. This may not be valid for all Edges.
222
Negative values similarly return a second derivative on the
223
curve extrapolated backwards (before the start point of the
224
Edge). For example, using the same shape as above:
226
>>> x.derivative2At(x.FirstParameter + 3.5*(x.LastParameter - x.FirstParameter))
227
Vector (-0.7071067811865474, 0.7071067811865477, 0.0)
229
Which gives the same result as
231
>>> x.derivative2At(x.FirstParameter -0.5*(x.LastParameter - x.FirstParameter))
232
Vector (-0.7071067811865476, 0.7071067811865475, 0.0)
237
Vector: representing the second derivative to the Edge at the
238
given location along its length (or extrapolated length)
242
<Methode Name="derivative3At" Const="true">
244
<UserDocu>Get the third derivative at the given parameter value along the Edge if it is defined
245
derivative3At(paramval) -> Vector
248
paramval (float or int): The parameter value along the Edge at which to
249
determine the third derivative e.g:
251
x = Part.makeCircle(1, FreeCAD.Vector(0,0,0), FreeCAD.Vector(0,0,1), 0, 90)
252
y = x.derivative3At(x.FirstParameter + 0.5 * (x.LastParameter - x.FirstParameter))
254
y is the Vector (0.7071067811865475, -0.7071067811865476, -0.0)
256
Values with magnitude greater than the Edge length return
257
values of the third derivative on the curve extrapolated
258
beyond its length. This may not be valid for all Edges.
259
Negative values similarly return a third derivative on the
260
curve extrapolated backwards (before the start point of the
261
Edge). For example, using the same shape as above:
263
>>> x.derivative3At(x.FirstParameter + 3.5*(x.LastParameter - x.FirstParameter))
264
Vector (-0.7071067811865477, -0.7071067811865474, 0.0)
266
Which gives the same result as
268
>>> x.derivative3At(x.FirstParameter -0.5*(x.LastParameter - x.FirstParameter))
269
Vector (-0.7071067811865475, -0.7071067811865476, 0.0)
274
Vector: representing the third derivative to the Edge at the
275
given location along its length (or extrapolated length)
279
<Methode Name="curvatureAt" Const="true">
281
<UserDocu>Get the curvature at the given parameter [First|Last] if defined
282
curvatureAt(paramval) -> Float
286
<Methode Name="centerOfCurvatureAt" Const="true">
288
<UserDocu>Get the center of curvature at the given parameter [First|Last] if defined
289
centerOfCurvatureAt(paramval) -> Vector
293
<Methode Name="firstVertex" Const="true">
295
<UserDocu>Returns the Vertex of orientation FORWARD in this edge.
296
firstVertex([Orientation=False]) -> Vertex
298
If there is none a Null shape is returned.
299
Orientation = True : taking into account the edge orientation
303
<Methode Name="lastVertex" Const="true">
305
<UserDocu>Returns the Vertex of orientation REVERSED in this edge.
306
lastVertex([Orientation=False]) -> Vertex
308
If there is none a Null shape is returned.
309
Orientation = True : taking into account the edge orientation
313
<Methode Name="discretize" Const="true" Keyword="true">
315
<UserDocu>Discretizes the edge and returns a list of points.
316
discretize(kwargs) -> list
318
The function accepts keywords as argument:
319
discretize(Number=n) => gives a list of 'n' equidistant points
320
discretize(QuasiNumber=n) => gives a list of 'n' quasi equidistant points (is faster than the method above)
321
discretize(Distance=d) => gives a list of equidistant points with distance 'd'
322
discretize(Deflection=d) => gives a list of points with a maximum deflection 'd' to the edge
323
discretize(QuasiDeflection=d) => gives a list of points with a maximum deflection 'd' to the edge (faster)
324
discretize(Angular=a,Curvature=c,[Minimum=m]) => gives a list of points with an angular deflection of 'a'
325
and a curvature deflection of 'c'. Optionally a minimum number of points
326
can be set which by default is set to 2.
328
Optionally you can set the keywords 'First' and 'Last' to define a sub-range of the parameter range
331
If no keyword is given then it depends on whether the argument is an int or float.
332
If it's an int then the behaviour is as if using the keyword 'Number', if it's float
333
then the behaviour is as if using the keyword 'Distance'.
339
p=e.discretize(Number=50,First=3.14)
340
s=Part.Compound([Part.Vertex(i) for i in p])
344
p=e.discretize(Angular=0.09,Curvature=0.01,Last=3.14,Minimum=100)
345
s=Part.Compound([Part.Vertex(i) for i in p])
350
<Methode Name="countNodes" Const="true">
352
<UserDocu>Returns the number of nodes of the 3D polygon of the edge.</UserDocu>
355
<Methode Name="split" Const="true">
357
<UserDocu>Splits the edge at the given parameter values and builds a wire out of it
358
split(paramval) -> Wire
361
paramval (float or list_of_floats): The parameter values along the Edge at which to
364
edge = Part.makeCircle(1, FreeCAD.Vector(0,0,0), FreeCAD.Vector(0,0,1), 0, 90)
365
wire = edge.split([0.5, 1.0])
368
Wire: wire made up of two Edges
372
<Methode Name="isSeam" Const="true">
374
<UserDocu>Checks whether the edge is a seam edge.
379
<Methode Name="curveOnSurface" Const="true">
381
<UserDocu>Returns the 2D curve, the surface, the placement and the parameter range of index idx.
382
curveOnSurface(idx) -> None or tuple
384
Returns None if index idx is out of range.
385
Returns a 5-items tuple of a curve, a surface, a placement, first parameter and last parameter.
389
<Attribute Name="Tolerance">
391
<UserDocu>Set or get the tolerance of the vertex</UserDocu>
393
<Parameter Name="Tolerance" Type="Float"/>
395
<Attribute Name="Length" ReadOnly="true">
397
<UserDocu>Returns the cartesian length of the curve</UserDocu>
399
<Parameter Name="Length" Type="Float"/>
401
<Attribute Name="ParameterRange" ReadOnly="true">
404
Returns a 2 tuple with the range of the primary parameter
405
defining the curve. This is the same as would be returned by
406
the FirstParameter and LastParameter properties, i.e.
408
(LastParameter,FirstParameter)
410
What the parameter is depends on what type of edge it is. For a
411
Line the parameter is simply its cartesian length. Some other
412
examples are shown below:
415
---------------------------------------------------------------
416
Circle Angle swept by circle (or arc) in radians
417
BezierCurve Unitless number in the range 0.0 to 1.0
418
Helix Angle swept by helical turns in radians
421
<Parameter Name="ParameterRange" Type="Tuple"/>
423
<Attribute Name="FirstParameter" ReadOnly="true">
426
Returns the start value of the range of the primary parameter
429
What the parameter is depends on what type of edge it is. For a
430
Line the parameter is simply its cartesian length. Some other
431
examples are shown below:
434
-----------------------------------------------------------
435
Circle Angle swept by circle (or arc) in radians
436
BezierCurve Unitless number in the range 0.0 to 1.0
437
Helix Angle swept by helical turns in radians
440
<Parameter Name="FirstParameter" Type="Float"/>
442
<Attribute Name="LastParameter" ReadOnly="true">
445
Returns the end value of the range of the primary parameter
448
What the parameter is depends on what type of edge it is. For a
449
Line the parameter is simply its cartesian length. Some other
450
examples are shown below:
453
-----------------------------------------------------------
454
Circle Angle swept by circle (or arc) in radians
455
BezierCurve Unitless number in the range 0.0 to 1.0
456
Helix Angle swept by helical turns in radians
459
<Parameter Name="LastParameter" Type="Float"/>
461
<Attribute Name="Curve" ReadOnly="true">
463
<UserDocu>Returns the 3D curve of the edge</UserDocu>
465
<Parameter Name="Curve" Type="Object"/>
467
<Attribute Name="Closed" ReadOnly="true">
469
<UserDocu>Returns true if the edge is closed</UserDocu>
471
<Parameter Name="Closed" Type="Boolean"/>
473
<Attribute Name="Degenerated" ReadOnly="true">
475
<UserDocu>Returns true if the edge is degenerated</UserDocu>
477
<Parameter Name="Degenerated" Type="Boolean"/>
479
<Attribute Name="Mass" ReadOnly="true">
481
<UserDocu>Returns the mass of the current system.</UserDocu>
483
<Parameter Name="Mass" Type="Object"/>
485
<Attribute Name="CenterOfMass" ReadOnly="true">
487
<UserDocu>Returns the center of mass of the current system.
488
If the gravitational field is uniform, it is the center of gravity.
489
The coordinates returned for the center of mass are expressed in the
490
absolute Cartesian coordinate system.</UserDocu>
492
<Parameter Name="CenterOfMass" Type="Object"/>
494
<Attribute Name="MatrixOfInertia" ReadOnly="true">
496
<UserDocu>Returns the matrix of inertia. It is a symmetrical matrix.
497
The coefficients of the matrix are the quadratic moments of
505
The moments of inertia are denoted by Ixx, Iyy, Izz.
506
The products of inertia are denoted by Ixy, Ixz, Iyz.
507
The matrix of inertia is returned in the central coordinate
508
system (G, Gx, Gy, Gz) where G is the centre of mass of the
509
system and Gx, Gy, Gz the directions parallel to the X(1,0,0)
510
Y(0,1,0) Z(0,0,1) directions of the absolute cartesian
511
coordinate system.</UserDocu>
513
<Parameter Name="MatrixOfInertia" Type="Object"/>
515
<Attribute Name="StaticMoments" ReadOnly="true">
517
<UserDocu>Returns Ix, Iy, Iz, the static moments of inertia of the
518
current system; i.e. the moments of inertia about the
519
three axes of the Cartesian coordinate system.</UserDocu>
521
<Parameter Name="StaticMoments" Type="Object"/>
523
<Attribute Name="PrincipalProperties" ReadOnly="true">
525
<UserDocu>Computes the principal properties of inertia of the current system.
526
There is always a set of axes for which the products
527
of inertia of a geometric system are equal to 0; i.e. the
528
matrix of inertia of the system is diagonal. These axes
529
are the principal axes of inertia. Their origin is
530
coincident with the center of mass of the system. The
531
associated moments are called the principal moments of inertia.
532
This function computes the eigen values and the
533
eigen vectors of the matrix of inertia of the system.</UserDocu>
535
<Parameter Name="PrincipalProperties" Type="Dict"/>
537
<Attribute Name="Continuity" ReadOnly="true">
539
<UserDocu>Returns the continuity</UserDocu>
541
<Parameter Name="Continuity" Type="String"/>