chrisidefix / cgal-bindings

Automatically exported from code.google.com/p/cgal-bindings
Boost Software License 1.0
0 stars 0 forks source link

dual function of a Delaunay triangulation always return none #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, 
I think I may find an issue on the dual function of a delaunay triangulation. 
When I call it with a face handle as first argument and a point as a second 
argument, it always return none.

Here are the steps to reproduce the problem:
{{{
points=[]
points.append( Point_2(1,0) )
points.append( Point_2(3,2) )
points.append( Point_2(4,5) )
points.append( Point_2(9,8) )
points.append( Point_2(7,4) )
points.append( Point_2(5,2) )
points.append( Point_2(6,3) )
points.append( Point_2(10,1) )
t=Delaunay_triangulation_2()
t.insert(points)
for edge in t.finite_edges():
   for p in points:
      print t.dual(edge[0], p)
}}}

I noticed that the dual function is working when it is used like this:
{{{
edge_it = t.finite_edges()
edge = edge_id.next()
print t.dual(edge[0])
}}}

But this one only returns the center of the circle circumscribed to face 
edge[0].

Thx,

François

Original issue reported on code.google.com by francois...@gmail.com on 23 Jan 2012 at 5:47

GoogleCodeExporter commented 9 years ago
Actually, t.dual(edge[0], p) is filling p.
So instead of:
  print t.dual(edge[0], p)

you should do:
  t.dual(edge[0], p)
  print p

You are right that you can only get the circumcenters of faces.
The other dual functions are not provided because they are using 
CGAL::Object which is problematic to wrap. If you really need it I can do it 
but it 
will be as inelegant as I did for AABB_tree package.

Original comment by sloriot...@gmail.com on 23 Jan 2012 at 6:15

GoogleCodeExporter commented 9 years ago
Thx for your help, I was hoping that the two signatures of the dual function 
would return different results...

I would be very interested by the wrapping of CGAL::Object even it's not 
elegant :) as I want to draw some voronoi graphs.

Original comment by francois...@gmail.com on 24 Jan 2012 at 8:02

GoogleCodeExporter commented 9 years ago
It should now be working.

try for example:
for edge in t.finite_edges():
  print t.dual(edge).is_Ray_2()

I did not try on windows. Can someone confirm it's OK on windows?

Original comment by sloriot...@gmail.com on 24 Jan 2012 at 2:47

GoogleCodeExporter commented 9 years ago
I tried it on a mac and everything works! thx for your precious help.

Original comment by francois...@gmail.com on 25 Jan 2012 at 11:01