The sample code below crashes on the given line when NbNodes() of Poly_Triangulation is called. No matter which of the 3 given Boolean operations you use, it crashes in all cases.
I can provide more examples if needed.
Please give me feedback on the problem and possible solutions.
Thank you very much in advance,
TopoDS_Shape Shape1, Shape2;
gp_Pnt middlePoint = gp_Pnt(0.335179, -0.219682, 0.071117);
Shape1 = BRepPrimAPI_MakeSphere(middlePoint, 0.100187);
gp_Pnt middlePoint = gp_Pnt(0.26183, -0.264555, -0.0453328);
gp_Dir direction = gp_Dir(0.157224, 0.143615, 0.256371);
gp_Ax2 Ax2 = gp_Ax2(middlePoint, direction);
Shape2 = BRepPrimAPI_MakeCone(Ax2, 0.0711757, 0, 0.333273);
// No matter which operation you use, it crashes for all three!
//TopoDS_Shape Shape = BRepAlgoAPI_Cut(Shape1, Shape2);
TopoDS_Shape Shape = BRepAlgoAPI_Fuse(Shape1, Shape2);
//TopoDS_Shape Shape = BRepAlgoAPI_Common(Shape1, Shape2);
for(TopExp_Explorer ex(Shape,TopAbs_FACE); ex.More(); ex.Next())
TopoDS_Face F = TopoDS::Face(ex.Current());
Handle (Poly_Triangulation) facing = BRep_Tool::Triangulation(F,L);
// Crash happens in next line !
int NumNodes = facing->NbNodes(); // --> CRASHES HERE
const TColgp_Array1OfPnt& NodesArray = facing->Nodes();
int NumTri = facing->NbTriangles();
const Poly_Array1OfTriangle& TriArray = facing->Triangles();
This was submitted as a bug report too.