Faces along an edge

How can I get the two faces along an edge? It is a surprise that there is no such function in OCC to query the faces along an edge. Does anybody have a solution to this problem? Thanks in advance...

Rob Bachrach's picture

To my knowledge, there is no single function. You can search through all the faces until you find your edge and build a list or call the following code to build a list of all edges and their faces:

TopTools_IndexedDataMapOfShapeListOfShape myEdgeFaceMap;
TopExp::MapShapesAndAncestors(myShape, TopAbs_EDGE, TopAbs_FACE, myEdgeFaceMap);