FreeCAD

Форк
0
/
TopoShapePy.xml 
1099 строк · 39.8 Кб
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="ComplexGeoDataPy"
5
      Name="TopoShapePy"
6
      Twin="TopoShape"
7
      TwinPointer="TopoShape"
8
      Include="Mod/Part/App/TopoShape.h"
9
      Namespace="Part"
10
      FatherInclude="App/ComplexGeoDataPy.h"
11
      FatherNamespace="Data"
12
      Constructor="true">
13
    <Documentation>
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>
20
    </Documentation>
21
    <Methode Name="dumps" Const="true">
22
      <Documentation>
23
        <UserDocu>Serialize the content of this shape to a string in BREP format.</UserDocu>
24
      </Documentation>
25
    </Methode>
26
    <Methode Name="loads">
27
      <Documentation>
28
        <UserDocu>Deserialize the content of this shape from a string in BREP format.</UserDocu>
29
      </Documentation>
30
    </Methode>
31
    <Methode Name="read">
32
      <Documentation>
33
        <UserDocu>Read in an IGES, STEP or BREP file.
34
read(filename)
35
        </UserDocu>
36
      </Documentation>
37
    </Methode>
38
    <Methode Name="writeInventor" Const="true" Keyword="true">
39
      <Documentation>
40
        <UserDocu>Write the mesh in OpenInventor format to a string.
41
writeInventor() -> string
42
        </UserDocu>
43
      </Documentation>
44
    </Methode>
45
    <Methode Name="exportIges" Const="true">
46
      <Documentation>
47
        <UserDocu>Export the content of this shape to an IGES file.
48
exportIges(filename)
49
        </UserDocu>
50
      </Documentation>
51
    </Methode>
52
    <Methode Name="exportStep" Const="true">
53
      <Documentation>
54
        <UserDocu>Export the content of this shape to an STEP file.
55
exportStep(filename)
56
        </UserDocu>
57
      </Documentation>
58
    </Methode>
59
    <Methode Name="exportBrep" Const="true">
60
      <Documentation>
61
        <UserDocu>Export the content of this shape to an BREP file.
62
exportBrep(filename)
63
--
64
BREP is an OpenCasCade native format.
65
        </UserDocu>
66
      </Documentation>
67
    </Methode>
68
    <Methode Name="exportBinary" Const="true">
69
      <Documentation>
70
        <UserDocu>Export the content of this shape in binary format to a file.
71
exportBinary(filename)
72
        </UserDocu>
73
      </Documentation>
74
    </Methode>
75
    <Methode Name="exportBrepToString" Const="true">
76
      <Documentation>
77
        <UserDocu>Export the content of this shape to a string in BREP format.
78
exportBrepToString() -> string
79
--
80
BREP is an OpenCasCade native format.</UserDocu>
81
      </Documentation>
82
    </Methode>
83
    <Methode Name="dumpToString" Const="true">
84
      <Documentation>
85
        <UserDocu>Dump information about the shape to a string.
86
dumpToString() -> string</UserDocu>
87
      </Documentation>
88
    </Methode>
89
    <Methode Name="exportStl" Const="true">
90
      <Documentation>
91
        <UserDocu>Export the content of this shape to an STL mesh file.
92
exportStl(filename)</UserDocu>
93
      </Documentation>
94
    </Methode>
95
    <Methode Name="importBrep">
96
      <Documentation>
97
        <UserDocu>Load the shape from a file in BREP format.
98
importBrep(filename)</UserDocu>
99
      </Documentation>
100
    </Methode>
101
    <Methode Name="importBinary">
102
      <Documentation>
103
        <UserDocu>Import the content to this shape of a string in BREP format.
104
importBinary(filename)</UserDocu>
105
      </Documentation>
106
    </Methode>
107
    <Methode Name="importBrepFromString">
108
      <Documentation>
109
        <UserDocu>Load the shape from a string that keeps the content in BREP format.
110
importBrepFromString(string, [displayProgressBar=True])
111
--
112
importBrepFromString(str,False) to not display a progress bar.
113
        </UserDocu>
114
      </Documentation>
115
    </Methode>
116
    <Methode Name="extrude" Const="true">
117
      <Documentation>
118
        <UserDocu>Extrude the shape along a vector.
119
extrude(vector) -> Shape
120
--
121
Shp2 = Shp1.extrude(App.Vector(0,0,10)) - extrude the shape 10 mm in the +Z direction.</UserDocu>
122
      </Documentation>
123
    </Methode>
124
    <Methode Name="revolve" Const="true">
125
      <Documentation>
126
        <UserDocu>Revolve the shape around an Axis to a given degree.
