Get Poly_Polygon3D (edges) from BRepMesh_IncrementalMesh

Hello,

I have a BRepMesh_IncrementalMesh used for the display (make with vtk).
From this BRepMesh_IncrementalMesh I can extract the faces mesh:

TopExp_Explorer faceExplorer(shape,TopAbs_FACE);
while (faceExplorer.More())
{
Handle_Poly_Triangulation faceMesh = BRep_Tool::Triangulation
(
TopoDS::Face(faceExplorer.Current()),
aLoc
);
// Store the face mesh in VTK
}

When I try to do the same for the edge of my shape the Poly_Polygon3D is always Null:

TopExp_Explorer edgeExplorer(faceExplorer.Current(),TopAbs_EDGE);
while (edgeExplorer.More())
{ //
const TopoDS_Edge &edgeDS = TopoDS::Edge(edgeExplorer.Current());
Handle_Poly_Polygon3D edgeMesh = BRep_Tool::Polygon3D
(
TopoDS::Edge(edgeExplorer.Current()),
aLoc
);
// edgeMesh is always Null
}

How could I do that ?

Thanks in advance for the help

Nathanaël.

Nathanael's picture

I find my error, I need to use Poly_PolygonOnTriangulation:

TopExp_Explorer edgeExplorer(faceExplorer.Current(),TopAbs_EDGE);
while (edgeExplorer.More())
{ //
const TopoDS_Edge& edge(TopoDS::Edge(edgeExplorer.Current()));
Handle_Poly_PolygonOnTriangulation edgeMesh;
edgeMesh = BRep_Tool::PolygonOnTriangulation
(
edge,
mesh,
aLoc
);
}

Thanks for the help.

Nathanaël