6
$\begingroup$

I'd like to generate a mesh with a big variance in cell size. Something like

enter image description here

I'd prefer not to rely on a vertex model and perhaps use something simpler, like VoronoiMesh. Any ideas?

Further comments: I'd simply like to get a mesh-type object with varying cell sizes and similar to the picture above. Not much else is required. When using VoronoiMesh I might need to tweak the distribution of the random points in order to better mimic the image. Simply using VoronoiMesh[RandomReal[1, {300, 2}]], for example, is not "diverse enough". I've also heard of weighted Voronoi tessellations, but I want to keep the polygon-shaped mesh. A clustering distribution of points, with multiple clusters, should do the trick, but I'm not sure how to do it.

$\endgroup$
2
  • $\begingroup$ Can you provide more details? What is the issue with VoronoiMesh? Do you want the colors? What is it in particular you are trying to do? $\endgroup$
    – bRost03
    Jun 30 at 16:22
  • $\begingroup$ @bRost03 I've edited the question to add some details. No color needed. $\endgroup$
    – sam wolfe
    Jun 30 at 16:29
7
$\begingroup$

You can get clustered points from a random point process and then relax the Voronoi mesh. The final mesh is the variable relaxed:

SeedRandom[123];
proc = CauchyPointProcess[15, 35, 0.005, 2];
data = RandomPointConfiguration[proc, Rectangle[]];
bounds = {{0, 1}, {0, 1}};
mesh = VoronoiMesh[data["Points"], {{0, 1}, {0, 1}}];
relaxed = Nest[VoronoiMesh[Mean @@@ MeshPrimitives[#, 2], bounds] &, mesh, 5];
Graphics[Table[{RandomColor[], p}, {p, MeshPrimitives[relaxed, 2]}]]

voronoi with clusters

$\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.