127
revolve(base, direction, angle)
128
--
129
Part.revolve(App.Vector(0,0,0),App.Vector(0,0,1),360) - revolves the shape around the Z Axis 360 degree.
130

131
Hints: Sometimes you want to create a rotation body out of a closed edge or wire.
132
Example:
133
from FreeCAD import Base
134
import Part
135
V=Base.Vector
136

137
e=Part.Ellipse()
138
s=e.toShape()
139
r=s.revolve(V(0,0,0),V(0,1,0), 360)
140
Part.show(r)
141

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)
146

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

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

154
from FreeCAD import Base
155
import Part
156
V=Base.Vector
157

158
e=Part.Ellipse()
159
s=e.toShape(e.LastParameter/4,3*e.LastParameter/4)
160
r=s.revolve(V(0,0,0),V(0,1,0), 360)
161
Part.show(r)
162
        </UserDocu>
163
      </Documentation>
164
    </Methode>
165
    <Methode Name="check" Const="true">
166
      <Documentation>
167
        <UserDocu>Checks the shape and report errors in the shape structure.
168
check([runBopCheck = False])
169
--
170
This is a more detailed check as done in isValid().
171
if runBopCheck is True, a BOPCheck analysis is also performed.</UserDocu>
172
      </Documentation>
173
    </Methode>
174
    <Methode Name="fuse" Const="true">
175
      <Documentation>
176
        <UserDocu>Union of this and a given (list of) topo shape.
177
fuse(tool) -> Shape
178
  or
179
fuse((tool1,tool2,...),[tolerance=0.0]) -> Shape
180
--
181
Union of this and a given list of topo shapes.
182

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
187

188
Beginning from OCCT 6.8.1 a tolerance value can be specified.</UserDocu>
189
      </Documentation>
190
    </Methode>
191
    <Methode Name="multiFuse" Const="true">
192
      <Documentation>
193
        <UserDocu>Union of this and a given list of topo shapes.
194
multiFuse((tool1,tool2,...),[tolerance=0.0]) -> Shape
195
--
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
200

201
Beginning from OCCT 6.8.1 a tolerance value can be specified.
202
Deprecated: use fuse() instead.</UserDocu>
203
      </Documentation>
204
    </Methode>
205
    <Methode Name="oldFuse" Const="true">
206
      <Documentation>
207
        <UserDocu>Union of this and a given topo shape (old algorithm).
208
oldFuse(tool) -> Shape
209
        </UserDocu>
210
      </Documentation>
211
    </Methode>
212
    <Methode Name="common" Const="true">
213
      <Documentation>
214
        <UserDocu>Intersection of this and a given (list of) topo shape.
215
common(tool) -> Shape
216
  or
217
common((tool1,tool2,...),[tolerance=0.0]) -> Shape
218
--
219
Supports:
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
223

224
OCC 6.9.0 or later is required.</UserDocu>
225
      </Documentation>
226
    </Methode>
227
    <Methode Name="section" Const="true">
228
      <Documentation>
229
        <UserDocu>Section of this with a given (list of) topo shape.
230
section(tool,[approximation=False]) -> Shape
231
  or
232
section((tool1,tool2,...),[tolerance=0.0, approximation=False]) -> Shape
233
--
234
If approximation is True, section edges are approximated to a C1-continuous BSpline curve.
235

236
Supports:
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
240

241
OCC 6.9.0 or later is required.</UserDocu>
242
      </Documentation>
243
    </Methode>
244
    <Methode Name="slices" Const="true">
245
      <Documentation>
246
        <UserDocu>Make slices of this shape.
247
slices(direction, distancesList) --> Wires
248
        </UserDocu>
249
      </Documentation>
250
    </Methode>
251
    <Methode Name="slice" Const="true">
252
      <Documentation>
253
        <UserDocu>Make single slice of this shape.
254
slice(direction, distance) --> Wires</UserDocu>
255
      </Documentation>
256
    </Methode>
257
    <Methode Name="cut" Const="true">
258
      <Documentation>
259
        <UserDocu>Difference of this and a given (list of) topo shape
260
cut(tool) -> Shape
261
  or
262
cut((tool1,tool2,...),[tolerance=0.0]) -> Shape
263
--
264
Supports:
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
268

269
OCC 6.9.0 or later is required.</UserDocu>
270
      </Documentation>
271
    </Methode>
272
    <Methode Name="generalFuse" Const="true">
273
      <Documentation>
274
        <UserDocu>Run general fuse algorithm (GFA) between this and given shapes.
