triangulation problems with some igs file

Hi all,

I'am a beginner, please help me..
my objectif is to import a .igs file and triangulate it, so i try to use three functions:

1- ImportIges(string filename);

2- FacesFromCompounds (const TopoDS_Shape &Shape, std::vector &topoFaceVector);

3- Triangulation_Occ();// in the function,i do three for loop:

FacesFromCompounds(aisShape->Shape(),face_vector);

for(fit=face_vector.begin();fit!=face_vector.end();fit++)
{
if((!fit->IsNull())&&(fit->ShapeType()==TopAbs_FACE))
{

BRepMesh::Mesh(*fit,0.01);

//...............//

for (TopExp_Explorer ex(*fit,TopAbs_FACE); ex.More(); ex.Next())
{ TopoDS_Face myFace = TopoDS::Face(ex.Current());
//.......//
if (!myFace.IsNull()) {
Handle(Poly_Triangulation) myT = BRep_Tool::Triangulation(myFace, L);
//........//

const TColgp_Array1OfPnt& Nodes = myT->Nodes();
const TColgp_Array1OfPnt2d& UVNodes = myT->UVNodes();
const Poly_Array1OfTriangle& triangles = myT->Triangles();
//......//
if (myT->HasUVNodes())
{
//......//
for (int i = 1; i {

Poly_Triangle mytriangle = triangles.Value(i);
//....//
triangle_vector.push_back(Tri);
//......//
}
}

}
} }

}

I'm facing a problem triangulating faces with some IGS file( wich have a lot of faces ).Does anybody have any suggestions or solutions?

Thank you very much in advance.

Kirill Gavrilov's picture

>> I'm facing a problem triangulating faces with some IGS file( wich have a lot of faces ).
>> Does anybody have any suggestions or solutions?
You have not described which problem you've faced.
If some faces do not contain triangulation - it might be bug of BRepMesh algorithm. The algorithm might fail due to invalid geometry/topology of specific faces or by another reason.

Please provide the sample files if you want this problem to be analyzed.
The proper way to report the bug is to register it in bugtracker: http://tracker.dev.opencascade.org

Jihed's picture

@kgv
thanks for your help,
I find the problem , it is in the "triangle_vector":