Subject: CGAL users discussion list
List archive
- From: "Florian Rudolf" <>
- To:
- Subject: [cgal-discuss] 3D Meshing with features, CGAL::Precondition_exception
- Date: Wed, 6 Mar 2013 16:43:05 +0100 (CET)
Hello!
I'm quite new to CGAL and I'm having troubles using 3D Meshing with features.
My code basically looks like this:
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Mesh_polyhedron_3<K>::type MeshPolyhedron;
typedef CGAL::Polyhedral_mesh_domain_with_features_3<K, MeshPolyhedron>
Mesh_domain;
// Triangulation
typedef CGAL::Mesh_triangulation_3<Mesh_domain>::type Tr;
typedef CGAL::Mesh_complex_3_in_triangulation_3<Tr,
Mesh_domain::Corner_index,Mesh_domain::Curve_segment_index> C3t3;
// Criteria
typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;
typedef MeshPolyhedron::Point_3 Point;
double s = 10.0;
MeshPolyhedron polyhedron;
polyhedron.make_triangle( Point(0, 0, 0), Point(s, 0, 0), Point(0, s,
0) );
polyhedron.make_triangle( Point(s, 0, 0), Point(0, s, 0), Point(s, s,
0) );
polyhedron.make_triangle( Point(0, 0, s), Point(s, 0, s), Point(0, s,
s) );
polyhedron.make_triangle( Point(s, 0, s), Point(0, s, s), Point(s, s,
s) );
polyhedron.make_triangle( Point(0, 0, 0), Point(s, 0, 0), Point(0, 0,
s) );
polyhedron.make_triangle( Point(s, 0, 0), Point(0, 0, s), Point(s, 0,
s) );
polyhedron.make_triangle( Point(0, s, 0), Point(s, s, 0), Point(0, s,
s) );
polyhedron.make_triangle( Point(s, s, 0), Point(0, s, s), Point(s, s,
s) );
polyhedron.make_triangle( Point(0, 0, 0), Point(0, s, 0), Point(0, 0,
s) );
polyhedron.make_triangle( Point(0, s, 0), Point(0, 0, s), Point(0, s,
s) );
polyhedron.make_triangle( Point(s, 0, 0), Point(s, s, 0), Point(s, 0,
s) );
polyhedron.make_triangle( Point(s, s, 0), Point(s, 0, s), Point(s, s,
s) );
Mesh_domain domain(polyhedron);
Mesh_criteria criteria;
domain.detect_features();
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria);
I tried to build a simple cube which should be meshed preserving the 0-d and
1-d features. The source code compiles fine but when I want to execute this
program, the following error occurs:
terminate called after throwing an instance of 'CGAL::Precondition_exception'
what(): CGAL ERROR: precondition violation!
Expr: sp > 0
File: /usr/include/CGAL/Mesh_3/Protect_edges_sizing_field.h
Line: 629
Aborted
Searching the internet, I came accros the following post:
http://cgal-discuss.949826.n4.nabble.com/Error-in-debug-not-in-release-with-make-mesh-3-td4655710.html
Just like described there, it works when compiling in Release mode. I took a
deeper look at the source code and noticed that sp is the weight of a point,
calculated at Protect_edges_sizing_field.h:601. Am I using the Interface in a
wrong way or did I forget something? Or is there a bug somewhere?
Thanks in advance
- [cgal-discuss] 3D Meshing with features, CGAL::Precondition_exception, Florian Rudolf, 03/06/2013
Archive powered by MHonArc 2.6.18.