275
generalFuse(list_of_other_shapes, [fuzzy_value = 0.0]) -> (result, map)
276
--
277
list_of_other_shapes: shapes to run the algorithm against (the list is
278
effectively prepended by 'self').
279

280
fuzzy_value: extra tolerance to apply when searching for interferences, in
281
addition to tolerances of the input shapes.
282

283
Returns a tuple of 2: (result, map).
284

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
287
touch share elements.
288

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
293
list_of_other_shapes.
294
hint: use isSame method to test shape equality
295

296
Parallelization of Boolean Operations algorithm
297

298
OCC 6.9.0 or later is required.
299
</UserDocu>
300
      </Documentation>
301
    </Methode>
302
    <Methode Name="sewShape">
303
      <Documentation>
304
        <UserDocu>Sew the shape if there is a gap.
305
sewShape()
306
        </UserDocu>
307
      </Documentation>
308
    </Methode>
309
    <Methode Name="childShapes" Const="true">
310
      <Documentation>
311
        <UserDocu>Return a list of sub-shapes that are direct children of this shape.
312
childShapes([cumOri=True, cumLoc=True]) -> list
313
--
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.
319
        </UserDocu>
320
      </Documentation>
321
    </Methode>
322
    <Methode Name="ancestorsOfType" Const="true">
323
      <Documentation>
324
        <UserDocu>For a sub-shape of this shape get its ancestors of a type.
325
ancestorsOfType(shape, shape type) -> list
326
        </UserDocu>
327
      </Documentation>
328
    </Methode>
329
    <Methode Name="removeInternalWires">
330
      <Documentation>
331
        <UserDocu>Removes internal wires (also holes) from the shape.
332
removeInternalWires(minimalArea) -> bool
333
        </UserDocu>
334
      </Documentation>
335
    </Methode>
336
    <Methode Name="mirror" Const="true">
337
      <Documentation>
338
        <UserDocu>Mirror this shape on a given plane.
339
mirror(base, norm) -> Shape
340
--
341
The plane is given with its base point and its normal direction.</UserDocu>
342
      </Documentation>
343
    </Methode>
344
    <Methode Name="transformGeometry" Const="true">
345
      <Documentation>
346
        <UserDocu>Apply geometric transformation on this or a copy the shape.
347
transformGeometry(matrix) -> Shape
348
--
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;
354

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

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

363
Note: If you want to transform a shape without changing the
364
underlying geometry then use the methods translate or rotate.
365
</UserDocu>
366
      </Documentation>
367
    </Methode>
368
    <Methode Name="transformShape">
369
      <Documentation>
370
        <UserDocu>Apply transformation on a shape without changing the underlying geometry.
371
transformShape(Matrix,[boolean copy=False, checkScale=False]) -> None
372
--
373
If checkScale is True, it will use transformGeometry if non-uniform
374
scaling is detected.</UserDocu>
375
      </Documentation>
376
    </Methode>
377
    <Methode Name="transformed" Const="true"  Keyword="true">
378
      <Documentation>
379
          <UserDocu>Create a new transformed shape
380
transformed(Matrix,copy=False,checkScale=False,op=None) -> shape
381
        </UserDocu>
382
      </Documentation>
383
    </Methode>
384
    <Methode Name="translate">
385
      <Documentation>
386
        <UserDocu>Apply the translation to the current location of this shape.
387
translate(vector)
388
        </UserDocu>
389
      </Documentation>
390
    </Methode>
391
    <Methode Name="translated" Const="true">
392
      <Documentation>
393
          <UserDocu>Create a new shape with translation
394
translated(vector) -> shape
395
         </UserDocu>
396
      </Documentation>
397
    </Methode>
398
    <Methode Name="rotate">
399
      <Documentation>
400
        <UserDocu>Apply the rotation (base,dir,degree) to the current location of this shape
401
rotate(base,dir,degree)
402
--
403
Shp.rotate(App.Vector(0,0,0),App.Vector(0,0,1),180) - rotate the shape around the Z Axis 180 degrees.
404
        </UserDocu>
405
      </Documentation>
406
    </Methode>
407
    <Methode Name="rotated" Const="true">
408
      <Documentation>
409
        <UserDocu>Create a new shape with rotation.
410
rotated(base,dir,degree) -> shape
411
        </UserDocu>
412
      </Documentation>
413
    </Methode>
414
    <Methode Name="scale">
415
      <Documentation>
416
        <UserDocu>Apply scaling with point and factor to this shape.
417
scale(factor,[base=App.Vector(0,0,0)])
418
        </UserDocu>
419
      </Documentation>
420
    </Methode>
421
    <Methode Name="scaled" Const="true">
422
      <Documentation>
