CGAL / cgal

The public CGAL repository, see the README below
https://github.com/CGAL/cgal#readme
Other
4.87k stars 1.38k forks source link

Polyhedron demo: runtime bug in the mesh_3_plugin #2284

Closed lrineau closed 7 years ago

lrineau commented 7 years ago

(reported by @afabri)

Issue Details

With master, current hash ac93217d2bb8158f362860d20aa6b125730a5ef8, open the file anchor.off with the polyhedron demo, and try to get a Mesh_3 mesh with default parameters (either volumic of surfacic), and the mesher crashes in the initialization step (sampling protecting balls on sharp features).

terminate called after throwing an instance of 'CGAL::Assertion_exception'
  what():  CGAL ERROR: assertion violation!
Expr: n==0 || dleft_frac >= float_prior(float_prior(1.))
File: /home/lrineau/Git/other-cgal2/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h
Line: 1135
zsh: abort (core dumped)  Polyhedron_3 ~/Git/cgal/Polyhedron/demo/Polyhedron/data/anchor.off

I have tried to run the example examples/Mesh_3/mesh_polyhedral_domain_with_features.cpp with the same mesh parameters, with the following patch:

diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features.cpp
index 9df6bf2..9121c6e 100644
--- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features.cpp
+++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features.cpp
@@ -54,9 +54,9 @@ int main(int argc, char*argv[])
   domain.detect_features();

   // 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 = 0.07200,
+                         facet_angle = 25, facet_size = 0.07200, facet_distance = 0.007200,
+                         cell_radius_edge_ratio = 3, cell_size = 0.07200);

   // Mesh generation
   C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria);

and it ran without errors and produced a correct mesh. So the error is in the specific code used by the demo.

Environment

lrineau commented 7 years ago

This bug was already in CGAL-4.10. I reassign the issue to 4.10.1.