Opencascade算法1

  • 求点与直线的垂足点  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();

 

  • 求2d曲线的交点 Geom2dAPI_InterCurveCurve
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);

你可能感兴趣的:(opencascade,开发语言,算法,c++)