From 4101407b43c92ec533dd063eae8b021ee3c073ad Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Mon, 24 Dec 2018 16:04:51 +0100 Subject: [PATCH] Small changes to convert(face) --- src/ifcgeom/IfcGeomFaces.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ifcgeom/IfcGeomFaces.cpp b/src/ifcgeom/IfcGeomFaces.cpp index 41379ea7b7..7af92d2855 100644 --- a/src/ifcgeom/IfcGeomFaces.cpp +++ b/src/ifcgeom/IfcGeomFaces.cpp @@ -198,6 +198,8 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcFace* l, TopoDS_Shape& face) { for (; exp.More(); exp.Next(), count++) { if (count < 2) { edges[count] = TopoDS::Edge(exp.Current()); + } else { + break; } } @@ -217,8 +219,9 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcFace* l, TopoDS_Shape& face) { } } else { gp_Pln pln; - approximate_plane_through_wire(wire, pln); - face_surface = new Geom_Plane(pln); + if (approximate_plane_through_wire(wire, pln)) { + face_surface = new Geom_Plane(pln); + } } } @@ -238,6 +241,7 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcFace* l, TopoDS_Shape& face) { if (count(wire, TopAbs_EDGE) > 128 && approximate_plane_through_wire(wire, pln)) { // tfk: optimization find the underlying surface ourselves since it's going // to be planar in IFC if no explicit surface is given. Should we always do this? + // @todo is this still relevant considering the code above mf = new BRepBuilderAPI_MakeFace(pln, wire, true); } else { mf = new BRepBuilderAPI_MakeFace(wire);