12
$\begingroup$

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.

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

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

$\endgroup$
  • $\begingroup$ 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. $\endgroup$ – Michael E2 Aug 5 '14 at 12:26
  • $\begingroup$ @MichaelE2, That's an interesting find. So basically, One has to discretize the result of DiscretizedRegion to see the effect. That makes no sense. $\endgroup$ – RunnyKine Aug 5 '14 at 15:20
  • $\begingroup$ @MichaelE2, This bug is also present in DiscretizeGraphics and has been sort-of confirmed by @user21. $\endgroup$ – RunnyKine Aug 5 '14 at 15:21
  • $\begingroup$ Well, this is a bug (or lack of implementation?) and by all means, you should report this. $\endgroup$ – user21 Aug 6 '14 at 7:17
  • $\begingroup$ @user21, I already reported it and linked to this page. $\endgroup$ – RunnyKine Aug 6 '14 at 7:27
1
$\begingroup$

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

Mathematica graphics

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.