Reduce polygon area by percentage

风格不统一 提交于 2019-12-11 01:47:43

问题


I have a polygon that consists of points (x,y). What I woul like to do is to reduce this by a percentage. Keep in mind: I dont want to just scale it. The polygon should get a kind of inner border (its width depends on the percentage) that gets cut off the polygon.

Who knows an algorithm that can achieve that?

Input: Array of Points, Percentage

Output: Array of Points


回答1:


What you seek is the offset polygon. It is not easy to compute, but it has been quite well-studied. Perhaps the answer to this earlier question could help: Shrink polygon to a specific area by offsetting.





来源:https://stackoverflow.com/questions/45727683/reduce-polygon-area-by-percentage

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