-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
Description
Issues with multiple times applying in invalid meshes. I know you did some new developments in cgal. Can you suggest any solutions? These issues remains for many years with our compas cgal binding.
It would be really nice that the mesh booleans would be more robust for more than a few boolean difference runs due to triangulations.
Issue Details
The issue is that the more booleans I do the more detailed mesh becomes and at one point it just crashes.
In "real life" I am trying to cut out drilled screws from a piece of block.
Source Code
std::tuple<compas::RowMatrixXd, compas::RowMatrixXi>
pmp_boolean_difference(
Eigen::Ref<const compas::RowMatrixXd> vertices_a,
Eigen::Ref<const compas::RowMatrixXi> faces_a,
Eigen::Ref<const compas::RowMatrixXd> vertices_b,
Eigen::Ref<const compas::RowMatrixXi> faces_b)
{
compas::Mesh mesh_a = compas::mesh_from_vertices_and_faces(vertices_a, faces_a);
compas::Mesh mesh_b = compas::mesh_from_vertices_and_faces(vertices_b, faces_b);
compas::Mesh mesh_out;
CGAL::Polygon_mesh_processing::corefine_and_compute_difference(mesh_a, mesh_b, mesh_out);
std::tuple<compas::RowMatrixXd, compas::RowMatrixXi> result = compas::mesh_to_vertices_and_faces(mesh_out);
return result;
};
Environment
Ubuntu, mac and windows
This booleand difference fails.
