#include <GeomAPI_ProjectPointOnSurf.hxx>
//计算点到平面的投影
static gp_Pnt calculateOrthoProject(const TopoDS_Face& face, const gp_Pnt& p)
{
gp_Pnt resultPt;
// TopoDS_Face face = BRepBuilderAPI_MakeFace(plane);
const Handle(Geom_Surface)& RefSurf = BRep_Tool::Surface(face);
Extrema_ExtAlgo Algo = Extrema_ExtAlgo_Tree;
GeomAPI_ProjectPointOnSurf generator(p, RefSurf, Algo );
if (generator.NbPoints() > 0)
{
resultPt = generator.NearestPoint();
}
return resultPt;
}
opencascade:计算三维点在三维平面上的投影点
于 2022-03-01 15:44:19 首次发布