-1

I want to find out the coordinates of the two vertices of a TopoDS_Edge. I couldn't find any solution on the Public Member Functions list on https://dev.opencascade.org/doc/refman/html/class_topo_d_s___edge.html

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
Dnk8000
  • 3
  • 3

1 Answers1

0

With this you can get the vertices of any topological object in OpenCascade:

TopoDS_Edge edge;
for (TopExp_Explorer ex(edge, TopAbs_VERTEX); ex.More(); ex.Next())
{
    gp_Pnt point = BRep_Tool::Pnt(TopoDS::Vertex(ex.Current()));
    double xCoord = point.X(); 
}

This is also capable of iterating over other types of topological entities like edges in a body when you replace TopAbs_VERTEX with TopAbs_EDGE.

jaba
  • 735
  • 7
  • 18