Subject: CGAL users discussion list
List archive
- From: gerth <>
- To:
- Subject: [cgal-discuss] Re: Constrained Delauny Triangulation
- Date: Mon, 13 Aug 2012 01:45:21 -0700 (PDT)
Hi!
Thanks for your answers so far! My code snip was a little messy, so I'd like
to post it once again. JuanLu, the difference between v1 and vc1 was just a
typo (I had to copy the code snips from several files). The following code
snip should work unmodified though.
In my last example I forgot to specify an Itag. This time I did, but I still
get an error if I try to insert constraint lines that are *very close* to an
existing vertex. Can you please check the code and verify this error. The
error I get is:
Unhandled exception at 0x7c812afb in gui.exe: Microsoft C++ exception:
CGAL::Assertion_exception at memory location 0x010ec2dc..
Code:
//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>
//General
typedef CGAL::Exact_predicates_inexact_constructions_kernel
K;
typedef CGAL::Triangulation_vertex_base_2<K>
Vb;
typedef K::Point_2
Point_2;
//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::Exact_predicates_tag
Itag_fine;
typedef CGAL::Constrained_Delaunay_triangulation_2<K, TDS_fine, Itag_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()
{
//Insert initial points and constraints (closed polygon)
CDT_fine cdt_fine;
Vertex_handle_fine v_act, v_next;
v_act = cdt_fine.insert(Point_fine(0.0, 0.0));
v_next = cdt_fine.insert(Point_fine(-15.636358459247276,
-17.832801345735788));
cdt_fine.insert_constraint(v_act, v_next);
v_act = cdt_fine.insert(Point_fine(-15.636358459247276,
-17.832801345735788));
v_next = cdt_fine.insert(Point_fine(-30.793984547723085,
-4.6360093057155609));
cdt_fine.insert_constraint(v_act, v_next);
v_act = cdt_fine.insert(Point_fine(-30.793984547723085,
-4.6360093057155609));
v_next = cdt_fine.insert(Point_fine(-22.687070030719042,
4.6138969026505947));
cdt_fine.insert_constraint(v_act, v_next);
v_act = cdt_fine.insert(Point_fine(-22.687070030719042,
4.6138969026505947));
v_next = cdt_fine.insert(Point_fine(-18.531077503692359,
1.0006236322224140));
cdt_fine.insert_constraint(v_act, v_next);
v_act = cdt_fine.insert(Point_fine(-18.531077503692359,
1.0006236322224140));
v_next = cdt_fine.insert(Point_fine(-11.001624230295420,
9.5834844978526235));
cdt_fine.insert_constraint(v_act, v_next);
v_act = cdt_fine.insert(Point_fine(-11.001624230295420,
9.5834844978526235));
v_next = cdt_fine.insert(Point_fine(0.0, 0.0));
cdt_fine.insert_constraint(v_act, v_next);
//Insert additional points and constraints (does not work)
Vertex_handle_fine vc_act, vc_next;
vc_act =
cdt_fine.insert(Point_fine(-18.530322841197869,0.99996751895902314));
vc_next =
cdt_fine.insert(Point_fine(-7.5181155150824690,-8.5741869389974159));
cdt_fine.insert_constraint(vc_act, vc_next);
vc_act =
cdt_fine.insert(Point_fine(18.531736972623872,0.99987190033978390));
vc_next =
cdt_fine.insert(Point_fine(-26.644896901557836,-8.2483590564386784));
cdt_fine.insert_constraint(vc_act, vc_next);
//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(); //Exception is thrown here
}
I appreciate your help!
Gert
--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Constrained-Delauny-Triangulation-tp4655688p4655694.html
Sent from the cgal-discuss mailing list archive at Nabble.com.
- [cgal-discuss] Constrained Delauny Triangulation, gerth, 08/10/2012
- Re: [cgal-discuss] Constrained Delauny Triangulation, Laurent Rineau (CGAL/GeometryFactory), 08/10/2012
- [cgal-discuss] Re: Constrained Delauny Triangulation, gerth, 08/10/2012
- [cgal-discuss] Re: Constrained Delauny Triangulation, JuanLu, 08/11/2012
- [cgal-discuss] Re: Constrained Delauny Triangulation, JuanLu, 08/11/2012
- [cgal-discuss] Re: Constrained Delauny Triangulation, gerth, 08/13/2012
- [cgal-discuss] Re: Constrained Delauny Triangulation, JuanLu, 08/13/2012
- [cgal-discuss] Re: Constrained Delauny Triangulation, gerth, 08/13/2012
- [cgal-discuss] Re: Constrained Delauny Triangulation, gerth, 08/13/2012
- [cgal-discuss] Re: Constrained Delauny Triangulation, JuanLu, 08/13/2012
- [cgal-discuss] Re: Constrained Delauny Triangulation, gerth, 08/14/2012
- [cgal-discuss] Re: Constrained Delauny Triangulation, JuanLu, 08/14/2012
- [cgal-discuss] Re: Constrained Delauny Triangulation, JuanLu, 08/13/2012
- [cgal-discuss] Re: Constrained Delauny Triangulation, gerth, 08/13/2012
- [cgal-discuss] Re: Constrained Delauny Triangulation, JuanLu, 08/11/2012
- [cgal-discuss] Re: Constrained Delauny Triangulation, JuanLu, 08/11/2012
- [cgal-discuss] Re: Constrained Delauny Triangulation, gerth, 08/10/2012
- Re: [cgal-discuss] Constrained Delauny Triangulation, Laurent Rineau (CGAL/GeometryFactory), 08/10/2012
Archive powered by MHonArc 2.6.18.