Why no polygon tesselation on edge?


I create a triangulation of the sample file CrankArm.brep. Then I traverse the faces and edges as follows:

   TopTools_IndexedMapOfShape faceMap;
   TopExp::MapShapes(myShape, TopAbs_FACE, faceMap);

   for(int j = 1; j <= faceMap.Extent(); ++j) {
      const TopoDS_Face& face = TopoDS::Face(faceMap(j));

      TopLoc_Location location;
      Handle_Poly_Triangulation triangulation = BRep_Tool::Triangulation (face, location);

      TopExp_Explorer ExpW;
      for (ExpW.Init (face,TopAbs_EDGE); ExpW.More(); ExpW.Next()) {

         TopoDS_Shape shapw = ExpW.Current();
         TopoDS_Edge  edge = TopoDS::Edge(shapw);

         TopLoc_Location edgelocation;
         Handle(Poly_PolygonOnTriangulation) edgeMesh;
            edgeMesh = BRep_Tool::PolygonOnTriangulation(edge,triangulation,edgelocation);


For other brep files I have tesselated this works just fine. However, on this model, edgeMesh is NULL for all edges. Is there a reason for this? All other models I've tried I do get a proper edgeMesh and I can project the nodes back on the mesh to get geometric data such as edge tangents. But not on this one.


Syun&#039;ichi Shiraiwa's picture

I happened to run into the same issue. Instead of passing a new edgelocation, it works when passing location to PollygonOnTriangulation.