Geom2dAPI_ProjectPointOnCurve
求点与直线的垂足点。
gp_Lin2d gpLine(pnt2dStart,dir2d);
Handle(Geom2d_Line) geom2dLine = new Geom2d_Line(gpLine);
Geom2dAPI_ProjectPointOnCurve projectTooler(pnt2d,geom2dLine);
gp_Pnt2d interfPoint = projectTooler.Point(1);
gp_Vec2d vec(interPoint,pnt2d);
为了求直线的法向 也可以
gp_Dir2d xdir = gpLine.Normal(pnt2d).Direction();
Geom2dAPI_InterCurveCurve
求2d曲线的交点
Handle(Geom2d_Line) geomLine1 = new Geom2d_Line(gpLine1);
Handle(Geom2d_Line) geomLine2 = new Geom2d_Line(gpLine2);
Geom2dAPI_InterCurveCurve interCurveTooler(geomLine1 ,geomLine2 );
gp_Pnt2d interPnt =interCurveTooler.Point(1);
网友评论