Split a mesh along a set of N consecutive halfedges.

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Split a mesh along a set of N consecutive halfedges.

aseverino
This post was updated on .
Hello. I'm trying to split a mesh using a list of halfedges that are
consecutive (forming a circular "spline" that "strangles" the mesh).

I've been trying a lot of CGAL::Euler operations, but have had no success
after many hours of trying.

How can I achieve that?



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|

Re: Split a mesh along a set of N consecutive halfedges.

Sebastien Loriot (GeometryFactory)
You can do it directly using low level operations.
The other solution is to compute the connected components of your mesh
bounded by your constrained edges and then you can remove or copy some
parts.

If you're using
typedef CGAL::Surface_mesh<Point> Surface_mesh;
Surface_mesh tm;
Surface_mesh::Property_map<Surface_mesh::Edge_index, bool> ecm =
     tm.add_property_map<Surface_mesh::Edge_index, bool>("ecm",
false).first;

Set ecm for the edges that you want to constraint and then
pass ecm in the call to connected_components, using
CGAL::parameters::edge_constrained_map(ecm).

See this example for the split
https://doc.cgal.org/latest/Polygon_mesh_processing/Polygon_mesh_processing_2face_filtered_graph_example_8cpp-example.html

Sebastien.

On 11/30/2018 01:03 AM, aseverino wrote:

> Hello. I'm trying to split an edge using a list of halfedges that are
> consecutive (forming a circular "spline" that "strangles" the mesh).
>
> I've been trying a lot of CGAL::Euler operations, but have had no success
> after many hours of trying.
>
> How can I achieve that?
>
>
>
> --
> Sent from: http://cgal-discuss.949826.n4.nabble.com/
>

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|

Re: Split a mesh along a set of N consecutive halfedges.

aseverino
I'm sorry if it's inconvenient, but I'm pretty new to CGAL, and I wouldn't
know where to go from this point onward:

        Triangle_mesh::Property_map<Triangle_mesh::Edge_index, bool> ecm =
                m_cgal_mesh2.add_property_map<Triangle_mesh::Edge_index, bool>("ecm",
                        false).first;

        for (auto& c : cutting_points) {
                c.inserted_hh = CGAL::Euler::split_edge(c.orig_hh, m_cgal_mesh2);
                auto v = m_cgal_mesh2.target(c.inserted_hh);
                m_cgal_mesh2.point(v) = c.point;
                c.spline = CGAL::Euler::split_face(c.inserted_hh,
m_cgal_mesh2.next(c.orig_hh), m_cgal_mesh2);

                ecm[m_cgal_mesh2.edge(c.spline)] = true;
        }



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|

Re: Split a mesh along a set of N consecutive halfedges.

aseverino
I figured out most of it. Now I'm having another issue, but I think I'll make
another thread to keep it well scoped. Thanks!



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss