meshpro / pygalmesh

:spider_web: A Python interface to CGAL's meshing tools
GNU General Public License v3.0
580 stars 57 forks source link

Cylinder geometry fails to mesh #173

Open mark-dostalik opened 2 years ago

mark-dostalik commented 2 years ago

The following minimal code example:

import pygalmesh

cylinder = pygalmesh.Cylinder(-1, 1, 0.7, 0.1)
mesh = pygalmesh.generate_mesh(cylinder)

fails with:

File "/home/username/.local/lib/python3.9/site-packages/pygalmesh/main.py", line 107, in generate_mesh
    _generate_mesh(
RuntimeError: CGAL ERROR: assertion violation!
File: /usr/include/CGAL/Mesh_3/Protect_edges_sizing_field.h
Line: 453
Explanation: Error: the sizing field is null at point (0.69999999999999996 0 -1)
nschloe commented 2 years ago

Thanks for the report. You'll have to set

max_edge_size_at_feature_edges=0.4

Fixing this is too hard without better criteria setting in CGAL, see https://github.com/CGAL/cgal/issues/5044.