OCC.TopExp module¶
This package provides basic tools to explore thetopological data structures.* Explorer : A tool to find all sub-shapes of a giventype. e.g. all faces of a solid.* Package methods to map sub-shapes of a shape.Level : PublicAll methods of all classes will be public.
-
class
SwigPyIterator
(*args, **kwargs)¶ Bases:
object
-
advance
()¶
-
copy
()¶
-
decr
()¶
-
distance
()¶
-
equal
()¶
-
incr
()¶
-
next
()¶
-
previous
()¶
-
thisown
¶ The membership flag
-
value
()¶
-
-
class
TopExp_Explorer
(*args)¶ Bases:
object
- Creates an empty explorer, becomes usefull after Init.
Return type: None - Creates an Explorer on the Shape <S>. //! <ToFind> is the type of shapes to search. TopAbs_VERTEX, TopAbs_EDGE, … //! <ToAvoid> is the type of shape to skip in the exploration. If <ToAvoid> is equal or less complex than <ToFind> or if <ToAVoid> is SHAPE it has no effect on the exploration.
Parameters: - S (TopoDS_Shape &) –
- ToFind (TopAbs_ShapeEnum) –
- ToAvoid (TopAbs_ShapeEnum) – default value is TopAbs_SHAPE
Return type: -
Current
()¶ - Returns the current shape in the exploration. Exceptions Standard_NoSuchObject if this explorer has no more shapes to explore.
Return type: TopoDS_Shape
-
Depth
()¶ - Returns the current depth of the exploration. 0 is the shape to explore itself.
Return type: int
-
Init
()¶ - Resets this explorer on the shape S. It is initialized to search the shape S, for shapes of type ToFind, that are not part of a shape ToAvoid. If the shape ToAvoid is equal to TopAbs_SHAPE, or if it is the same as, or less complex than, the shape ToFind it has no effect on the search.
Parameters: - S (TopoDS_Shape &) –
- ToFind (TopAbs_ShapeEnum) –
- ToAvoid (TopAbs_ShapeEnum) – default value is TopAbs_SHAPE
Return type:
-
Next
()¶ - Moves to the next Shape in the exploration. Exceptions Standard_NoMoreObject if there are no more shapes to explore.
Return type: None
-
thisown
¶ The membership flag
-
new_instancemethod
(func, inst, cls)¶
-
register_handle
(handle, base_object)¶ Inserts the handle into the base object to prevent memory corruption in certain cases
-
class
topexp
¶ Bases:
object
-
static
CommonVertex
()¶ - Finds the vertex <V> common to the two edges <E1,E2>, returns True if this vertex exists. //! Warning: <V> has sense only if the value <True> is returned
Parameters: - E1 (TopoDS_Edge &) –
- E2 (TopoDS_Edge &) –
- V (TopoDS_Vertex &) –
Return type:
-
static
FirstVertex
()¶ - Returns the Vertex of orientation FORWARD in E. If there is none returns a Null Shape. CumOri = True : taking account the edge orientation
Parameters: - E (TopoDS_Edge &) –
- CumOri (bool) – default value is Standard_False
Return type:
-
static
LastVertex
()¶ - Returns the Vertex of orientation REVERSED in E. If there is none returns a Null Shape. CumOri = True : taking account the edge orientation
Parameters: - E (TopoDS_Edge &) –
- CumOri (bool) – default value is Standard_False
Return type:
-
static
MapShapes
()¶ - Tool to explore a topological data structure. Stores in the map <M> all the sub-shapes of <S> of type <T>. //! Warning: The map is not cleared at first.
Parameters: - S (TopoDS_Shape &) –
- T (TopAbs_ShapeEnum) –
- M (TopTools_IndexedMapOfShape &) –
Return type: void
- Stores in the map <M> all the sub-shapes of <S>.
Parameters: - S (TopoDS_Shape &) –
- M (TopTools_IndexedMapOfShape &) –
Return type: void
-
static
MapShapesAndAncestors
()¶ - Stores in the map <M> all the subshape of <S> of type <TS> for each one append to the list all the ancestors of type <TA>. For example map all the edges and bind the list of faces. Warning: The map is not cleared at first.
Parameters: - S (TopoDS_Shape &) –
- TS (TopAbs_ShapeEnum) –
- TA (TopAbs_ShapeEnum) –
- M (TopTools_IndexedDataMapOfShapeListOfShape &) –
Return type: void
-
static
Vertices
()¶ - Returns in Vfirst, Vlast the FORWARD and REVERSED vertices of the edge <E>. May be null shapes. CumOri = True : taking account the edge orientation
Parameters: - E (TopoDS_Edge &) –
- Vfirst (TopoDS_Vertex &) –
- Vlast (TopoDS_Vertex &) –
- CumOri (bool) – default value is Standard_False
Return type: void
- Returns in Vfirst, Vlast the first and last vertices of the open wire <W>. May be null shapes. if <W> is closed Vfirst and Vlast are a same vertex on <W>. if <W> is no manifold. VFirst and VLast are null shapes.
Parameters: - W (TopoDS_Wire &) –
- Vfirst (TopoDS_Vertex &) –
- Vlast (TopoDS_Vertex &) –
Return type: void
-
thisown
¶ The membership flag
-
static
-
topexp_CommonVertex
()¶ - Finds the vertex <V> common to the two edges <E1,E2>, returns True if this vertex exists. //! Warning: <V> has sense only if the value <True> is returned
Parameters: - E1 (TopoDS_Edge &) –
- E2 (TopoDS_Edge &) –
- V (TopoDS_Vertex &) –
Return type:
-
topexp_FirstVertex
()¶ - Returns the Vertex of orientation FORWARD in E. If there is none returns a Null Shape. CumOri = True : taking account the edge orientation
Parameters: - E (TopoDS_Edge &) –
- CumOri (bool) – default value is Standard_False
Return type:
-
topexp_LastVertex
()¶ - Returns the Vertex of orientation REVERSED in E. If there is none returns a Null Shape. CumOri = True : taking account the edge orientation
Parameters: - E (TopoDS_Edge &) –
- CumOri (bool) – default value is Standard_False
Return type:
-
topexp_MapShapes
()¶ - Tool to explore a topological data structure. Stores in the map <M> all the sub-shapes of <S> of type <T>. //! Warning: The map is not cleared at first.
Parameters: - S (TopoDS_Shape &) –
- T (TopAbs_ShapeEnum) –
- M (TopTools_IndexedMapOfShape &) –
Return type: void
- Stores in the map <M> all the sub-shapes of <S>.
Parameters: - S (TopoDS_Shape &) –
- M (TopTools_IndexedMapOfShape &) –
Return type: void
-
topexp_MapShapesAndAncestors
()¶ - Stores in the map <M> all the subshape of <S> of type <TS> for each one append to the list all the ancestors of type <TA>. For example map all the edges and bind the list of faces. Warning: The map is not cleared at first.
Parameters: - S (TopoDS_Shape &) –
- TS (TopAbs_ShapeEnum) –
- TA (TopAbs_ShapeEnum) –
- M (TopTools_IndexedDataMapOfShapeListOfShape &) –
Return type: void
-
topexp_Vertices
()¶ - Returns in Vfirst, Vlast the FORWARD and REVERSED vertices of the edge <E>. May be null shapes. CumOri = True : taking account the edge orientation
Parameters: - E (TopoDS_Edge &) –
- Vfirst (TopoDS_Vertex &) –
- Vlast (TopoDS_Vertex &) –
- CumOri (bool) – default value is Standard_False
Return type: void
- Returns in Vfirst, Vlast the first and last vertices of the open wire <W>. May be null shapes. if <W> is closed Vfirst and Vlast are a same vertex on <W>. if <W> is no manifold. VFirst and VLast are null shapes.
Parameters: - W (TopoDS_Wire &) –
- Vfirst (TopoDS_Vertex &) –
- Vlast (TopoDS_Vertex &) –
Return type: void