Vertices of TopoDS_Shape


I guess my question is simple, but I could not find a way to do this. I want to find the coordinates of the vertices of TopoDS_Shape. Can anyone help me to do so.

Thanks a lot!!

Rob Bachrach's picture

TopExp_Explorer ex;
for (ex.Init(shape, TopAbs_VERTEX); ex.More(); ex.Next()) {
TopoDS_Vertex vertex = TopoDS::Vertex(ex.Current());
gp_Pnt pt = BRep_Tool::Pnt(vertex);