Edge to constraint relationship

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

Edge to constraint relationship

ecu
Hi there,

After meshing (either with Constrained_Delaunay_triangulation_2 or
Constrained_triangulation_plus_2) I would like to be able to determine which
constraint an edge originated from, if any, but as yet have not been able to
see how.

I know how to test if an edge is constrained in general, but not due to
which one.

I have also noticed the insert_constraint method of
Constrained_triangulation_plus_2 returns a Constraint_id, but I can't see
how get this id from an edge.

Any pointers would be greatly appreciated,

Erik



--
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: Edge to constraint relationship

Laurent Rineau (CGAL/GeometryFactory)
On Wednesday, October 17, 2018 12:06:15 PM CEST ecu wrote:

> Hi there,
>
> After meshing (either with Constrained_Delaunay_triangulation_2 or
> Constrained_triangulation_plus_2) I would like to be able to determine which
> constraint an edge originated from, if any, but as yet have not been able
> to see how.
>
> I know how to test if an edge is constrained in general, but not due to
> which one.
>
> I have also noticed the insert_constraint method of
> Constrained_triangulation_plus_2 returns a Constraint_id, but I can't see
> how get this id from an edge.

You can use the function `Context context(Vertex_handle, Vertex_handle)` to get the information.

    Edge e;
    const Vertex_handle va = e.first->vertex(e.second);
    const Vertex_handle vb = e.first->vertex(e.third);
    const Context context = tr.context(va, vb);
    const Constraint_id id = context.id();

See the documentation:
https://doc.cgal.org/4.13/Triangulation_2/classCGAL_1_1Constrained__triangulation__plus__2.html#a65c0a285ac0f81aa246e0a06ea07ae99


--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory           http://www.geometryfactory.com/
Release Manager of the CGAL Project       http://www.cgal.org/




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


ecu
Reply | Threaded
Open this post in threaded view
|

Re: Edge to constraint relationship

ecu
That's just what I was looking for. It's working great for
Constrained_triangulation_plus_2. Thanks Laurent.

Do you know of a way of determining which constraint a face-edge resulted
from (if any) after meshing a Constrained_Delaunay_triangulation_2?






--
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