# 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]


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

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


Of course using one of the Graphics primitives

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


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.

• Tip: you can test on Linux using wolframcloud.com – Szabolcs Aug 5 '14 at 3:08
• @Szabolcs, Thanks nice tip. But it's so painful using it :) – RunnyKine Aug 5 '14 at 3:12
• Using the other quality control options, PrecisionGoal, AccuracyGoal,MeshQualityGoal, and MeshRefinementFunction on the ImplicitRegion similarly has no effect. – Michael E2 Aug 5 '14 at 12:29
• Have you reported it? – Szabolcs Aug 5 '14 at 21:44
• @Szabolcs. Yes. Hopefully more people will report it, since that'll get their attention. – RunnyKine Aug 5 '14 at 21:53

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}


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]


• DiscretizeRegion[dr, MaxCellMeasure -> {"Area" -> 0.01}] produces similar results. Note that the outer function (DiscretizeRegion or TriangulateMesh) subdivides a mesh region and does not attempt to approximate the implicit region. Perhaps someone will come along and let us know whether implicit regions can be approximated with arbitrary precision. – Michael E2 Aug 5 '14 at 12:26
• @MichaelE2, That's an interesting find. So basically, One has to discretize the result of DiscretizedRegion to see the effect. That makes no sense. – RunnyKine Aug 5 '14 at 15:20
• @MichaelE2, This bug is also present in DiscretizeGraphics and has been sort-of confirmed by @user21. – RunnyKine Aug 5 '14 at 15:21
• Well, this is a bug (or lack of implementation?) and by all means, you should report this. – user21 Aug 6 '14 at 7:17
• @user21, I already reported it and linked to this page. – RunnyKine Aug 6 '14 at 7:27

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

This is fixed in 10.0.2. on windows 7, 64 bit