按百分比减少多边形面积 [英] Reduce polygon area by percentage
问题描述
我有一个由点(x,y)组成的多边形.我想做的是将其减少一个百分比. 请记住:我不想只是扩大规模.多边形应该具有一种可以切掉多边形的内部边界(宽度取决于百分比).
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?
输入:点数组,百分比
输出:点数组
推荐答案
您要查找的是偏移多边形.计算起来并不容易, 但是它已经被很好地研究了. 也许这个较早问题的答案可能会有所帮助: 通过偏移将多边形收缩到特定区域.
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.
这篇关于按百分比减少多边形面积的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!