![Gordon Ferguson's picture Gordon Ferguson's picture](/sites/default/files/images/userpic_default.png)
Fri, 05/19/2017 - 21:28
Hello,
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);
etc.
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.
Thanks.
Tue, 05/12/2020 - 22:59
I happened to run into the same issue. Instead of passing a new edgelocation, it works when passing location to PollygonOnTriangulation.