Subject: CGAL users discussion list
List archive
- From: Damian Sheehy <>
- To:
- Subject: Re: [cgal-discuss] Triangulation problem
- Date: Thu, 16 Jul 2009 13:41:26 -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=AO5GOMbj/9Mnb4tLZxN2yr/m0KGcBw7R0/yheMvBo79Bend+lXri8RkmKSsvoxSF7P ALowvYxZXe7cBxiymfNKE7UqeZ59GGgGtIkNZA32IRX2pM0L5eqxDMhJAhhgvHKf+A7j MqnN5+2rr2kerIYGOYQUuBunKxn8EeyllhfoI=
Are you kidding?
Why don't you do this . . . .
Point vertex = triangle.vertex(2);
triangles.push_back(Vec3(vertex.x(), vertex.y(), vertex.z()));
vertex = triangle.vertex(1);
triangles.push_back(Vec3(vertex.x(), vertex.y(), vertex.z()));
vertex = triangle.vertex(0);
triangles.push_back(Vec3(vertex.x(), vertex.y(), vertex.z()));
Instead of this. . . . .
Point vertex = triangle.vertex(0);
triangles.push_back(Vec3(vertex.x(), vertex.y(), vertex.z()));
vertex = triangle.vertex(1);
triangles.push_back(Vec3(vertex.x(), vertex.y(), vertex.z()));
vertex = triangle.vertex(2);
triangles.push_back(Vec3(vertex.x(), vertex.y(), vertex.z()));
On Thu, Jul 16, 2009 at 1:19 PM, <> wrote:
Hello, Im trying to use CGAL to triangulate polygon and I run into problem with
triangle orientation. CGAL always generate counter clock wise triangles for
some polygons. Here is my code:
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Triangulation_3<K> Triangulation;
typedef Triangulation::Cell_handle Cell_handle;
typedef Triangulation::Vertex_handle Vertex_handle;
typedef Triangulation::Locate_type Locate_type;
typedef Triangulation::Point Point;
typedef Triangulation::Facet_iterator Facet_iterator;
typedef Triangulation::Facet Facet;
// construction from a list of points :
std::list<Point> L;
L.push_back(Point(0, 0, 0));
Lpush_back(Point(25, 0, 0));
Lpush_back(Point(25, 0, 25));
Lpush_back(Point(0,0, 25));
Triangulation T(L.begin(), L.end());
for (Triangulation::Finite_facets_iterator fit = T.finite_facets_begin();
fit != T.finite_facets_end(); ++fit)
{
K::Triangle_3 triangle = T.triangle(*fit);
Point vertex = triangle.vertex(0);
triangles.push_back(Vec3(vertex.x(), vertex.y(), vertex.z()));
vertex = triangle.vertex(1);
triangles.push_back(Vec3(vertex.x(), vertex.y(), vertex.z()));
vertex = triangle.vertex(2);
triangles.push_back(Vec3(vertex.x(), vertex.y(), vertex.z()));
}
can I somehow set Triangluation to give me clockwise triangles? thx for help
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss
- [cgal-discuss] Triangulation problem, icek, 07/16/2009
- Re: [cgal-discuss] Triangulation problem, Andreas Fabri, 07/16/2009
- Re: [cgal-discuss] Triangulation problem, Damian Sheehy, 07/16/2009
- Re: Re: [cgal-discuss] Triangulation problem, icek, 07/16/2009
- Re: [cgal-discuss] Triangulation problem, Andreas Fabri, 07/16/2009
- Re: [cgal-discuss] Triangulation problem, Ariel Baez, 07/16/2009
- Re: Re: [cgal-discuss] Triangulation problem, icek, 07/16/2009
- Re: [cgal-discuss] Triangulation problem, Andreas Fabri, 07/16/2009
- Re: Re: [cgal-discuss] Triangulation problem, icek, 07/16/2009
- Re: [cgal-discuss] Triangulation problem, Andreas Fabri, 07/16/2009
- Re: [cgal-discuss] Triangulation problem, Damian Sheehy, 07/17/2009
- Re: Re: [cgal-discuss] Triangulation problem, icek, 07/17/2009
- Re: Re: [cgal-discuss] Triangulation problem, icek, 07/16/2009
- Re: [cgal-discuss] Triangulation problem, Andreas Fabri, 07/16/2009
- Re: [cgal-discuss] Triangulation problem, Andreas Fabri, 07/16/2009
- Re: Re: [cgal-discuss] Triangulation problem, icek, 07/16/2009
Archive powered by MHonArc 2.6.16.