本文共 376 字,大约阅读时间需要 1 分钟。
下面自己总结的 计算点与TopoDS_Shape中各个点的距离的代码,输入为gn_Pnt类型的点
//DesPnt 为输入
TopExp_Explorer Ex; Standard_Real MinDisance = 1e+10; Standard_Real CurDisance = 0.0; gp_Pnt current,ResPnt; for (Ex.Init(S,TopAbs_VERTEX); Ex.More(); Ex.Next()) { TopoDS_Vertex currentVt = TopoDS::Vertex(Ex.Current()); current = BRep_Tool::Pnt(currentVt); CurDisance = current.Distance(DesPnt); if(CurDistance
转载地址:http://qoeji.baihongyu.com/