From 60cf4ab75799d1b6a1d6d34088f7fe085d00b51a Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Tue, 3 May 2016 11:22:15 +0200 Subject: [PATCH] Additional check pertaining to face surfaces --- src/ifcgeom/IfcGeomFaces.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ifcgeom/IfcGeomFaces.cpp b/src/ifcgeom/IfcGeomFaces.cpp index 9b7b99c2fd..43145528e1 100644 --- a/src/ifcgeom/IfcGeomFaces.cpp +++ b/src/ifcgeom/IfcGeomFaces.cpp @@ -224,7 +224,13 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcFace* l, TopoDS_Shape& face) { if (mf->IsDone()) { TopoDS_Face outer_face_bound = mf->Face(); - if (BRepCheck_Face(outer_face_bound).OrientationOfWires() == BRepCheck_BadOrientationOfSubshape) { + // BRepCheck_Face might raise exceptions in case of face surfaces. Therefore fix orientation regardless. + if (!face_surface.IsNull()) { + ShapeFix_Face fix(outer_face_bound); + fix.FixOrientation(); + fix.Perform(); + outer_face_bound = fix.Face(); + } else if (BRepCheck_Face(outer_face_bound).OrientationOfWires() == BRepCheck_BadOrientationOfSubshape) { wire.Reverse(); same_sense = !same_sense; delete mf;