423
          <UserDocu>Create a new shape with scale.
424
scaled(factor,[base=App.Vector(0,0,0)]) -> shape
425
          </UserDocu>
426
      </Documentation>
427
    </Methode>
428
    <Methode Name="makeFillet" Const="true">
429
      <Documentation>
430
        <UserDocu>Make fillet.
431
makeFillet(radius,edgeList) -> Shape
432
or
433
makeFillet(radius1,radius2,edgeList) -> Shape
434
        </UserDocu>
435
      </Documentation>
436
    </Methode>
437
    <Methode Name="makeChamfer" Const="true">
438
      <Documentation>
439
        <UserDocu>Make chamfer.
440
makeChamfer(radius,edgeList) -> Shape
441
or
442
makeChamfer(radius1,radius2,edgeList) -> Shape</UserDocu>
443
      </Documentation>
444
    </Methode>
445
    <Methode Name="makeThickness" Const="true">
446
      <Documentation>
447
        <UserDocu>Hollow a solid according to given thickness and faces.
448
makeThickness(List of faces, Offset (Float), Tolerance (Float)) -> Shape
449
--
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>
453
      </Documentation>
454
    </Methode>
455
    <Methode Name="makeOffsetShape" Const="true"  Keyword="true">
456
      <Documentation>
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
460
--
461
The function supports keyword arguments.
462

463
* offset: distance to expand the shape by. Negative value will shrink the
464
shape.
465

466
* tolerance: precision of approximation.
467

468
* inter: (parameter to OCC routine; not implemented)
469

470
* self_inter: (parameter to OCC routine; not implemented)
471

472
* offsetMode: 0 = skin; 1 = pipe; 2 = recto-verso
473

474
* join: method of offsetting non-tangent joints. 0 = arcs, 1 = tangent, 2 =
475
intersection
476

477
* fill: if true, offsetting a shell is to yield a solid
478

479
Returns: result of offsetting.</UserDocu>
480
      </Documentation>
481
    </Methode>
482
    <Methode Name="makeOffset2D" Const="true"  Keyword="true">
483
      <Documentation>
484
      <UserDocu>makes an offset shape (2d offsetting).
485
makeOffset2D(offset, [join = 0, fill = False, openResult = false, intersection =
486
false]) -> Shape
487
--
488
The function supports keyword
489
arguments. Input shape (self) can be edge, wire, face, or a compound of those.
490

491
* offset: distance to expand the shape by. Negative value will shrink the
492
shape.
493

494
* join: method of offsetting non-tangent joints. 0 = arcs, 1 = tangent, 2 =
495
intersection
496

497
* fill: if true, the output is a face filling the space covered by offset. If
498
false, the output is a wire.
499

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
502
around open vertices.
503

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
508
collectively).
509

510
Returns: result of offsetting (wire or face or compound of those). Compounding
511
structure follows that of source shape.</UserDocu>
512
      </Documentation>
513
    </Methode>
514
      <Methode Name="makeEvolved" Const="true" Keyword="true">
515
          <Documentation>
516
              <UserDocu>Profile along the spine</UserDocu>
517
          </Documentation>
518
      </Methode>
519
    <Methode Name="makeWires" Const="true">
520
      <Documentation>
521
        <UserDocu>make wire(s) using the edges of this shape
522
makeWires([op=None])
523
--
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
526
all found wires.
527

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
530
itself.
531

532
op: an optional string to be appended when auto generates element mapping.
533
        </UserDocu>
534
      </Documentation>
535
    </Methode>
536
    <Methode Name="reverse">
537
      <Documentation>
538
        <UserDocu>Reverses the orientation of this shape.
539
reverse()
540
        </UserDocu>
541
      </Documentation>
542
    </Methode>
543
    <Methode Name="reversed" Const="true">
544
      <Documentation>
545
        <UserDocu>Reverses the orientation of a copy of this shape.
546
reversed() -> Shape
547
        </UserDocu>
548
      </Documentation>
549
    </Methode>
550
    <Methode Name="complement">
551
      <Documentation>
552
        <UserDocu>Computes the complement of the orientation of this shape,
553
i.e. reverses the interior/exterior status of boundaries of this shape.
554
complement()
555
        </UserDocu>
556
      </Documentation>
557
    </Methode>
558
    <Methode Name="nullify">
559
      <Documentation>
560
        <UserDocu>Destroys the reference to the underlying shape stored in this shape.
561
As a result, this shape becomes null.
562
nullify()
563
        </UserDocu>
564
      </Documentation>
565
    </Methode>
566
    <Methode Name="isClosed" Const="true">
567
      <Documentation>
568
        <UserDocu>Checks if the shape is closed.
569
isClosed() -> bool
570
--
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.
575
</UserDocu>
576
      </Documentation>
577
    </Methode>
578
    <Methode Name="isPartner" Const="true">
579
      <Documentation>
580
        <UserDocu>Checks if both shapes share the same geometry.
581
Placement and orientation may differ.
582
isPartner(shape) -> bool
583
        </UserDocu>
584
      </Documentation>
585
    </Methode>
586
    <Methode Name="isSame" Const="true">
587
      <Documentation>
588
        <UserDocu>Checks if both shapes share the same geometry
589
        and placement. Orientation may differ.
590
isSame(shape) -> bool
591
        </UserDocu>
592
      </Documentation>
593
    </Methode>
594
    <Methode Name="isEqual" Const="true">
595
      <Documentation>
596
        <UserDocu>Checks if both shapes are equal.
597
        This means geometry, placement and orientation are equal.
598
isEqual(shape) -> bool
599
        </UserDocu>
600
      </Documentation>
601
    </Methode>
602
    <Methode Name="isNull" Const="true">
603
      <Documentation>
604
        <UserDocu>Checks if the shape is null.
605
isNull() -> bool</UserDocu>
606
      </Documentation>
607
    </Methode>
608
    <Methode Name="isValid" Const="true">
609
      <Documentation>
610
        <UserDocu>Checks if the shape is valid, i.e. neither null, nor empty nor corrupted.
611
isValid() -> bool
612
        </UserDocu>
613
      </Documentation>
614
    </Methode>
615
    <Methode Name="isCoplanar" Const="true">
616
      <Documentation>
617
        <UserDocu>Checks if this shape is coplanar with the given shape.
618
isCoplanar(shape,tol=None) -> bool
619
        </UserDocu>
620
      </Documentation>
621
    </Methode>
622
    <Methode Name="isInfinite" Const="true">
623
      <Documentation>
624
        <UserDocu>Checks if this shape has an infinite expansion.
625
isInfinite() -> bool
626
        </UserDocu>
627
      </Documentation>
628
    </Methode>
629
    <Methode Name="findPlane" Const="true">
630
      <Documentation>
631
          <UserDocu>return a plane if the shape is planar
632
findPlane(tol=None) -> Shape
633
          </UserDocu>
634
      </Documentation>
635
    </Methode>
636
    <Methode Name="fix">
637
      <Documentation>
638
        <UserDocu>Tries to fix a broken shape.
639
fix(working precision, minimum precision, maximum precision) -> bool
640
--
641
True is returned if the operation succeeded, False otherwise.
642
        </UserDocu>
643
      </Documentation>
644
    </Methode>
645
    <Methode Name="hashCode" Const="true">
646
      <Documentation>
647
        <UserDocu>This value is computed from the value of the underlying shape reference and the location.
648
hashCode() -> int
649
--
650
Orientation is not taken into account.</UserDocu>
651
      </Documentation>
652
    </Methode>
653
    <Methode Name="tessellate" Const="true">
654
      <Documentation>
655
        <UserDocu>Tessellate the shape and return a list of vertices and face indices
656
tessellate() -> (vertex,facets)
657
        </UserDocu>
658
      </Documentation>
659
    </Methode>
660
    <Methode Name="project" Const="true">
661
      <Documentation>
662
        <UserDocu>Project a list of shapes on this shape
663
project(shapeList) -> Shape
664
        </UserDocu>
665
      </Documentation>
666
    </Methode>
667
    <Methode Name="makeParallelProjection" Const="true">
668
      <Documentation>
669
        <UserDocu>Parallel projection of an edge or wire on this shape
670
makeParallelProjection(shape, dir) -> Shape
671
        </UserDocu>
672
      </Documentation>
673
    </Methode>
674
    <Methode Name="makePerspectiveProjection" Const="true">
675
      <Documentation>
676
        <UserDocu>Perspective projection of an edge or wire on this shape
677
makePerspectiveProjection(shape, pnt) -> Shape
678
        </UserDocu>
679
      </Documentation>
680
    </Methode>
681
    <Methode Name="reflectLines" Const="true" Keyword="true">
682
      <Documentation>
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)
685
--
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.
698
        </UserDocu>
699
      </Documentation>
700
    </Methode>
701
    <Methode Name="makeShapeFromMesh">
702
      <Documentation>
703
        <UserDocu>Make a compound shape out of mesh data.
704
makeShapeFromMesh((vertex,facets),tolerance) -> Shape
705
--
706
Note: This should be used for rather small meshes only.</UserDocu>
707
      </Documentation>
708
    </Methode>
