问题
User Requiremnts
Inputs
- User will give boundary points of the closed polygon P in which he wants to fill the area formed by polygon. Red Points P in the Examples.
- Space S in between the lines. Spacing S between the lines of Green points in Examples.
Output
The output will be a closed polygon points. Green G points in the Examples.
Can someone help me, i don't know which algorithm to use.
回答1:
The example looks like it was created like this:
- Create a field of hexagonally packed spots with the desired spacing;
- Select the spots that are inside the red shape;
- Imagine an edge with a random weight between each pair of adjacent spots (each spot will have up to 6 neighbours), and connect them into a minimum weight spanning tree using Kruskal's or Prim's algorithm (all that is googlable);
- trace around the resulting tree
来源:https://stackoverflow.com/questions/61026366/fill-the-area-with-uniform-spacing