一种算法充气/放气(偏移,缓冲)多边形多边形、算法、放气

2023-09-10 22:25:42 作者:干你老娘做你爹i

更新:数学术语,我要找的是真正的向内/向外多边形抵减。 +1巴林特指出这一点。另一种命名为多边形缓冲

UPDATE: the math term for what I'm looking for is actually inward/outward polygon offseting. +1 to balint for pointing this out. The alternative naming is polygon buffering.

更新2 (02.11.2011):检查出新接受的答案 - 帆船库由安格斯约翰逊

UPDATE 2 (02.11.2011): check out the newly accepted answer - Clipper library by Angus Johnson.

在我开始从头开始开发自己的解决方案,没有人知道任何好的来源的算法,可以充气多边形,类似这样:

Before I start developing my own solution from scratch, does anyone know of any good source for an algorithm that can inflate a polygon, something similar to this:

要求是新(充气)多边形的边/点都在从旧的(原)多边形的(在这个例子PIC相同的恒定距离。他们都没有,因为那就必须使用弧形的充气顶点,但让我们忘记了现在;))。

The requirement is that the new (inflated) polygon's edges/points are all at the same constant distance from the old (original) polygon's (on the example pic. they are not, since then it would have to use arcs for inflated vertices, but let's forget about that for now ;) ).

我的搜索结果:

下面是一些链接:

在多边形抵减策略 调查 Polygon偏移,问题 缓冲多边形数据 A Survey of Polygon Offseting Strategies Polygon offset, PROBLEM Buffering Polygon Data

推荐答案

据我所知,这个问题被问与提供的答案和前接受了一些时间。不过我想我可能会提一提我自己的多边形裁剪和抵消库 - 快船 - 万一别人还在寻找一个解决这个问题。

I understand that this question was asked with an answer provided and accepted some time ago. Nevertheless I thought I might briefly mention my own polygon clipping and offsetting library - Clipper - in case others are still searching for a solution to this problem.

虽然剪的主要设计用于多边形裁剪操作,它确实多边形抵消了。图书馆是开源免费软件写在的Delphi,C ++和C#。它具有非常支配升压的许可证允许它在两个不收费免费软件和商业应用中使用。

While Clipper is primarily designed for polygon clipping operations, it does polygon offsetting too. The library is open source freeware written in Delp C++ and C#. It has a very unencumbered Boost license allowing it to be used in both freeware and commercial applications without charge.

多边形抵消可使用三个中的一个偏移方式进行 - 方形,圆形,斜接

Polygon offsetting can be performed using one of three offset styles - squared, round and mitered.