OCC几何求交(转)
OCC求交工具:
(1)二维曲线求交:Geom2dAPI_InterCurveCurve
(2)三维曲线与曲面求交:GeomAPI_IntCS
(3)三维曲面与曲面求交:GeomAPI_IntSS
(4)三维曲线求交:(这里有点不太懂)通过GeomAPI_ExtremaCurveCurve用于两条曲线求机制,可用于三维曲线的求交
接口使用:
1 //求交 2 //以二维曲线求交为例 3 Handle(Geom2d_Line) l1 = new Geom2d_Line(gp_Pnt2d(0, 0), gp_Dir2d(1, 0)); 4 Handle(Geom2d_Circle) l2 = new Geom2d_Circle(gp_Ax2d(gp_Pnt2d(0, 0), gp_Dir2d(0, 1)),5.0); 5 Geom2dAPI_InterCurveCurve intersector(l1, l2, Precision::Confusion()); 6 for (int i = 1; i <= intersector.NbPoints(); i++) { 7 gp_Pnt2d interPoint = intersector.Point(i); 8 cout << "交点" << i << "为:(" << interPoint.X() << "," << interPoint.Y() << ")" << endl; 9 }
————————————————
版权声明:本文为CSDN博主「我只知道我要大开杀戒」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_37394426/article/details/122351351