Skip to content

How can I divide Polyhedron into different volumes? #8385

Closed Answered by ankofl
ankofl asked this question in Q&A
Discussion options

You must be logged in to vote

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();
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ankofl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant