Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Re: Constrained Delauny Triangulation

Subject: CGAL users discussion list

List archive

[cgal-discuss] Re: Constrained Delauny Triangulation


Chronological Thread 
  • From: gerth <>
  • To:
  • Subject: [cgal-discuss] Re: Constrained Delauny Triangulation
  • Date: Fri, 10 Aug 2012 03:36:32 -0700 (PDT)

Heres a code snip:

//Includes
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Cartesian.h>
#include <CGAL/Delaunay_triangulation_2.h>
#include <CGAL/Constrained_Delaunay_triangulation_2.h>
#include <CGAL/Delaunay_mesher_2.h>
#include <CGAL/Delaunay_mesh_face_base_2.h>
#include <CGAL/Delaunay_mesh_size_criteria_2.h>
#include <CGAL/Triangulation_face_base_2.h>
#include <CGAL/Triangulation_face_base_with_info_2.h>
#include <CGAL/Polygon_2.h>
#include <CGAL/Triangulation_2.h>
#include <CGAL/Vector_3.h>
#include <CGAL/Triangulation_conformer_2.h>
#include <CGAL/Triangulation_utils_2.h>
#include <CGAL/number_utils.h>
#include <CGAL/bounding_box.h>

//Fine mesh
typedef CGAL::Delaunay_mesh_face_base_2<K>
Fb_fine;
typedef CGAL::Triangulation_data_structure_2<Vb, Fb_fine>
TDS_fine;
typedef CGAL::Constrained_Delaunay_triangulation_2<K, TDS_fine>
CDT_fine;
typedef CGAL::Delaunay_mesh_size_criteria_2<CDT_fine>
Criteria_fine;
typedef CGAL::Delaunay_mesher_2<CDT_fine, Criteria_fine>
Mesher_fine;
typedef CDT_fine::Point
Point_fine;
typedef CDT_fine::Vertex_handle
Vertex_handle_fine;
typedef CDT_fine::Vertex_iterator
Vertex_iterator_fine;
typedef CDT_fine::Face_handle
Face_handle_fine;
typedef CDT_fine::Triangle
Triangle_fine;
typedef CDT_fine::Vertex
Vertex_fine;



int main()
{

....

CDT_fine cdt_fine;

//Insert polygon points and polygon lines as constraints
Vertex_handle_fine v1, v2, v3, v4, v5, v6, v7;
v1 = cdt_fine.insert(Point_fine(0.0,0.0));
v2 = cdt_fine.insert(Point_fine(-15.6364,-17.8328));
cdt_fine.insert_constraint(v1, v2);
v3 = cdt_fine.insert(Point_fine(-30.794,-4.63601));
cdt_fine.insert_constraint(v2, v3);
v4 = cdt_fine.insert(Point_fine(-22.6871,-4.6139));
cdt_fine.insert_constraint(v3, v4);
v5 = cdt_fine.insert(Point_fine(-18.5311,1.0062));
cdt_fine.insert_constraint(v4, v5);
v6 = cdt_fine.insert(Point_fine(-11.0016,9.58348));
cdt_fine.insert_constraint(v5, v6);
v7 = cdt_fine.insert(Point_fine(0.0,0.0));
cdt_fine.insert_constraint(v6, v7);


//Insert additional points and Constraint lines

Vertex_handle_fine vc1, vc2;
v1 = cdt_fine.insert(Point_fine(-18.5303,0.999968));
v2 = cdt_fine.insert(Point_fine(-7.51812,-8.57419));
cdt_fine.insert_constraint(vc1, vc2);


//Mesh it
Mesher_fine mesher_fine(cdt_fine);
mesher_fine.refine_mesh();
mesher_fine.set_criteria(Criteria_fine(0.125, 1));
mesher_fine.refine_mesh(); //Here we get the exception

}


If I remove the part with the additional points and Constraint lines,
everything works fine!




--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Constrained-Delauny-Triangulation-tp4655688p4655690.html
Sent from the cgal-discuss mailing list archive at Nabble.com.



Archive powered by MHonArc 2.6.18.

Top of Page