From ef0f00792a22c43ca643778318019abecffedbcb Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Sun, 25 Oct 2020 11:57:59 +0100 Subject: [PATCH] #1034 Compound fallback for boolean union --- src/ifcgeom/IfcGeomShapes.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/ifcgeom/IfcGeomShapes.cpp b/src/ifcgeom/IfcGeomShapes.cpp index fc9cbc70f4..ef3146df5f 100644 --- a/src/ifcgeom/IfcGeomShapes.cpp +++ b/src/ifcgeom/IfcGeomShapes.cpp @@ -696,6 +696,18 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcBooleanResult* l, TopoDS_Shape } // NB: After issuing error the first operand is returned! return true; + } else if (op == IfcSchema::IfcBooleanOperator::IfcBooleanOperator_UNION && !valid_result) { + BRep_Builder B; + TopoDS_Compound C; + B.MakeCompound(C); + B.Add(C, s1); + TopTools_ListIteratorOfListOfShape it(second_operand_shapes); + for (; it.More(); it.Next()) { + B.Add(C, it.Value()); + } + Logger::Message(Logger::LOG_ERROR, "Failed to process union, creating compound:", l); + shape = C; + return true; } else { return valid_result; }