Skip to main content

computational geometry - Possible Bug in DiscretizeRegion with Option MaxCellMeasure


Bug introduced in 10.0.0 and fixed in 10.0.2




Consider the following ImplicitRegion:



reg = ImplicitRegion[x^2 + y^2 + z^2 == 16, {x, y, z}];

We can discretize it using DiscretizeRegion


dr = DiscretizeRegion[reg]

Mathematica graphics


To get finer triangles the option MaxCellMeasure is available, only it does nothing when used.


DiscretizeRegion[reg, MaxCellMeasure -> {"Area" -> #}] & /@ {0.1, 0.05}

Mathematica graphics



Of course using one of the Graphics primitives


DiscretizeRegion[Ball[], MaxCellMeasure -> {"Area" -> #}] & /@ {0.1, 0.05}

Mathematica graphics


You can see that it works fine. I'm on Windows 8.1, can anyone confirm this on other platforms? Confirmed on Linux via the Wolfram Programming Cloud.



Answer



Edit: Wolfram Technical Support has confirmed this as a bug


The only workaround I know is to turn the MeshRegion into a BoundaryMeshRegion and triangulate the resulting mesh object:


dr = DiscretizeRegion[reg, MaxCellMeasure -> {"Area" -> 0.05}];


Then:


TriangulateMesh[BoundaryMeshRegion[MeshCoordinates[dr], MeshCells[dr, 2]], 
MaxCellMeasure -> #] & /@ {0.1, 0.005}

Mathematica graphics


It seems like another workaround is to repeatedly apply DiscretizeRegion which is definitely a weird approach. ( Thanks to Michael E2 )


Rest @ NestList[DiscretizeRegion, reg, 2]

Mathematica graphics


Comments