TopoDS_Face Triangulation Problem


here is my code;

Standard_Real UMin,UMax,VMin,VMax;
gp_Pnt aPnt1(0, 0, 0);
gp_Pnt aPnt2(1, 0, 0);
gp_Pnt aPnt3(0, 1, 0);
gp_Pnt aPnt4(1, 1, 1);
Handle(Geom_TrimmedCurve) aSegment1= GC_MakeSegment(aPnt1 , aPnt2);
Handle(Geom_TrimmedCurve) aSegment2= GC_MakeSegment(aPnt3 , aPnt4);
TopoDS_Edge anEdge1 = BRepBuilderAPI_MakeEdge(aSegment1);
TopoDS_Edge anEdge2 = BRepBuilderAPI_MakeEdge(aSegment2);
const TopoDS_Face aFace = BRepFill::Face (anEdge1, anEdge2);
TopLoc_Location loc_;
Handle(Poly_Triangulation) facing_ = BRep_Tool::Triangulation(aFace,loc_);

there is a very very very simple face, and i want to triangulate it

but facing_ variable returns null.

i detect the face's points with uv bounds, there is a real face, face is ok i think.
where am i wrong?

Göran Barz's picture

Hi merve,

if I remember correctly, you have to create the triangulation
with BRepMesh::Mesh

double dAccuracy = 0.7;
BRepMesh::Mesh(aFace, dAccuracy);



merve's picture

thanks Göran Barz,
i understood that i have tried to access triangulation without meshing process.
now i have it working,

double dAccuracy=0.7;

TopLoc_Location L;
Handle(Poly_Triangulation) facing_ = BRep_Tool::Triangulation(aFace,L);