I'm seeking the points of a shape that is very close to a surface from which I want to build another form. For this reason I made this piece of code.
for (TopExp_Explorer ex1(aShape->Shape(),TopAbs_VERTEX) ; ex1.More(); ex1.Next())
TopoDS_Vertex V =TopoDS::Vertex(ex1.Current());
P = BRep_Tool::Pnt(V);
GeomAPI_ProjectPointOnSurf Proj (P, surface);
D = Proj.LowerDistance();
My problem is that the method GeomAPI_ProjectPointOnSurf is very slow. In Fact, it takes a long time for it to be calculated.
GeomAPI_ProjectPointOnSurf requires 62 milliseconds to be calculated for 100 Vertex.
there is another method to calculate the lower distance with the minimum time