Circulate convex hull edge and get the corresponding Voronoi rays

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

Circulate convex hull edge and get the corresponding Voronoi rays

brainslush
I have a convex polygon or a convex hull as input data for a Delaunay
triangulation and want to get the voronoi circle center or ray for the
convex hull edges.
I know that I can get the rays of the hull using

    auto eit = hullDt.edges_begin();
    for ( ; eit !=hullDt.edges_end(); ++eit) {
        CGAL::Object o = hullDt.dual(eit);
        if (auto _el = CGAL::object_cast<K::Ray_2>(&o)) {
            // do some magic
        }
    }

but this approach returns them unordered and the corresponding hull segment
(eit) in "arbitrary" directions as we are visiting not the infinite face but
the one adjacent and inside the polygon to it.

So I thought I could use the circulator

    hullDt.incident_faces(hullDt.infinite_vertex());

and determine the adjacent face inside the hull or the inside edge of the
hull segment which I then pass to

    hullDt.dual(insideFace);

which then should give me what I want, right?
The only thing I don't know how I find the adjacent face/edge. I probably
would find it eventually but maybe someone more familiar with the code knows
the right functions.

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


Reply | Threaded
Open this post in threaded view
|

Re: Circulate convex hull edge and get the corresponding Voronoi rays

Sebastien Loriot (GeometryFactory)
IIUC what you want, you want to get the edge opposite to the infinite
vertex.

Something like the following should work:

DT::Face_handle fh = XXX;
DT::Vertex_handle v_inf = dt.infinite_vertex();
DT::Edge opp_edge(fh, fh->index(v_inf));

Sebastien.


On 08/23/2018 11:46 AM, brainslush wrote:

> I have a convex polygon or a convex hull as input data for a Delaunay
> triangulation and want to get the voronoi circle center or ray for the
> convex hull edges.
> I know that I can get the rays of the hull using
>
>      auto eit = hullDt.edges_begin();
>      for ( ; eit !=hullDt.edges_end(); ++eit) {
>          CGAL::Object o = hullDt.dual(eit);
>          if (auto _el = CGAL::object_cast<K::Ray_2>(&o)) {
>              // do some magic
>          }
>      }
>
> but this approach returns them unordered and the corresponding hull segment
> (eit) in "arbitrary" directions as we are visiting not the infinite face but
> the one adjacent and inside the polygon to it.
>
> So I thought I could use the circulator
>
>      hullDt.incident_faces(hullDt.infinite_vertex());
>
> and determine the adjacent face inside the hull or the inside edge of the
> hull segment which I then pass to
>
>      hullDt.dual(insideFace);
>
> which then should give me what I want, right?
> The only thing I don't know how I find the adjacent face/edge. I probably
> would find it eventually but maybe someone more familiar with the code knows
> the right functions.
>
> 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