Fill the area with uniform spacing

。_饼干妹妹 提交于 2020-07-22 05:47:07

问题


User Requiremnts

Inputs

  1. 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.
  2. 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:

  1. Create a field of hexagonally packed spots with the desired spacing;
  2. Select the spots that are inside the red shape;
  3. 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);
  4. trace around the resulting tree


来源:https://stackoverflow.com/questions/61026366/fill-the-area-with-uniform-spacing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!