meshing of a circle does not work correctly except for unit circles
Issue #72
resolved
It seems that there is a major bug in the CSG. The following code
from mshr import *
mesh = generate_mesh(Circle(Point(0, 0), 0.05), 10)
generates a triangle instead of circle.
mesh = generate_mesh(Circle(Point(0, 0), 0.1), 10)
generates a hexgon instead of circle.
It seems that something was hard coded so that the Circle representation only works for unit circles.
Comments (3)
-
reporter -
Thanks for reporting. You are almost right.
The algorithm currently does two passes, first with
segment_granularity
set to 0.1, to attempt to estimate the size of the geometry. Then it reruns it withsegment_granularity
computed based on the first run. This is a quick hack and it doesn't work at all in your case. I'll fix it properly. -
- changed status to resolved
Fixed in the latest release of FeniCS
- Log in to comment
I found that the bug is in include/mshr/CSGCGALDomain2D.h
The default
segment_granularity
is set to 0.1, without considering the radius of the circle. It affects the computation ofnum_segments
inmake_circle
andmake_ellipse
in src/CSGCGALDomain2D.h