Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Sharp features BUG or misuse ?

Subject: CGAL users discussion list

List archive

[cgal-discuss] Sharp features BUG or misuse ?


Chronological Thread 
  • From: Emmanuel Olivi <>
  • To:
  • Subject: [cgal-discuss] Sharp features BUG or misuse ?
  • Date: Mon, 07 Nov 2011 17:35:26 +0100
  • Organization: INRIA

Hi dear developers of CGAL,

I would like to use sharp features, in order to obtain a 3D mesh that confirms exactly with a 2D input polyhedron.
The polyhedron here used is called sphere42.off and is joined to this email.

In the example file:
/examples/Mesh_3/mesh_polyhedral_domain_with_features.cpp

if one applies the patch given in the email which loads the input polyhedron, and detect its sharps features which we want to be the set of all edges, i.e.:
> domain.detect_features(0.); // below 0. degree angle, it is considered as sharp

the problem is that, once compiled it crashes most of the time depending the criterion.

For example:
this works fine for the criterion:
edge_size = 0.08, facet_angle = 25, facet_size = 0.15, facet_distance = 0.005, cell_radius_edge_ratio = 3, cell_size = 0.8

but crashes for:
edge_size = 0.08, facet_angle = 25, facet_size = 0.08, facet_distance = 0.005, cell_radius_edge_ratio = 3, cell_size = 0.08


> ./mesh_polyhedral_domain_with_features 0.08 0.08 0.08
terminate called after throwing an instance of 'CGAL::Assertion_exception'
  what():  CGAL ERROR: assertion violation!
File: /user/eolivi/home/src/CGAL-3.9/include/CGAL/Mesh_3/Refine_facets_3.h
Line: 572
Explanation: Mesh_3 ERROR: A facet is not in conflict with its refinement point!
Debugging informations:
  Facet: (0x7faa9dbaf150, 0) = (0.25 0.904509 -0.154508 0.00419904, 0.214286 0.832808 -0.432854 0.00419904, 0.3125 0.880636 -0.193136 0.00419904)
  Dual: (8.07837e+12 3.91402e+13 -1.11189e+13 0, 3.5135e+13 1.70231e+14 -4.83591e+13 0)
  Refinement point: -0.302748 -0.867429 0.246709 0

My question: Why does it crashes ? Is it a bug ? Is it a bad choice of parameters, and how to choose these parameters ?

thanks
Emmanuel



to modify your example file just write:
> patch mesh_polyhedral_domain_with_features.cpp patch
--- mesh_polyhedral_domain_with_features.cpp.orig	2011-11-07 17:10:39.366157000 +0100
+++ mesh_polyhedral_domain_with_features.cpp	2011-11-07 17:10:46.036659000 +0100
@@ -1,4 +1,5 @@
-#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
+#if 0
+ #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
  #include <CGAL/Delaunay_triangulation_3.h>
  #include <CGAL/Triangulation_vertex_base_with_info_3.h>
  #include <CGAL/Mesh_3/Robust_intersection_traits_3.h>
@@ -90,7 +91,7 @@
   medit_file.close();
  }
 
-#if 0
+#else 
 #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
 
 #include <CGAL/Mesh_triangulation_3.h>
@@ -115,18 +116,18 @@
 // To avoid verbose function and named parameters call
 using namespace CGAL::parameters;
 
-int main()
+int main(int argc, char ** argv)
 {
   // Create domain
-  Mesh_domain domain("data/fandisk.off");
+  Mesh_domain domain("sphere42.off");
   
   // Get sharp features
-  domain.detect_features();
+  domain.detect_features(0.);
 
   // Mesh criteria
-  Mesh_criteria criteria(edge_size = 0.025,
-                         facet_angle = 25, facet_size = 0.05, facet_distance = 0.005,
-                         cell_radius_edge_ratio = 3, cell_size = 0.05);
+  Mesh_criteria criteria(edge_size = atof(argv[1]), // 0.025
+                         facet_angle = 25, facet_size = atof(argv[2]), facet_distance = 0.005,
+                         cell_radius_edge_ratio = 3, cell_size = atof(argv[3]));
   
   // Mesh generation
   C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria);
OFF
42 80 0
-0.525731 0 0.850651
0.525731 0 0.850651
-0.525731 0 -0.850651
0.525731 0 -0.850651
0 0.850651 0.525731
0 0.850651 -0.525731
0 -0.850651 0.525731
0 -0.850651 -0.525731
0.850651 0.525731 0
-0.850651 0.525731 0
0.850651 -0.525731 0
-0.850651 -0.525731 0
-0.309017 0.5 0.809017
0.309017 0.5 0.809017
0 0 1
-0.809017 0.309017 0.5
-0.5 0.809017 0.309017
-0.5 0.809017 -0.309017
0 1 0
0.5 0.809017 -0.309017
0.5 0.809017 0.309017
0.809017 0.309017 0.5
1 0 0
0.809017 -0.309017 0.5
0.809017 0.309017 -0.5
0.809017 -0.309017 -0.5
0.309017 0.5 -0.809017
-0.309017 0.5 -0.809017
0 0 -1
-0.309017 -0.5 -0.809017
0.309017 -0.5 -0.809017
0.5 -0.809017 -0.309017
0 -1 0
0.5 -0.809017 0.309017
-0.5 -0.809017 -0.309017
-0.5 -0.809017 0.309017
-0.809017 -0.309017 0.5
-0.309017 -0.5 0.809017
0.309017 -0.5 0.809017
-1 0 0
-0.809017 -0.309017 -0.5
-0.809017 0.309017 -0.5
3 0 12 14
3 4 13 12
3 1 14 13
3 12 13 14
3 0 15 12
3 9 16 15
3 4 12 16
3 15 16 12
3 9 17 16
3 5 18 17
3 4 16 18
3 17 18 16
3 4 18 20
3 5 19 18
3 8 20 19
3 18 19 20
3 4 20 13
3 8 21 20
3 1 13 21
3 20 21 13
3 8 22 21
3 10 23 22
3 1 21 23
3 22 23 21
3 8 24 22
3 3 25 24
3 10 22 25
3 24 25 22
3 5 26 19
3 3 24 26
3 8 19 24
3 26 24 19
3 5 27 26
3 2 28 27
3 3 26 28
3 27 28 26
3 2 29 28
3 7 30 29
3 3 28 30
3 29 30 28
3 7 31 30
3 10 25 31
3 3 30 25
3 31 25 30
3 7 32 31
3 6 33 32
3 10 31 33
3 32 33 31
3 7 34 32
3 11 35 34
3 6 32 35
3 34 35 32
3 11 36 35
3 0 37 36
3 6 35 37
3 36 37 35
3 0 14 37
3 1 38 14
3 6 37 38
3 14 38 37
3 6 38 33
3 1 23 38
3 10 33 23
3 38 23 33
3 9 15 39
3 0 36 15
3 11 39 36
3 15 36 39
3 9 39 41
3 11 40 39
3 2 41 40
3 39 40 41
3 9 41 17
3 2 27 41
3 5 17 27
3 41 27 17
3 7 29 34
3 2 40 29
3 11 34 40
3 29 40 34



Archive powered by MHonArc 2.6.16.

Top of Page