From f68060f566dbb05dd840c3367663b3d726128528 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Thu, 24 Jul 2014 11:14:54 +0000 Subject: [PATCH] Fixes for IfcRectangleHollowProfileDef and filleted profile generation. --- src/ifcgeom/IfcGeomFunctions.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/ifcgeom/IfcGeomFunctions.cpp b/src/ifcgeom/IfcGeomFunctions.cpp index a051ec552f..81173a3c07 100644 --- a/src/ifcgeom/IfcGeomFunctions.cpp +++ b/src/ifcgeom/IfcGeomFunctions.cpp @@ -24,6 +24,7 @@ ********************************************************************************/ #include +#include #include #include @@ -336,15 +337,19 @@ bool IfcGeom::profile_helper(int numVerts, double* verts, int numFillets, int* f IfcGeom::convert_wire_to_face(w.Wire(),face); - if ( numFillets ) { + if ( numFillets && *std::max_element(filletRadii, filletRadii + numFillets) > 1e-7 ) { BRepFilletAPI_MakeFillet2d fillet (face); for ( int i = 0; i < numFillets; i ++ ) { const double radius = filletRadii[i]; - if ( radius < 1e-7 ) continue; + if ( radius <= 1e-7 ) continue; fillet.AddFillet(vertices[filletIndices[i]],radius); } fillet.Build(); - face = TopoDS::Face(fillet.Shape()); + if (fillet.IsDone()) { + face = TopoDS::Face(fillet.Shape()); + } else { + Logger::Message(Logger::LOG_WARNING, "Failed to process profile fillets"); + } } delete[] vertices;