I don't very content with current method.So a better solution is expected still.I hope it meet two conditions in following.
- That space is approximately equivalence.
- We can control how many points to produce.
v11.1 provides a new function SpherePoints
. As the Details
SpherePoints[n]
gives exactly equally spaced points in certain cases for smalln
. In other cases, it places points so they are approximately equally spaced.
Can we achieve the same goal i.e. approximately equally spaced points in an arbitrary 2D Region?
The following is my attempt based on Union
:
SeedRandom[1]
region = ConvexHullMesh[RandomReal[1, {100, 2}]];
UniformPts =
Union[RandomPoint[region, 50000],
SameTest -> (EuclideanDistance[#1, #2] < .1 &)];
Show[region, Graphics[Point[UniformPts]]]
Nevertheless, this approach has two weakness: