Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] polygon triangulation

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] polygon triangulation


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] polygon triangulation
  • Date: Tue, 15 Mar 2011 11:47:44 +0100

Please have a look at the FAQ.

http://www.cgal.org/FAQ.html#polygon_triangulation

S.

sara123 wrote:
hi,

How can we triangulate (Basic Triangulation) a simple polygon that was been
produced with this kernel:

#include &lt;CGAL/double.h&gt;
typedef double RT;
typedef CGAL::Cartesian K;
typedef K::Point_2 Point_2;
typedef std::list Container;
typedef CGAL::Polygon_2&lt;K, Container&gt; Polygon_2;

I want to triangulate my polygon with this proccess:

#include
#include &lt;CGAL/Exact_predicates_inexact_constructions_kernel.h&gt;
#include &lt;CGAL/Triangulation_2.h&gt;

typedef CGAL::Exact_predicates_inexact_constructions_kernel K;

typedef CGAL::Triangulation_2 Triangulation;
typedef Triangulation::Vertex_circulator Vertex_circulator;
typedef Triangulation::Point Point;

int main() {
std::ifstream in("data/triangulation_prog1.cin");
std::istream_iterator begin(in);
std::istream_iterator end;

Triangulation t;
t.insert(begin, end);

Vertex_circulator vc = t.incident_vertices(t.infinite_vertex()),
done(vc);
if (vc != 0) {
do { std::cout << vc->point() << std::endl;
}while(++vc != done);
}
return 0;
}

[The vertices of my polygon should be triangulate as my points in top
process]

Thanks alot,

--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/polygon-triangulation-tp3356157p3356157.html
Sent from the cgal-discuss mailing list archive at Nabble.com.





Archive powered by MHonArc 2.6.16.

Top of Page