Fix for open polyhedra

This commit is contained in:
Thomas Krijnen
2020-01-26 13:58:02 +01:00
parent 060c35939a
commit b6a7ba1e1c
2 changed files with 7 additions and 1 deletions
+5
View File
@@ -481,6 +481,11 @@ struct intersection_validator {
}
CGAL::Nef_polyhedron_3<Kernel_> 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 });
+2 -1
View File
@@ -94,7 +94,8 @@ CGAL::Nef_polyhedron_3<Kernel_> ifcopenshell::geometry::utils::create_nef_polyhe
}
CGAL::Nef_polyhedron_3<Kernel_> ifcopenshell::geometry::utils::create_nef_polyhedron(CGAL::Polyhedron_3<Kernel_> &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<Kernel_> nef_polyhedron;
try {