Topological explorers

There are at least 3 different topological explorer classes: TopExp_Explorer,
BRepTools_WireExplorer, and TopoDS_Iterator. Is there documentation that
describes when it's appropriate to use each one? Can they be used
interchangably? If I use BRepTools_WireExplorer to iterate
over the edges in a wire loop, are the edges returned in the proper order
and with the correct orientation?

Blair Downie

Rob Bachrach's picture

The differences are not documented in any one place. However, you
can get the gist of it by reading the documentation on the individual

- TopExp_Explorer explores all the subshapes of a shape, but allows
you to filter on finding or avoiding particular types (see the
examples in the documentation). This is great if you are looking for
a particular type. This actually uses a TopoDS_Iterator internally.
If you are looking for a particular type of shape, this is the way to
- TopoDS_Iterator more generally visits all subshapes of a shape. You
can optionally get those shapes with the location and orientation
fully applied. This is useful if you wish to visit all shapes of a
shape and is especially efficient if you don't care about the location
or orientation.
- BRepTools_WireExplorer returns the edges in a wire in the proper
order for traversal. Please note there are limitations when
the wire is not a closed loop and when there are singularities (see
the documentation for details).

blair_downie's picture


Thanks for your reply.

So does this mean that I must use BRepTools_WireExplorer if I need to
traverse the edges in a wire in the proper order?

Rob Bachrach's picture

Unless you re-write the code yourself using other explorers and
looking at common vertices, yes. Please note the limitations
however. Unless your wire is a closed loop (such as around a face),
WireExplorer does not bolster confidence. If it is a closed loop,
it works pretty well.