diff --git a/src/ifcconvert/validation_utils.h b/src/ifcconvert/validation_utils.h index eca3406563..382603371f 100644 --- a/src/ifcconvert/validation_utils.h +++ b/src/ifcconvert/validation_utils.h @@ -481,6 +481,11 @@ struct intersection_validator { } CGAL::Nef_polyhedron_3 nef = ifcopenshell::geometry::utils::create_nef_polyhedron(s); + if (nef.is_empty()) { + std::wcout << "Failed to create nef" << std::endl; + continue; + } + nef = CGAL::minkowski_sum_3(nef, cube); std::wcout << "product: " << geom_object->product() << std::endl; nefs.push_back({ geom_object->product(), nef }); diff --git a/src/ifcgeom/kernels/cgal/CgalKernel.cpp b/src/ifcgeom/kernels/cgal/CgalKernel.cpp index 190a851470..3d6e76d9c8 100644 --- a/src/ifcgeom/kernels/cgal/CgalKernel.cpp +++ b/src/ifcgeom/kernels/cgal/CgalKernel.cpp @@ -94,7 +94,8 @@ CGAL::Nef_polyhedron_3 ifcopenshell::geometry::utils::create_nef_polyhe } CGAL::Nef_polyhedron_3 ifcopenshell::geometry::utils::create_nef_polyhedron(CGAL::Polyhedron_3 &polyhedron) { - if (polyhedron.is_valid()) { + if (polyhedron.is_valid() && polyhedron.is_closed()) { + // @todo is it necessary to triangulat? CGAL::Polygon_mesh_processing::triangulate_faces(polyhedron); CGAL::Nef_polyhedron_3 nef_polyhedron; try {