13
$\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$
5
  • $\begingroup$ Tip: you can test on Linux using wolframcloud.com $\endgroup$
    – Szabolcs
    Commented Aug 5, 2014 at 3:08
  • $\begingroup$ @Szabolcs, Thanks nice tip. But it's so painful using it :) $\endgroup$
    – RunnyKine
    Commented Aug 5, 2014 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
    Commented Aug 5, 2014 at 12:29
  • 1
    $\begingroup$ Have you reported it? $\endgroup$
    – Szabolcs
    Commented Aug 5, 2014 at 21:44
  • 1
    $\begingroup$ @Szabolcs. Yes. Hopefully more people will report it, since that'll get their attention. $\endgroup$
    – RunnyKine
    Commented Aug 5, 2014 at 21:53

2 Answers 2

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$
5
  • $\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
    Commented Aug 5, 2014 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
    Commented Aug 5, 2014 at 15:20
  • 1
    $\begingroup$ @MichaelE2, This bug is also present in DiscretizeGraphics and has been sort-of confirmed by @user21. $\endgroup$
    – RunnyKine
    Commented Aug 5, 2014 at 15:21
  • $\begingroup$ Well, this is a bug (or lack of implementation?) and by all means, you should report this. $\endgroup$
    – user21
    Commented Aug 6, 2014 at 7:17
  • $\begingroup$ @user21, I already reported it and linked to this page. $\endgroup$
    – RunnyKine
    Commented Aug 6, 2014 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$
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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