Get an edge by one of its vertices

Hi everybody,
Could anybody tell me is there a way to get an edge, when I have only one of its vertices.
Thanks in advance

Rob Bachrach's picture

As far as I know, you have 2 choices:
1 - Use TopExp_Explorer to iterate through the edges and then a nested TopExp_Explorer to iterate through the vertexes of each edge. Stop when you find your vertex (there may be more than 1 edge with the vertex in question).

2 - Use TopExp::MapShapesAndAncestors to generate a map of vertexes to lists of edges. Then, look your vertex up in the map to get a list of edges connected to it.

TopExp::MapShapesAndAncestors(myShape, TopAbs_VERTEX, TopAbs_EDGE, myMap);