/*!
\page create_explode_page Explode
To \b Explode an object into sub-shapes, in the Main Menu
select New Entity > Explode. This operation opens the
Sub Shapes Selection dialog box.
\image html neo-obj1.png
To create a list of sub-shapes (vertices, edges, wires etc.) of the
given shape using the \b Explode operation, you need to define the Main
Object, which will be exploded and the Type of Sub-shapes you wish to
obtain from it.
The \b Result of the operation will be a List of \b GEOM_Objects
(vertexes, edges, wires, faces, shells or solids).
Available choices in the Sub Shapes Type combo box depend on the type
of selected Main Object:
- \b Compound: to extract compounds;
- \b Compsolid: to extract compsolids;
- \b Solid: to extract solids;
- \b Shell: to extract shells;
- \b Face: to extract faces;
- \b Wire: to extract wires;
- \b Edge: to extract edges;
- \b Vertex: to extract vertices;
- \b Shape: to extract top-level contents of the compound shape;
- \b Flat: to extract "flat" contents of the compound shape.
Note: "flat" contents means top-level simple-type sub-shapes extracted from
the compound object recursively (i.e. there is no compounds in the result).
For example, if a compound C1 contains a solid S1 and another compound C2 that
contains solids S2 and S3 (see picture below):
- Explode operation with \b Shape type given as parameter will return S1 and C2;
- Explode operation with \b Flat type given as parameter will return S1, S2 and S3.
\image html flat_contents.png
Switching on Select Sub-shapes check box allows manual selection of sub-shapes
to be extracted from the main object. In this mode the user can select sub-shapes
directly in 3D viewer.
Using TUI Commands you can perform this operation in a
variety of ways:
- geompy.ExtractShapes(Shape, Type, isSorted) explodes a
Shape into sub-shapes of a given Type and returns a List of sub-shapes.
This method does not return the Shape itself if it matches the
Type.
- geompy.SubShapeAll(Shape, Type) explodes a Shape on
sub-shapes of a given Type and returns a List of sub-shapes.
- geompy.SubShapeAllIDs(Shape, Type) explodes a Shape on
sub-shapes of a given Type and returns a List of IDs of
sub-shapes.
- geompy.SubShapeAllSortedCentres(Shape, Type) explodes a
shape on sub-shapes of a given type and sorts them taking into account
their gravity centers, to provide stable order of sub-shapes.
It returns a list of sub-shapes.
- geompy.SubShapeAllSortedCentresIDs(Shape, Type) explodes
a shape on sub-shapes of a given type and sorts them taking into
account their gravity centers, to provide stable order of sub-shapes.
It returns a List of IDs of sub-shapes.
- geompy.SubShape(Shape, Type, ListOfInd) allows to obtain
a compound of sub-shapes of the Shape, selected by they indices in a
list of all sub-shapes of the given Type. Each index is in the range
[1, Nb_Sub-Shapes_Of_Given_Type].
- geompy.SubShapeSortedCentres(Shape, Type, ListOfInd)
allows to obtain a compound of sub-shapes of the Shape, selected by
they indices in sorted list of all sub-shapes of the given Type. Each
index is in the range [1, Nb_Sub-Shapes_Of_Given_Type]
Arguments: 1 SHAPE + 1 type of SubShape.
Example:
\image html explode.png "A box, exploded into faces"
*/