Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Triangulation problem

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Triangulation problem


Chronological Thread 
  • From: Damian Sheehy <>
  • To:
  • Subject: Re: [cgal-discuss] Triangulation problem
  • Date: Thu, 16 Jul 2009 18:16:17 -0400
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=dvCF6J8DfQpgcARQm5KOCQpg40UkdTd1a6UOf8TF4ASLZINe/PIewHSTahN45jAgBq gz7TF6RC/+KGbiY01DZ3H2VEPjiBHy+d0GGl167kVU/As+0ORO6WACJsJmHlGNx+DCDh 2B1JH7bEojGFmqIGUvAe+QfkPqiuirRq55Mss=

Icek,


The class Triangulation_3 represents a 3-dimensional tetrahedralization of points.
In your original email you stated "Im trying to use CGAL to triangulate polygon "
The point sample you provided lies on a plane in 3D space.
Map your points to the plane and use a 2D triangulation.

When you view the triangulation from one side of the plane the triangles will be clockwise and when you view from the other side they will be counter-clockwise.



Damian


On Thu, Jul 16, 2009 at 5:29 PM, Andreas Fabri <> wrote:
wrote:
still nothing... I rewrite it along Your advices >

for (Triangulation::Finite_facets_iterator fit = T.finite_facets_begin(); fit
!= T.finite_facets_end(); ++fit)
   {
       Cell_handle cell = fit->first;

       Point point1 =
cell->vertex(Triangulation::vertex_triple_index(fit->second, 2))->point();
       Point point2 =
cell->vertex(Triangulation::vertex_triple_index(fit->second, 1))->point();
       Point point3 =
cell->vertex(Triangulation::vertex_triple_index(fit->second, 0))->point();

       triangles.push_back(Vec3(point1.x(), point1.y(), point1.z()));
       triangles.push_back(Vec3(point2.x(), point2.y(), point2.z()));
       triangles.push_back(Vec3(point3.x(), point3.y(), point3.z()));
}
I hope this code makes sense. It still works for one, and dont for other one. I
spent some time in manual, but I cant find anything useful for me. I believe
what Im trying to do is basic operation for everyone who wants to render result
of CGAL triangulation, so there must be somebody with solution for me ;-)


You assume that the Cell_handle is always the same, namely the cell inside
the tetrahedron. This is wrong (and you can check this by printing &*fit

As I wrote in my previous mail facets can be seen from two sides, so what
the Finite_facet_iterator does, is to step through all cells, to look at
the four neighbor cells. If one cell is finite, it reports the facet,
if the address of the cell is smaller than the address of the neighbor
in order to report facets only once.

That's why in your 4 point, 1 finite cell case, some facets get reported
from inside, others from outside.

andreas




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




Archive powered by MHonArc 2.6.16.

Top of Page