[TD]fix fail on unmeshed shape

This commit is contained in:
wandererfan
2023-11-11 10:57:10 -03:00
committed by Adrián Insaurralde Avalos
parent 1642ebbe58
commit 9aebd3fe5a
+5 -7
View File
@@ -306,6 +306,7 @@ TopoDS_Shape GeometryObject::invertGeometry(const TopoDS_Shape s)
//!set up a hidden line remover and project a shape with it
void GeometryObject::projectShapeWithPolygonAlgo(const TopoDS_Shape& input, const gp_Ax2& viewAxis)
{
// Base::Console().Message("GO::projectShapeWithPolygonAlgo()\n");
// Clear previous Geometry
clear();
@@ -326,13 +327,10 @@ void GeometryObject::projectShapeWithPolygonAlgo(const TopoDS_Shape& input, cons
Handle(HLRBRep_PolyAlgo) brep_hlrPoly;
try {
TopExp_Explorer faces(inCopy, TopAbs_FACE);
for (int i = 1; faces.More(); faces.Next(), i++) {
const TopoDS_Face& f = TopoDS::Face(faces.Current());
if (!f.IsNull()) {
BRepMesh_IncrementalMesh(f, 0.10);//Poly Algo requires a mesh!
}
}
// HLRBRep_PolyAlgo will fail if the whole input shape has not been meshed.
// meshing the faces is not sufficient.
BRepMesh_IncrementalMesh(inCopy, 0.10);
brep_hlrPoly = new HLRBRep_PolyAlgo();
brep_hlrPoly->Load(inCopy);