First, generate a batch of random points using RandomPointsBuilder. As is well known, this produces a very "lumpy" distribution of points:
Then, put them in a KD-Tree using a snapping distance tolerance. Querying all points in the final tree produces a nice even distribution of points:
Using the Concave Hull algorithm available here with the same distance tolerance produces a random polygon with a very pleasing appearance:
I suspect that these kinds of polygons might be useful for generating stress tests for geometric algorithms.
UPDATE: Adding a bit of Bezier Smoothing produces an even cooler-looking polygon:
No comments:
Post a Comment