Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Question about method of dealing with the unbounded half-edge in Voronoi_diagram_2

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Question about method of dealing with the unbounded half-edge in Voronoi_diagram_2


Chronological Thread 
  • From: Michael Hoffmann <>
  • To: shusen liu <>
  • Cc: <>
  • Subject: Re: [cgal-discuss] Question about method of dealing with the unbounded half-edge in Voronoi_diagram_2
  • Date: Wed, 21 Apr 2010 23:35:53 +0200


Since you can't(or I don't know how) convert unbounded half-edge into
Ray_2, the reasonable solution would be calculate the direction by
yourself using the sites position. But this also turn out to be
difficult to do.


I suppose it would be nice to have a direct way of getting the ray as part of the interface, just as for finite edges/segments. Anyway:

For a Voronoi halfedge you can get the two defining Delaunay vertices in various ways, for instance, by down() and up() or via face()->dual () and opposite()->face()->dual(). Then define a vector between the corresponding points (the one on your side/face first) and obtain the direction of the ray via perpendicular(CGAL::CLOCKWISE).

Another option is to use dt.dual(halfedge->dual()), where dt is the underlying Delaunay triangulation. This returns a CGAL::Object, which can be cast into a ray (if it is a ray) using object_cast (as for intersections...).

If there's a more elegant way to do this, I'd be glad to hear...

hth,
Michael



Archive powered by MHonArc 2.6.16.

Top of Page