709
    <Methode Name="toNurbs" Const="true">
710
      <Documentation>
711
        <UserDocu>Conversion of the complete geometry of a shape into NURBS geometry.
712
toNurbs() -> Shape
713
--
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>
717
      </Documentation>
718
    </Methode>
719
    <Methode Name="copy" Const="true">
720
      <Documentation>
721
        <UserDocu>Create a copy of this shape
722
copy(copyGeom=True, copyMesh=False) -> Shape
723
--
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.
728
</UserDocu>
729
      </Documentation>
730
    </Methode>
731
    <Methode Name="cleaned" Const="true">
732
      <Documentation>
733
        <UserDocu>This creates a cleaned copy of the shape with the triangulation removed.
734
clean()
735
--
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.
739
</UserDocu>
740
      </Documentation>
741
    </Methode>
742
    <Methode Name="replaceShape" Const="true">
743
      <Documentation>
744
        <UserDocu>Replace a sub-shape with a new shape and return a new shape.
745
replaceShape(tupleList) -> Shape
746
--
747
The parameter is in the form list of tuples with the two shapes.</UserDocu>
748
      </Documentation>
749
    </Methode>
750
    <Methode Name="removeShape" Const="true">
751
      <Documentation>
752
        <UserDocu>Remove a sub-shape and return a new shape.
753
removeShape(shapeList) -> Shape
754
--
755
The parameter is a list of shapes.</UserDocu>
756
      </Documentation>
757
    </Methode>
758
    <Methode Name="defeaturing" Const="true">
759
      <Documentation>
760
        <UserDocu>Remove a feature defined by supplied faces and return a new shape.
761
defeaturing(shapeList) -> Shape
762
--
763
The parameter is a list of faces.</UserDocu>
764
      </Documentation>
765
    </Methode>
766
    <Methode Name="isInside" Const="true">
767
      <Documentation>
768
        <UserDocu>Checks whether a point is inside or outside the shape.
769
isInside(point, tolerance, checkFace) => Boolean
770
--
771
checkFace indicates if the point lying directly on a face is considered to be inside or not
772
        </UserDocu>
773
      </Documentation>
774
    </Methode>
775
    <Methode Name="removeSplitter" Const="true">
776
      <Documentation>
777
        <UserDocu>Removes redundant edges from the B-REP model
778
removeSplitter() -> Shape
779
</UserDocu>
780
      </Documentation>
781
    </Methode>
782
    <Methode Name="proximity" Const="true">
783
      <Documentation>
784
        <UserDocu>Returns two lists of Face indexes for the Faces involved in the intersection.
785
proximity(shape,[tolerance]) -> (selfFaces, shapeFaces)
786
        </UserDocu>
787
      </Documentation>
788
    </Methode>
789
    <Methode Name="distToShape" Const="true">
790
      <Documentation>
791
        <UserDocu>Find the minimum distance to another shape.
792
distToShape(shape, tol=1e-7) -> (dist, vectors, infos)
793
--
794
dist is the minimum distance, in mm (float value).
795

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

801
infos contains additional info on the solutions. It is a list of tuples:
802
(topo1, index1, params1, topo2, index2, params2)
803

804
    topo1, topo2 are strings identifying type of BREP element: 'Vertex',
805
    'Edge', or 'Face'.
806

807
    index1, index2 are indexes of the elements (zero-based).
808

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>
812
      </Documentation>
813
    </Methode>
814
    <Methode Name="getElement" Const="true">
815
      <Documentation>
816
        <UserDocu>
817
Returns a SubElement
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.
822
        </UserDocu>
823
      </Documentation>
824
    </Methode>
825
    <Methode Name="countElement" Const="true">
826
      <Documentation>
827
        <UserDocu>Returns the count of a type of element
828
countElement(type) -> int
829
        </UserDocu>
830
      </Documentation>
831
    </Methode>
832
      <Methode Name="mapSubElement">
833
          <Documentation>
834
              <UserDocu>
835
                  mapSubElement(shape|[shape...], op='') - maps the sub element of other shape
836

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
839
              </UserDocu>
840
          </Documentation>
841
      </Methode>
842
      <Methode Name="mapShapes">
843
          <Documentation>
844
              <UserDocu>
845
                  mapShapes(generated, modified, op='')
846

847
                  generate element names with user defined mapping
848

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
856
              </UserDocu>
857
          </Documentation>
858
      </Methode>
859
      <Methode Name="getElementHistory" Const="true">
860
          <Documentation>
861
              <UserDocu>
862
                  getElementHistory(name) - returns the element mapped name history
863

864
                  name: mapped element name belonging to this shape
