1
$\begingroup$

Problem

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

Mesh

Question

How does one control the mesh resolution in this case?

$\endgroup$
3
  • $\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$ Commented Jul 13, 2020 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$ Commented Jul 14, 2020 at 1:16
  • $\begingroup$ MeshTools package can help you to precisely control the number of elements / mesh size. See the function HexahedronMesh. $\endgroup$ Commented Jul 14, 2020 at 20:03

1 Answer 1

2
$\begingroup$

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.

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

enter image description here

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.