Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Voronoi unbounded halfedge to ray_2

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Voronoi unbounded halfedge to ray_2


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Voronoi unbounded halfedge to ray_2
  • Date: Tue, 19 Jul 2016 16:25:42 +0200
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:jbryTRPd9Ut2XgEDwuAl6mtUPXoX/o7sNwtQ0KIMzox0Kf36rarrMEGX3/hxlliBBdydsKMczbeP+P+6EUU7or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6anHS+4HYoFwnlMkItf6KuS9aU0p38iLr60qaQSj0AvCC6b7J2IUf+hiTqne5Sv7FfLL0swADCuHpCdrce72ppIVWOg0S0vZ/or9YwuxlWoO8ros5cTb3hLeN/Vq1dFD1gMmYv5cStuwOEVhqK/nJbU2MYlV1DDAHBqR37RZzsqTCpiu0o0yaTOYj6TKs/RC+5x6ZtUh7hzikdZBAj92SCwPd9hqtAvBOsoVRbxJTVZ53ddNVzeabQYckLa2NKQsFLRm0LStena4wVDu0de+Nch4b4rloK6xC5AF//V6vU1jZUiyqujuUB2OM7HFSe0Q==
  • Organization: GeometryFactory


The halfedge has a dual method that will gives you the Delaunay_edge you need to call the function I mentioned.

http://doc.cgal.org/latest/Voronoi_diagram_2/classCGAL_1_1Voronoi__diagram__2_1_1Halfedge.html#a55c12984864f6e688bc775220633ec63

Note you can access the underlying triangulation by calling Voronoi_diagram_2::dual();

http://doc.cgal.org/latest/Voronoi_diagram_2/classCGAL_1_1Voronoi__diagram__2.html#acd0aca0a4b4666c615e2902f71134cd1

Sebastien.



On 07/19/2016 04:21 PM, Pol Monsó Purtí wrote:
Thanks Sebastien,

If I understood your example correctly, an alternative would be to use
the voronoi's delaunay vd.dual() instead and traverse its edges to
obtain the voronoi lines/rays/segments.

It isn't possible to do it directly with the voronoi? I already have the
halfedge whose ray/line I want. They ray/line/segment should already be
defined somehow.







On Tue, Jul 19, 2016 at 3:23 PM, Sebastien Loriot (GeometryFactory)
<

<mailto:>>
wrote:

This function should do what you want:


http://doc.cgal.org/latest/Triangulation_2/classCGAL_1_1Delaunay__triangulation__2.html#a0f9dc798a43693e646e166718a0a0a82

here is how it is used in Delaunay_triangulation_2::draw_dual()

Finite_edges_iterator eit= this->finite_edges_begin();
for (; eit != this->finite_edges_end(); ++eit) {
Object o = dual(eit);
typename Geom_traits::Line_2 l;
typename Geom_traits::Ray_2 r;
Segment s;
if (CGAL::assign(s,o)) ps << s;
if (CGAL::assign(r,o)) ps << r;
if (CGAL::assign(l,o)) ps << l;
}
return ps;

Sebastien.

On 07/19/2016 03:05 PM, Pol Monsó Purtí wrote:

Dear all,

How should I convert a voronoi is_ray() to ray_2 ?

I've found this old topic

<http://cgal-discuss.949826.n4.nabble.com/Question-about-method-of-dealing-with-the-unbounded-half-edge-in-Voronoi-diagram-2-td2019585.html>
but the links have rot, and it suggests a better alternative than
buildling it up from the top-bottom sites.

Cheers!

Pol






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







Archive powered by MHonArc 2.6.18.

Top of Page