From ab9c46b3e35d7a844dc2e06221fb8b53dcf32127 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Tue, 30 Oct 2018 09:05:18 +0100 Subject: [PATCH] #487 perform fix after sewing if not valid --- src/ifcgeom/IfcGeomFunctions.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/ifcgeom/IfcGeomFunctions.cpp b/src/ifcgeom/IfcGeomFunctions.cpp index 8148f78680..f77d8e0e19 100644 --- a/src/ifcgeom/IfcGeomFunctions.cpp +++ b/src/ifcgeom/IfcGeomFunctions.cpp @@ -324,7 +324,18 @@ bool IfcGeom::Kernel::create_solid_from_faces(const TopTools_ListOfShape& face_l try { builder.Perform(); shape = builder.SewedShape(); - valid_shell = BRepCheck_Analyzer(shape).IsValid() != 0 && count(shape, TopAbs_SHELL) > 0; + + { + BRepCheck_Analyzer ana(shape); + if (!ana.IsValid()) { + ShapeFix_Shape sfs(shape); + sfs.Perform(); + shape = sfs.Shape(); + } + } + + BRepCheck_Analyzer ana(shape); + valid_shell = ana.IsValid() != 0 && count(shape, TopAbs_SHELL) > 0; } catch (const Standard_Failure& e) { if (e.GetMessageString() && strlen(e.GetMessageString())) { Logger::Error(e.GetMessageString());