Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Finite Triangle from infinite cell in triangulation

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Finite Triangle from infinite cell in triangulation


Chronological Thread 
  • From: Laurent Rineau <>
  • To:
  • Subject: Re: [cgal-discuss] Finite Triangle from infinite cell in triangulation
  • Date: Wed, 8 Aug 2007 19:26:29 +0200
  • Organization: Inria, Sophia Antipolis, FRANCE

On Wednesday 08 August 2007 18:21:27 Satyajit Sarangi wrote:
> Hi Laurent and Monique,
> I am still having a problem when extracting the infinite cell.
> When trying to extract the triangles from the infinite cell, I tried both
> the incident cell approach as well as by iterating through all the cells
> and then taking into consideration only the infinite cells. Still the
> result seems to be the same in both the cases.

I do not understand what could be your problem. Do you use CGAL in debug
mode,
with assertions activated?

Can you insert
CGAL_assertion(p_DelaunayTriangulation->is_valid());
at some point just before the code that tries to compute the convex hull?

If I had to bet, you would say that your code that displays triangles is the
problem. On the picture, it seems that a lot of triangles have the point
(0,0,0) as vertex.

If you need oriented triangles, use the function
p_DelaunayTriangulation->triangle(celliteratorbegin, index), that will give
you the triangles oriented inward. If you need triangle oriented to the
outside, inverse the orientation:

while (celliteratorbegin != celliteratorend)
{
if (p_DelaunayTriangulation->is_infinite(celliteratorbegin))
{
const Triangle3D t =
p_DelaunayTriangulation->triangle(celliteratorbegin,
celliteratorbegin->index(p_DelaunayTriangulation->infinite_vertex());

const Point3D pa = t[0];
const Point3D pb = t[2]; // see the inversion here
const Point3D pc = t[1];

// then your code that push the triangle to your list
}
++celliteratorbegin;
}

--
Laurent Rineau
INRIA - Sophia Antipolis
BP 93, 2004 Route des Lucioles
06902 Sophia Antipolis Cedex FRANCE
Tel: +33 4 92 38 78 62



Archive powered by MHonArc 2.6.16.

Top of Page