Segmentation (like triangulation)

Is there a similar way to get the segmentation of an edge, like for the faces (BRepTools::Triangulation)? I've check the source of BRep_TEdge but it contains a list of CurveRepresentation. Is one of the representation a segmented one? Or there is no such tools?


Rob Bachrach's picture

Try BRep_Tool::PolygonOnTriangulation

Ernest's picture

It seem as if the shape had to be triangulated. But i need no tirangulation, only the segmentation (triangulation is really slow, so sometimes wireframe is used instead).

I'v tried Brep_Tool::Polygon3D but it returns null all the time:

BRepPrimAPI_MakeSphere S(gp_Pnt(0,300,0), 100.);
TopoDS_Shape s = S.Shape();

TopExp_Explorer ex;
for( ex.Init(s, TopAbs_EDGE); ex.More(); ex.Next() )
const Handle_Poly_Polygon3D& seg = BRep_Tool::
Polygon3D(TopoDS_Edge(ex.Current()), l);

if(seg.IsNull()) {

Is there a similar function like BRepMesh::Mesh(...) for the edges???

Rob Bachrach's picture

Polygon3D works off the mesh created by BRepMesh. You might want to look at GCPnts_UniformDeflection. GCPnts_QuasiUniformDeflection, and GCPnts_UniformAbscissa. You can use BRep_Tool::Curve to get the curve and parameters on the edge for these functions.

Ernest's picture

Thanks. It solved my problem.