On the sphere, it is easy to control the resolution of the mesh in DiscretizeGraphics using the MaxCellMeasure attributes of Length and Area.

But these tricks do not seem to work on the cuboid. For example, varying the length from 1000 to 0.001 produces this same mesh.

DiscretizeGraphics[Graphics3D[Cuboid[{0, 0, 0}, {50, 3, 4}]], MaxCellMeasure -> {"Length" -> 10.0}]



How does one control the mesh resolution in this case?

  • $\begingroup$ Is there a reason not to use DiscretizeRegion since both return a MeshRegion? Something like DiscretizeRegion[Cuboid[{0, 0, 0}, {50, 3, 4}], MaxCellMeasure -> {"Length" -> 10.0}]. $\endgroup$ – Tim Laska Jul 13 '20 at 23:56
  • $\begingroup$ @Tim Laska: This is a great start. The length decreases as expected until 3, then at 2, the mesh reverts. Can you address this and post your comment as an answer so it can be selected? $\endgroup$ – dantopa Jul 14 '20 at 1:16
  • $\begingroup$ MeshTools package can help you to precisely control the number of elements / mesh size. See the function HexahedronMesh. $\endgroup$ – Pinti Jul 14 '20 at 20:03

Both DiscretizeGraphics and DiscretizeRegion return a MeshRegion. DiscretizeRegion is more precise.

A mesh level of "2" does not appear to work because the thickness of the lines are too faint. One can use HighlightMesh to see the discretization more clearly.

   DiscretizeRegion[Cuboid[{0, 0, 0}, {50, 3, 4}], 
    MaxCellMeasure -> {"Length" -> #}], Style[1, Red]] & /@ 
 Range[2, 10]

enter image description here


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.