865

866
                  Returns tuple(sourceShapeTag, sourceName, [intermediateNames...]),
867
                  or None if no history.
868
              </UserDocu>
869
          </Documentation>
870
      </Methode>
871
    <Methode Name="getTolerance" Const="true">
872
      <Documentation>
873
        <UserDocu>Determines a tolerance from the ones stored in a shape
874
getTolerance(mode, ShapeType=Shape) -> float
875
--
876
mode = 0 : returns the average value between sub-shapes,
877
mode &gt; 0 : returns the maximal found,
878
mode &lt; 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,
882
Edge   : only edges,
883
Face   : only faces,
884
Shell  : combined Shell + Face, for each face (and containing
885
         shell), also checks edge and Vertex
886
        </UserDocu>
887
      </Documentation>
888
    </Methode>
889
    <Methode Name="overTolerance" Const="true">
890
      <Documentation>
891
        <UserDocu>Determines which shapes have a tolerance over the given value
892
overTolerance(value, [ShapeType=Shape]) -> ShapeList
893
--
894
ShapeType is interpreted as in the method getTolerance
895
        </UserDocu>
896
      </Documentation>
897
    </Methode>
898
    <Methode Name="inTolerance" Const="true">
899
      <Documentation>
900
        <UserDocu>Determines which shapes have a tolerance within a given interval
901
inTolerance(value, [ShapeType=Shape]) -> ShapeList
902
--
903
ShapeType is interpreted as in the method getTolerance
904
        </UserDocu>
905
      </Documentation>
906
    </Methode>
907
    <Methode Name="globalTolerance" Const="true">
908
      <Documentation>
909
        <UserDocu>Returns the computed tolerance according to the mode
910
globalTolerance(mode) -> float
911
--
912
mode = 0 : average
913
mode &gt; 0 : maximal
914
mode &lt; 0 : minimal
915
        </UserDocu>
916
      </Documentation>
917
    </Methode>
918
    <Methode Name="fixTolerance" Const="true">
919
      <Documentation>
920
        <UserDocu>Sets (enforces) tolerances in a shape to the given value
921
fixTolerance(value, [ShapeType=Shape])
922
--
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
928
        </UserDocu>
929
      </Documentation>
930
    </Methode>
931
    <Methode Name="limitTolerance" Const="true">
932
      <Documentation>
933
        <UserDocu>Limits tolerances in a shape
