OCCT随笔
几何(Geom)
点(Vertex)-> 线(Edge)-> 环(Wire)-> 面(Face)
拓扑(Topo)
转换
opencascade对topo线进行遍历,获取所有的线转换为几何类型,并且存储为裁剪几何曲线
QVector<Handle_Geom_TrimmedCurve> explore_curve(TopoDS_Shape &contact_curve) { //将topo线转换为Geom线 QVector<Handle_Geom_TrimmedCurve> store_trimmed_curve; TopExp_Explorer ex_contact_curve;//存储遍历出的所有交线 for (ex_contact_curve.Init(contact_curve, TopAbs_EDGE); ex_contact_curve.More(); ex_contact_curve.Next()) { TopoDS_Edge topo_contact_part_Edge = TopoDS::Edge(ex_contact_curve.Current()); //拓扑转换为几何曲线 Standard_Real first, last; Handle(Geom_Curve)geom_contact_part_curve = BRep_Tool::Curve(topo_contact_part_Edge, first, last); //几何曲线转换为裁剪曲线,然后参与计算,不然会出错 Handle(Geom_TrimmedCurve)geom_contact_trimmed_curve = new Geom_TrimmedCurve(geom_contact_part_curve, first, last); store_trimmed_curve.push_back(geom_contact_trimmed_curve); } return store_trimmed_curve; }