diff --git a/src/ifcgeom/kernels/cgal/CgalKernel.cpp b/src/ifcgeom/kernels/cgal/CgalKernel.cpp index f2d8a6c6b7..45b8d806a8 100644 --- a/src/ifcgeom/kernels/cgal/CgalKernel.cpp +++ b/src/ifcgeom/kernels/cgal/CgalKernel.cpp @@ -2115,6 +2115,8 @@ bool CgalKernel::convert_impl(const taxonomy::boolean_result::ptr br, Conversion */ first = true; + // Whether the base operand ever contributed a Nef polyhedron to `a`. + bool base_operand_succeeded = false; std::list ops; std::list> nefops; @@ -2137,6 +2139,7 @@ bool CgalKernel::convert_impl(const taxonomy::boolean_result::ptr br, Conversion if (first) { a = nef; + base_operand_succeeded = true; } else { if (br->operation == taxonomy::boolean_result::SUBTRACTION) { second_operand_collector.add_polyhedron(nef); @@ -2153,6 +2156,11 @@ bool CgalKernel::convert_impl(const taxonomy::boolean_result::ptr br, Conversion first = false; } + if (!base_operand_succeeded && br->operation != taxonomy::boolean_result::UNION) { + logger().Message(Logger::LOG_ERROR, "GEO", 105, "Could not process base operand of boolean operation:", br->instance); + return false; + } + if (br->operation == taxonomy::boolean_result::SUBTRACTION && second_operand_collector_size) { a -= second_operand_collector.get_union(); }