934
limitTolerance(tmin, [tmax=0, ShapeType=Shape]) -> bool
935
--
936
tmin = tmax -> as fixTolerance (forces)
937
tmin = 0   -> maximum tolerance will be tmax
938
tmax = 0 or not given (more generally, tmax &lt; 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
947
        </UserDocu>
948
      </Documentation>
949
    </Methode>
950
    <Methode Name="optimalBoundingBox" Const="true">
951
      <Documentation>
952
        <UserDocu>Get the optimal bounding box
953
optimalBoundingBox([useTriangulation = True, useShapeTolerance = False]) -> bound box
954
        </UserDocu>
955
      </Documentation>
956
    </Methode>
957
      <Methode Name="clearCache" Const="true">
958
          <Documentation>
959
              <UserDocu>Clear internal sub-shape cache</UserDocu>
960
          </Documentation>
961
      </Methode>
962
      <Methode Name="findSubShape" Const="true">
963
          <Documentation>
964
              <UserDocu>
965
                  findSubShape(shape) -> (type_name, index)
966

967
                  Find sub shape and return the shape type name and index. If not found,
968
                  then return (None, 0)
969
              </UserDocu>
970
          </Documentation>
971
      </Methode>
972
      <Methode Name="findSubShapesWithSharedVertex" Const="true" Keyword="true">
973
          <Documentation>
974
              <UserDocu>
975
                  findSubShapesWithSharedVertex(shape, needName=False, checkGeometry=True, tol=1e-7, atol=1e-12) -> Shape
976

977
                  shape: input elementary shape, currently only support Face, Edge, or Vertex
978

979
                  needName: if True, return a list of tuple(name, shape), or else return a list
980
                  of shapes.
981

982
                  checkGeometry: whether to compare geometry
983

984
                  tol: distance tolerance
985

986
                  atol: angular tolerance
987

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.
991
              </UserDocu>
992
          </Documentation>
993
      </Methode>
994
      <Methode Name="getChildShapes" Const="true">
995
          <Documentation>
996
              <UserDocu>
997
                  getChildShapes(shapetype, avoidtype='') -> list(Shape)
998

999
                  Return a list of child sub-shapes of given type.
1000

1001
                  shapetype: the type of requesting sub shapes
1002
                  avoidtype: optional shape type to skip when exploring
1003
              </UserDocu>
1004
          </Documentation>
1005
      </Methode>
1006
    <!--
1007
    <Attribute Name="Location" ReadOnly="false">
1008
      <Documentation>
1009
        <UserDocu>Gets or sets the local coordinate system of this shape.</UserDocu>
1010
      </Documentation>
1011
      <Parameter Name="Location" Type="Object"/>
1012
    </Attribute>
1013
-->
1014
    <Attribute Name="ShapeType" ReadOnly="true">
1015
      <Documentation>
1016
        <UserDocu>Returns the type of the shape.</UserDocu>
1017
      </Documentation>
1018
      <Parameter Name="ShapeType" Type="String"/>
1019
    </Attribute>
1020
    <Attribute Name="Orientation" ReadOnly="false">
1021
      <Documentation>
1022
        <UserDocu>Returns the orientation of the shape.</UserDocu>
1023
      </Documentation>
1024
      <Parameter Name="Orientation" Type="String"/>
1025
    </Attribute>
1026
    <Attribute Name="Faces" ReadOnly="true">
1027
      <Documentation>
1028
        <UserDocu>List of faces in this shape.</UserDocu>
1029
      </Documentation>
1030
      <Parameter Name="Faces" Type="List"/>
1031
    </Attribute>
1032
    <Attribute Name="Vertexes" ReadOnly="true">
1033
      <Documentation>
1034
        <UserDocu>List of vertexes in this shape.</UserDocu>
1035
      </Documentation>
1036
      <Parameter Name="Vertexes" Type="List"/>
1037
    </Attribute>
1038
      <Attribute Name="Shells" ReadOnly="true">
1039
          <Documentation>
1040
              <UserDocu>List of subsequent shapes in this shape.</UserDocu>
1041
          </Documentation>
1042
          <Parameter Name="Shells" Type="List"/>
1043
      </Attribute>
1044
      <Attribute Name="Solids" ReadOnly="true">
1045
          <Documentation>
1046
              <UserDocu>List of subsequent shapes in this shape.</UserDocu>
1047
          </Documentation>
1048
          <Parameter Name="Solids" Type="List"/>
1049
      </Attribute>
1050
      <Attribute Name="CompSolids" ReadOnly="true">
1051
      <Documentation>
1052
          <UserDocu>List of subsequent shapes in this shape.</UserDocu>
1053
      </Documentation>
1054
      <Parameter Name="CompSolids" Type="List"/>
1055
    </Attribute>
1056
    <Attribute Name="Edges" ReadOnly="true">
1057
      <Documentation>
1058
       <UserDocu>List of Edges in this shape.</UserDocu>
1059
      </Documentation>
1060
      <Parameter Name="Edges" Type="List"/>
1061
   </Attribute>
1062
    <Attribute Name="Wires" ReadOnly="true">
1063
      <Documentation>
1064
        <UserDocu>List of wires in this shape.</UserDocu>
1065
      </Documentation>
1066
      <Parameter Name="Wires" Type="List"/>
1067
    </Attribute>
1068
    <Attribute Name="Compounds" ReadOnly="true">
1069
      <Documentation>
1070
        <UserDocu>List of compounds in this shape.</UserDocu>
1071
      </Documentation>
1072
      <Parameter Name="Compounds" Type="List"/>
1073
    </Attribute>
1074
    <Attribute Name="SubShapes" ReadOnly="true">
1075
      <Documentation>
1076
        <UserDocu>List of sub-shapes in this shape.</UserDocu>
1077
      </Documentation>
1078
      <Parameter Name="SubShapes" Type="List"/>
1079
    </Attribute>
1080
    <Attribute Name="Length" ReadOnly="true">
1081
      <Documentation>
1082
        <UserDocu>Total length of the edges of the shape.</UserDocu>
1083
      </Documentation>
1084
      <Parameter Name="Length" Type="Float"/>
1085
    </Attribute>
1086
    <Attribute Name="Area" ReadOnly="true">
1087
      <Documentation>
1088
        <UserDocu>Total area of the faces of the shape.</UserDocu>
1089
      </Documentation>
1090
      <Parameter Name="Area" Type="Float"/>
1091
    </Attribute>
1092
    <Attribute Name="Volume" ReadOnly="true">
1093
      <Documentation>
1094
        <UserDocu>Total volume of the solids of the shape.</UserDocu>
1095
      </Documentation>
1096
      <Parameter Name="Volume" Type="Float"/>
1097
    </Attribute>
1098
  </PythonExport>
1099
</GenerateModel>
1100

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

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

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

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