-
I have several forms in the .off format. I created a large cube so that all the shapes of pain inside this cube, and then subtracted all my shapes from this cube by performing a Boolean operation. As a result, I got a Polyhedron consisting of a large cube with a cavity inside. And inside this cavity there are several other separate clubs (in various cases, these may be not only cubes, but also other various shapes) My question is, how do I get a list of individual Polyhedrons from my cube with a cavity and cubes inside? For a better understanding, I uploaded the final rooms.off file to Unity |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Solved! #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/Polyhedron_items_with_id_3.h>
#include <CGAL/Polygon_mesh_processing/connected_components.h>
#include <CGAL/IO/Polyhedron_iostream.h>
#include <vector>
#include <fstream>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Polyhedron_3<K, CGAL::Polyhedron_items_with_id_3> Mesh;
int SplitMesh(Mesh& mesh, std::vector<Mesh>& components) {
// Ðàçäåëåíèå ñåòêè íà êîìïîíåíòû ñâÿçíîñòè
CGAL::Polygon_mesh_processing::split_connected_components(mesh, components);
return components.size();
} |
Beta Was this translation helpful? Give feedback.
Solved!