1
<?xml version="1.0" encoding="UTF-8"?>
2
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
4
Father="ComplexGeoDataPy"
7
TwinPointer="TopoShape"
8
Include="Mod/Part/App/TopoShape.h"
10
FatherInclude="App/ComplexGeoDataPy.h"
11
FatherNamespace="Data"
14
<Author Licence="LGPL" Name="Juergen Riegel" EMail="Juergen.Riegel@web.de" />
15
<UserDocu>TopoShape is the OpenCasCade topological shape wrapper.
16
Sub-elements such as vertices, edges or faces are accessible as:
17
* Vertex#, where # is in range(1, number of vertices)
18
* Edge#, where # is in range(1, number of edges)
19
* Face#, where # is in range(1, number of faces)</UserDocu>
21
<Methode Name="dumps" Const="true">
23
<UserDocu>Serialize the content of this shape to a string in BREP format.</UserDocu>
26
<Methode Name="loads">
28
<UserDocu>Deserialize the content of this shape from a string in BREP format.</UserDocu>
33
<UserDocu>Read in an IGES, STEP or BREP file.
38
<Methode Name="writeInventor" Const="true" Keyword="true">
40
<UserDocu>Write the mesh in OpenInventor format to a string.
41
writeInventor() -> string
45
<Methode Name="exportIges" Const="true">
47
<UserDocu>Export the content of this shape to an IGES file.
52
<Methode Name="exportStep" Const="true">
54
<UserDocu>Export the content of this shape to an STEP file.
59
<Methode Name="exportBrep" Const="true">
61
<UserDocu>Export the content of this shape to an BREP file.
64
BREP is an OpenCasCade native format.
68
<Methode Name="exportBinary" Const="true">
70
<UserDocu>Export the content of this shape in binary format to a file.
75
<Methode Name="exportBrepToString" Const="true">
77
<UserDocu>Export the content of this shape to a string in BREP format.
78
exportBrepToString() -> string
80
BREP is an OpenCasCade native format.</UserDocu>
83
<Methode Name="dumpToString" Const="true">
85
<UserDocu>Dump information about the shape to a string.
86
dumpToString() -> string</UserDocu>
89
<Methode Name="exportStl" Const="true">
91
<UserDocu>Export the content of this shape to an STL mesh file.
92
exportStl(filename)</UserDocu>
95
<Methode Name="importBrep">
97
<UserDocu>Load the shape from a file in BREP format.
98
importBrep(filename)</UserDocu>
101
<Methode Name="importBinary">
103
<UserDocu>Import the content to this shape of a string in BREP format.
104
importBinary(filename)</UserDocu>
107
<Methode Name="importBrepFromString">
109
<UserDocu>Load the shape from a string that keeps the content in BREP format.
110
importBrepFromString(string, [displayProgressBar=True])
112
importBrepFromString(str,False) to not display a progress bar.
116
<Methode Name="extrude" Const="true">
118
<UserDocu>Extrude the shape along a vector.
119
extrude(vector) -> Shape
121
Shp2 = Shp1.extrude(App.Vector(0,0,10)) - extrude the shape 10 mm in the +Z direction.</UserDocu>
124
<Methode Name="revolve" Const="true">
126
<UserDocu>Revolve the shape around an Axis to a given degree.
127
revolve(base, direction, angle)
129
Part.revolve(App.Vector(0,0,0),App.Vector(0,0,1),360) - revolves the shape around the Z Axis 360 degree.
131
Hints: Sometimes you want to create a rotation body out of a closed edge or wire.
133
from FreeCAD import Base
139
r=s.revolve(V(0,0,0),V(0,1,0), 360)
142
However, you may possibly realize some rendering artifacts or that the mesh
143
creation seems to hang. This is because this way the surface is created twice.
144
Since the curve is a full ellipse it is sufficient to do a rotation of 180 degree
145
only, i.e. r=s.revolve(V(0,0,0),V(0,1,0), 180)
147
Now when rendering this object you may still see some artifacts at the poles. Now the
148
problem seems to be that the meshing algorithm doesn't like to rotate around a point
149
where there is no vertex.
151
The idea to fix this issue is that you create only half of the ellipse so that its shape
152
representation has vertexes at its start and end point.
154
from FreeCAD import Base
159
s=e.toShape(e.LastParameter/4,3*e.LastParameter/4)
160
r=s.revolve(V(0,0,0),V(0,1,0), 360)
165
<Methode Name="check" Const="true">
167
<UserDocu>Checks the shape and report errors in the shape structure.
168
check([runBopCheck = False])
170
This is a more detailed check as done in isValid().
171
if runBopCheck is True, a BOPCheck analysis is also performed.</UserDocu>
174
<Methode Name="fuse" Const="true">
176
<UserDocu>Union of this and a given (list of) topo shape.
179
fuse((tool1,tool2,...),[tolerance=0.0]) -> Shape
181
Union of this and a given list of topo shapes.
183
Supports (OCCT 6.9.0 and above):
184
- Fuzzy Boolean operations (global tolerance for a Boolean operation)
185
- Support of multiple arguments for a single Boolean operation
186
- Parallelization of Boolean Operations algorithm
188
Beginning from OCCT 6.8.1 a tolerance value can be specified.</UserDocu>
191
<Methode Name="multiFuse" Const="true">
193
<UserDocu>Union of this and a given list of topo shapes.
194
multiFuse((tool1,tool2,...),[tolerance=0.0]) -> Shape
196
Supports (OCCT 6.9.0 and above):
197
- Fuzzy Boolean operations (global tolerance for a Boolean operation)
198
- Support of multiple arguments for a single Boolean operation
199
- Parallelization of Boolean Operations algorithm
201
Beginning from OCCT 6.8.1 a tolerance value can be specified.
202
Deprecated: use fuse() instead.</UserDocu>
205
<Methode Name="oldFuse" Const="true">
207
<UserDocu>Union of this and a given topo shape (old algorithm).
208
oldFuse(tool) -> Shape
212
<Methode Name="common" Const="true">
214
<UserDocu>Intersection of this and a given (list of) topo shape.
217
common((tool1,tool2,...),[tolerance=0.0]) -> Shape
220
- Fuzzy Boolean operations (global tolerance for a Boolean operation)
221
- Support of multiple arguments for a single Boolean operation (s1 AND (s2 OR s3))
222
- Parallelization of Boolean Operations algorithm
224
OCC 6.9.0 or later is required.</UserDocu>
227
<Methode Name="section" Const="true">
229
<UserDocu>Section of this with a given (list of) topo shape.
230
section(tool,[approximation=False]) -> Shape
232
section((tool1,tool2,...),[tolerance=0.0, approximation=False]) -> Shape
234
If approximation is True, section edges are approximated to a C1-continuous BSpline curve.
237
- Fuzzy Boolean operations (global tolerance for a Boolean operation)
238
- Support of multiple arguments for a single Boolean operation (s1 AND (s2 OR s3))
239
- Parallelization of Boolean Operations algorithm
241
OCC 6.9.0 or later is required.</UserDocu>
244
<Methode Name="slices" Const="true">
246
<UserDocu>Make slices of this shape.
247
slices(direction, distancesList) --> Wires
251
<Methode Name="slice" Const="true">
253
<UserDocu>Make single slice of this shape.
254
slice(direction, distance) --> Wires</UserDocu>
257
<Methode Name="cut" Const="true">
259
<UserDocu>Difference of this and a given (list of) topo shape
262
cut((tool1,tool2,...),[tolerance=0.0]) -> Shape
265
- Fuzzy Boolean operations (global tolerance for a Boolean operation)
266
- Support of multiple arguments for a single Boolean operation
267
- Parallelization of Boolean Operations algorithm
269
OCC 6.9.0 or later is required.</UserDocu>
272
<Methode Name="generalFuse" Const="true">
274
<UserDocu>Run general fuse algorithm (GFA) between this and given shapes.
275
generalFuse(list_of_other_shapes, [fuzzy_value = 0.0]) -> (result, map)
277
list_of_other_shapes: shapes to run the algorithm against (the list is
278
effectively prepended by 'self').
280
fuzzy_value: extra tolerance to apply when searching for interferences, in
281
addition to tolerances of the input shapes.
283
Returns a tuple of 2: (result, map).
285
result is a compound containing all the pieces generated by the algorithm
286
(e.g., for two spheres, the pieces are three touching solids). Pieces that
289
map is a list of lists of shapes, providing the info on which children of
290
result came from which argument. The length of list is equal to length of
291
list_of_other_shapes + 1. First element is a list of pieces that came from
292
shape of this, and the rest are those that come from corresponding shapes in
294
hint: use isSame method to test shape equality
296
Parallelization of Boolean Operations algorithm
298
OCC 6.9.0 or later is required.
302
<Methode Name="sewShape">
304
<UserDocu>Sew the shape if there is a gap.
309
<Methode Name="childShapes" Const="true">
311
<UserDocu>Return a list of sub-shapes that are direct children of this shape.
312
childShapes([cumOri=True, cumLoc=True]) -> list
314
* If cumOri is true, the function composes all
315
sub-shapes with the orientation of this shape.
316
* If cumLoc is true, the function multiplies all
317
sub-shapes by the location of this shape, i.e. it applies to
318
each sub-shape the transformation that is associated with this shape.
322
<Methode Name="ancestorsOfType" Const="true">
324
<UserDocu>For a sub-shape of this shape get its ancestors of a type.
325
ancestorsOfType(shape, shape type) -> list
329
<Methode Name="removeInternalWires">
331
<UserDocu>Removes internal wires (also holes) from the shape.
332
removeInternalWires(minimalArea) -> bool
336
<Methode Name="mirror" Const="true">
338
<UserDocu>Mirror this shape on a given plane.
339
mirror(base, norm) -> Shape
341
The plane is given with its base point and its normal direction.</UserDocu>
344
<Methode Name="transformGeometry" Const="true">
346
<UserDocu>Apply geometric transformation on this or a copy the shape.
347
transformGeometry(matrix) -> Shape
349
This method returns a new shape.
350
The transformation to be applied is defined as a 4x4 matrix.
351
The underlying geometry of the following shapes may change:
352
- a curve which supports an edge of the shape, or
353
- a surface which supports a face of the shape;
355
For example, a circle may be transformed into an ellipse when
356
applying an affinity transformation. It may also happen that
357
the circle then is represented as a B-spline curve.
359
The transformation is applied to:
360
- all the curves which support edges of the shape, and
361
- all the surfaces which support faces of the shape.
363
Note: If you want to transform a shape without changing the
364
underlying geometry then use the methods translate or rotate.
368
<Methode Name="transformShape">
370
<UserDocu>Apply transformation on a shape without changing the underlying geometry.
371
transformShape(Matrix,[boolean copy=False, checkScale=False]) -> None
373
If checkScale is True, it will use transformGeometry if non-uniform
374
scaling is detected.</UserDocu>
377
<Methode Name="transformed" Const="true" Keyword="true">
379
<UserDocu>Create a new transformed shape
380
transformed(Matrix,copy=False,checkScale=False,op=None) -> shape
384
<Methode Name="translate">
386
<UserDocu>Apply the translation to the current location of this shape.
391
<Methode Name="translated" Const="true">
393
<UserDocu>Create a new shape with translation
394
translated(vector) -> shape
398
<Methode Name="rotate">
400
<UserDocu>Apply the rotation (base,dir,degree) to the current location of this shape
401
rotate(base,dir,degree)
403
Shp.rotate(App.Vector(0,0,0),App.Vector(0,0,1),180) - rotate the shape around the Z Axis 180 degrees.
407
<Methode Name="rotated" Const="true">
409
<UserDocu>Create a new shape with rotation.
410
rotated(base,dir,degree) -> shape
414
<Methode Name="scale">
416
<UserDocu>Apply scaling with point and factor to this shape.
417
scale(factor,[base=App.Vector(0,0,0)])
421
<Methode Name="scaled" Const="true">
423
<UserDocu>Create a new shape with scale.
424
scaled(factor,[base=App.Vector(0,0,0)]) -> shape
428
<Methode Name="makeFillet" Const="true">
430
<UserDocu>Make fillet.
431
makeFillet(radius,edgeList) -> Shape
433
makeFillet(radius1,radius2,edgeList) -> Shape
437
<Methode Name="makeChamfer" Const="true">
439
<UserDocu>Make chamfer.
440
makeChamfer(radius,edgeList) -> Shape
442
makeChamfer(radius1,radius2,edgeList) -> Shape</UserDocu>
445
<Methode Name="makeThickness" Const="true">
447
<UserDocu>Hollow a solid according to given thickness and faces.
448
makeThickness(List of faces, Offset (Float), Tolerance (Float)) -> Shape
450
A hollowed solid is built from an initial solid and a set of faces on this solid,
451
which are to be removed. The remaining faces of the solid become the walls of
452
the hollowed solid, their thickness defined at the time of construction.</UserDocu>
455
<Methode Name="makeOffsetShape" Const="true" Keyword="true">
457
<UserDocu>makes an offset shape (3d offsetting).
458
makeOffsetShape(offset, tolerance, [inter = False, self_inter = False,
459
offsetMode = 0, join = 0, fill = False]) -> Shape
461
The function supports keyword arguments.
463
* offset: distance to expand the shape by. Negative value will shrink the
466
* tolerance: precision of approximation.
468
* inter: (parameter to OCC routine; not implemented)
470
* self_inter: (parameter to OCC routine; not implemented)
472
* offsetMode: 0 = skin; 1 = pipe; 2 = recto-verso
474
* join: method of offsetting non-tangent joints. 0 = arcs, 1 = tangent, 2 =
477
* fill: if true, offsetting a shell is to yield a solid
479
Returns: result of offsetting.</UserDocu>
482
<Methode Name="makeOffset2D" Const="true" Keyword="true">
484
<UserDocu>makes an offset shape (2d offsetting).
485
makeOffset2D(offset, [join = 0, fill = False, openResult = false, intersection =
488
The function supports keyword
489
arguments. Input shape (self) can be edge, wire, face, or a compound of those.
491
* offset: distance to expand the shape by. Negative value will shrink the
494
* join: method of offsetting non-tangent joints. 0 = arcs, 1 = tangent, 2 =
497
* fill: if true, the output is a face filling the space covered by offset. If
498
false, the output is a wire.
500
* openResult: affects the way open wires are processed. If False, an open wire
501
is made. If True, a closed wire is made from a double-sided offset, with rounds
504
* intersection: affects the way compounds are processed. If False, all children
505
are offset independently. If True, and children are edges/wires, the children
506
are offset in a collective manner. If compounding is nested, collectiveness
507
does not spread across compounds (only direct children of a compound are taken
510
Returns: result of offsetting (wire or face or compound of those). Compounding
511
structure follows that of source shape.</UserDocu>
514
<Methode Name="makeEvolved" Const="true" Keyword="true">
516
<UserDocu>Profile along the spine</UserDocu>
519
<Methode Name="makeWires" Const="true">
521
<UserDocu>make wire(s) using the edges of this shape
524
The function will sort any edges inside the current shape, and connect them
525
into wire. If more than one wire is found, then it will make a compound out of
528
This function is element mapping aware. If the input shape has non-zero Tag,
529
it will map any edge and vertex element name inside the input shape into the
532
op: an optional string to be appended when auto generates element mapping.
536
<Methode Name="reverse">
538
<UserDocu>Reverses the orientation of this shape.
543
<Methode Name="reversed" Const="true">
545
<UserDocu>Reverses the orientation of a copy of this shape.
550
<Methode Name="complement">
552
<UserDocu>Computes the complement of the orientation of this shape,
553
i.e. reverses the interior/exterior status of boundaries of this shape.
558
<Methode Name="nullify">
560
<UserDocu>Destroys the reference to the underlying shape stored in this shape.
561
As a result, this shape becomes null.
566
<Methode Name="isClosed" Const="true">
568
<UserDocu>Checks if the shape is closed.
571
If the shape is a shell it returns True if it has no free boundaries (edges).
572
If the shape is a wire it returns True if it has no free ends (vertices).
573
(Internal and External sub-shepes are ignored in these checks)
574
If the shape is an edge it returns True if its vertices are the same.
578
<Methode Name="isPartner" Const="true">
580
<UserDocu>Checks if both shapes share the same geometry.
581
Placement and orientation may differ.
582
isPartner(shape) -> bool
586
<Methode Name="isSame" Const="true">
588
<UserDocu>Checks if both shapes share the same geometry
589
and placement. Orientation may differ.
594
<Methode Name="isEqual" Const="true">
596
<UserDocu>Checks if both shapes are equal.
597
This means geometry, placement and orientation are equal.
598
isEqual(shape) -> bool
602
<Methode Name="isNull" Const="true">
604
<UserDocu>Checks if the shape is null.
605
isNull() -> bool</UserDocu>
608
<Methode Name="isValid" Const="true">
610
<UserDocu>Checks if the shape is valid, i.e. neither null, nor empty nor corrupted.
615
<Methode Name="isCoplanar" Const="true">
617
<UserDocu>Checks if this shape is coplanar with the given shape.
618
isCoplanar(shape,tol=None) -> bool
622
<Methode Name="isInfinite" Const="true">
624
<UserDocu>Checks if this shape has an infinite expansion.
629
<Methode Name="findPlane" Const="true">
631
<UserDocu>return a plane if the shape is planar
632
findPlane(tol=None) -> Shape
638
<UserDocu>Tries to fix a broken shape.
639
fix(working precision, minimum precision, maximum precision) -> bool
641
True is returned if the operation succeeded, False otherwise.
645
<Methode Name="hashCode" Const="true">
647
<UserDocu>This value is computed from the value of the underlying shape reference and the location.
650
Orientation is not taken into account.</UserDocu>
653
<Methode Name="tessellate" Const="true">
655
<UserDocu>Tessellate the shape and return a list of vertices and face indices
656
tessellate() -> (vertex,facets)
660
<Methode Name="project" Const="true">
662
<UserDocu>Project a list of shapes on this shape
663
project(shapeList) -> Shape
667
<Methode Name="makeParallelProjection" Const="true">
669
<UserDocu>Parallel projection of an edge or wire on this shape
670
makeParallelProjection(shape, dir) -> Shape
674
<Methode Name="makePerspectiveProjection" Const="true">
676
<UserDocu>Perspective projection of an edge or wire on this shape
677
makePerspectiveProjection(shape, pnt) -> Shape
681
<Methode Name="reflectLines" Const="true" Keyword="true">
683
<UserDocu>Build projection or reflect lines of a shape according to a view direction.
684
reflectLines(ViewDir, [ViewPos, UpDir, EdgeType, Visible, OnShape]) -> Shape (Compound of edges)
686
This algorithm computes the projection of the shape in the ViewDir direction.
687
If OnShape is False(default), the returned edges are flat on the XY plane defined by
688
ViewPos(origin) and UpDir(up direction).
689
If OnShape is True, the returned edges are the corresponding 3D reflect lines located on the shape.
690
EdgeType is a string defining the type of result edges :
691
- IsoLine : isoparametric line
692
- OutLine : outline (silhouette) edge
693
- Rg1Line : smooth edge of G1-continuity between two surfaces
694
- RgNLine : sewn edge of CN-continuity on one surface
695
- Sharp : sharp edge (of C0-continuity)
696
If Visible is True (default), only visible edges are returned.
697
If Visible is False, only invisible edges are returned.
701
<Methode Name="makeShapeFromMesh">
703
<UserDocu>Make a compound shape out of mesh data.
704
makeShapeFromMesh((vertex,facets),tolerance) -> Shape
706
Note: This should be used for rather small meshes only.</UserDocu>
709
<Methode Name="toNurbs" Const="true">
711
<UserDocu>Conversion of the complete geometry of a shape into NURBS geometry.
714
For example, all curves supporting edges of the basis shape are converted
715
into B-spline curves, and all surfaces supporting its faces are converted
716
into B-spline surfaces.</UserDocu>
719
<Methode Name="copy" Const="true">
721
<UserDocu>Create a copy of this shape
722
copy(copyGeom=True, copyMesh=False) -> Shape
724
If copyMesh is True, triangulation contained in original shape will be
725
copied along with geometry.
726
If copyGeom is False, only topological objects will be copied, while
727
geometry and triangulation will be shared with original shape.
731
<Methode Name="cleaned" Const="true">
733
<UserDocu>This creates a cleaned copy of the shape with the triangulation removed.
736
This can be useful to reduce file size when exporting as a BREP file.
737
Warning: Use the cleaned shape with care because certain algorithms may work incorrectly
738
if the shape has no internal triangulation any more.
742
<Methode Name="replaceShape" Const="true">
744
<UserDocu>Replace a sub-shape with a new shape and return a new shape.
745
replaceShape(tupleList) -> Shape
747
The parameter is in the form list of tuples with the two shapes.</UserDocu>
750
<Methode Name="removeShape" Const="true">
752
<UserDocu>Remove a sub-shape and return a new shape.
753
removeShape(shapeList) -> Shape
755
The parameter is a list of shapes.</UserDocu>
758
<Methode Name="defeaturing" Const="true">
760
<UserDocu>Remove a feature defined by supplied faces and return a new shape.
761
defeaturing(shapeList) -> Shape
763
The parameter is a list of faces.</UserDocu>
766
<Methode Name="isInside" Const="true">
768
<UserDocu>Checks whether a point is inside or outside the shape.
769
isInside(point, tolerance, checkFace) => Boolean
771
checkFace indicates if the point lying directly on a face is considered to be inside or not
775
<Methode Name="removeSplitter" Const="true">
777
<UserDocu>Removes redundant edges from the B-REP model
778
removeSplitter() -> Shape
782
<Methode Name="proximity" Const="true">
784
<UserDocu>Returns two lists of Face indexes for the Faces involved in the intersection.
785
proximity(shape,[tolerance]) -> (selfFaces, shapeFaces)
789
<Methode Name="distToShape" Const="true">
791
<UserDocu>Find the minimum distance to another shape.
792
distToShape(shape, tol=1e-7) -> (dist, vectors, infos)
794
dist is the minimum distance, in mm (float value).
796
vectors is a list of pairs of App.Vector. Each pair corresponds to solution.
797
Example: [(App.Vector(2.0, -1.0, 2.0), App.Vector(2.0, 0.0, 2.0)),
798
(App.Vector(2.0, -1.0, 2.0), App.Vector(2.0, -1.0, 3.0))]
799
First vector is a point on self, second vector is a point on s.
801
infos contains additional info on the solutions. It is a list of tuples:
802
(topo1, index1, params1, topo2, index2, params2)
804
topo1, topo2 are strings identifying type of BREP element: 'Vertex',
807
index1, index2 are indexes of the elements (zero-based).
809
params1, params2 are parameters of internal space of the elements. For
810
vertices, params is None. For edges, params is one float, u. For faces,
811
params is a tuple (u,v). </UserDocu>
814
<Methode Name="getElement" Const="true">
818
getElement(elementName, [silent = False]) -> Face | Edge | Vertex
819
elementName: SubElement name - i.e. 'Edge1', 'Face3' etc.
820
Accepts TNP mitigation mapped names as well
821
silent: True to suppress the exception throw if the shape isn't found.
825
<Methode Name="countElement" Const="true">
827
<UserDocu>Returns the count of a type of element
828
countElement(type) -> int
832
<Methode Name="mapSubElement">
835
mapSubElement(shape|[shape...], op='') - maps the sub element of other shape
837
shape: other shape or sequence of shapes to map the sub-elements
838
op: optional string prefix to append before the mapped sub element names
842
<Methode Name="mapShapes">
845
mapShapes(generated, modified, op='')
847
generate element names with user defined mapping
849
generated: a list of tuple(src, dst) that indicating src shape or shapes
850
generates dst shape or shapes. Note that the dst shape or shapes
851
must be sub-shapes of this shape.
852
modified: a list of tuple(src, dst) that indicating src shape or shapes
853
modifies into dst shape or shapes. Note that the dst shape or
854
shapes must be sub-shapes of this shape.
855
op: optional string prefix to append before the mapped sub element names
859
<Methode Name="getElementHistory" Const="true">
862
getElementHistory(name) - returns the element mapped name history
864
name: mapped element name belonging to this shape
866
Returns tuple(sourceShapeTag, sourceName, [intermediateNames...]),
867
or None if no history.
871
<Methode Name="getTolerance" Const="true">
873
<UserDocu>Determines a tolerance from the ones stored in a shape
874
getTolerance(mode, ShapeType=Shape) -> float
876
mode = 0 : returns the average value between sub-shapes,
877
mode > 0 : returns the maximal found,
878
mode < 0 : returns the minimal found.
879
ShapeType defines what kinds of sub-shapes to consider:
880
Shape (default) : all : Vertex, Edge, Face,
881
Vertex : only vertices,
884
Shell : combined Shell + Face, for each face (and containing
885
shell), also checks edge and Vertex
889
<Methode Name="overTolerance" Const="true">
891
<UserDocu>Determines which shapes have a tolerance over the given value
892
overTolerance(value, [ShapeType=Shape]) -> ShapeList
894
ShapeType is interpreted as in the method getTolerance
898
<Methode Name="inTolerance" Const="true">
900
<UserDocu>Determines which shapes have a tolerance within a given interval
901
inTolerance(value, [ShapeType=Shape]) -> ShapeList
903
ShapeType is interpreted as in the method getTolerance
907
<Methode Name="globalTolerance" Const="true">
909
<UserDocu>Returns the computed tolerance according to the mode
910
globalTolerance(mode) -> float
918
<Methode Name="fixTolerance" Const="true">
920
<UserDocu>Sets (enforces) tolerances in a shape to the given value
921
fixTolerance(value, [ShapeType=Shape])
923
ShapeType = Vertex : only vertices are set
924
ShapeType = Edge : only edges are set
925
ShapeType = Face : only faces are set
926
ShapeType = Wire : to have edges and their vertices set
927
ShapeType = other value : all (vertices,edges,faces) are set
931
<Methode Name="limitTolerance" Const="true">
933
<UserDocu>Limits tolerances in a shape
934
limitTolerance(tmin, [tmax=0, ShapeType=Shape]) -> bool
936
tmin = tmax -> as fixTolerance (forces)
937
tmin = 0 -> maximum tolerance will be tmax
938
tmax = 0 or not given (more generally, tmax < tmin) ->
939
tmax ignored, minimum will be tmin
940
else, maximum will be max and minimum will be min
941
ShapeType = Vertex : only vertices are set
942
ShapeType = Edge : only edges are set
943
ShapeType = Face : only faces are set
944
ShapeType = Wire : to have edges and their vertices set
945
ShapeType = other value : all (vertices,edges,faces) are set
946
Returns True if at least one tolerance of the sub-shape has been modified
950
<Methode Name="optimalBoundingBox" Const="true">
952
<UserDocu>Get the optimal bounding box
953
optimalBoundingBox([useTriangulation = True, useShapeTolerance = False]) -> bound box
957
<Methode Name="clearCache" Const="true">
959
<UserDocu>Clear internal sub-shape cache</UserDocu>
962
<Methode Name="findSubShape" Const="true">
965
findSubShape(shape) -> (type_name, index)
967
Find sub shape and return the shape type name and index. If not found,
968
then return (None, 0)
972
<Methode Name="findSubShapesWithSharedVertex" Const="true" Keyword="true">
975
findSubShapesWithSharedVertex(shape, needName=False, checkGeometry=True, tol=1e-7, atol=1e-12) -> Shape
977
shape: input elementary shape, currently only support Face, Edge, or Vertex
979
needName: if True, return a list of tuple(name, shape), or else return a list
982
checkGeometry: whether to compare geometry
984
tol: distance tolerance
986
atol: angular tolerance
988
Search sub shape by checking vertex coordinates and comparing the underlying
989
geometries, This can find shapes that are copied. It currently only works with
990
elementary shapes, Face, Edge, Vertex.
994
<Methode Name="getChildShapes" Const="true">
997
getChildShapes(shapetype, avoidtype='') -> list(Shape)
999
Return a list of child sub-shapes of given type.
1001
shapetype: the type of requesting sub shapes
1002
avoidtype: optional shape type to skip when exploring
1014
<Attribute Name="ShapeType" ReadOnly="true">
1016
<UserDocu>Returns the type of the shape.</UserDocu>
1018
<Parameter Name="ShapeType" Type="String"/>
1020
<Attribute Name="Orientation" ReadOnly="false">
1022
<UserDocu>Returns the orientation of the shape.</UserDocu>
1024
<Parameter Name="Orientation" Type="String"/>
1026
<Attribute Name="Faces" ReadOnly="true">
1028
<UserDocu>List of faces in this shape.</UserDocu>
1030
<Parameter Name="Faces" Type="List"/>
1032
<Attribute Name="Vertexes" ReadOnly="true">
1034
<UserDocu>List of vertexes in this shape.</UserDocu>
1036
<Parameter Name="Vertexes" Type="List"/>
1038
<Attribute Name="Shells" ReadOnly="true">
1040
<UserDocu>List of subsequent shapes in this shape.</UserDocu>
1042
<Parameter Name="Shells" Type="List"/>
1044
<Attribute Name="Solids" ReadOnly="true">
1046
<UserDocu>List of subsequent shapes in this shape.</UserDocu>
1048
<Parameter Name="Solids" Type="List"/>
1050
<Attribute Name="CompSolids" ReadOnly="true">
1052
<UserDocu>List of subsequent shapes in this shape.</UserDocu>
1054
<Parameter Name="CompSolids" Type="List"/>
1056
<Attribute Name="Edges" ReadOnly="true">
1058
<UserDocu>List of Edges in this shape.</UserDocu>
1060
<Parameter Name="Edges" Type="List"/>
1062
<Attribute Name="Wires" ReadOnly="true">
1064
<UserDocu>List of wires in this shape.</UserDocu>
1066
<Parameter Name="Wires" Type="List"/>
1068
<Attribute Name="Compounds" ReadOnly="true">
1070
<UserDocu>List of compounds in this shape.</UserDocu>
1072
<Parameter Name="Compounds" Type="List"/>
1074
<Attribute Name="SubShapes" ReadOnly="true">
1076
<UserDocu>List of sub-shapes in this shape.</UserDocu>
1078
<Parameter Name="SubShapes" Type="List"/>
1080
<Attribute Name="Length" ReadOnly="true">
1082
<UserDocu>Total length of the edges of the shape.</UserDocu>
1084
<Parameter Name="Length" Type="Float"/>
1086
<Attribute Name="Area" ReadOnly="true">
1088
<UserDocu>Total area of the faces of the shape.</UserDocu>
1090
<Parameter Name="Area" Type="Float"/>
1092
<Attribute Name="Volume" ReadOnly="true">
1094
<UserDocu>Total volume of the solids of the shape.</UserDocu>
1096
<Parameter Name="Volume" Type="Float"/>