一种用于膨胀/放气(偏移、缓冲)多边形的算法 [英] An algorithm for inflating/deflating (offsetting, buffering) polygons

查看:11
本文介绍了一种用于膨胀/放气(偏移、缓冲)多边形的算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将如何膨胀"?多边形?也就是说,我想做类似这样的事情:

How would I "inflate" a polygon? That is, I want to do something similar to this:

要求是新的(膨胀的)多边形的边缘/点与旧的(原始)多边形的距离相同(在示例图片上它们不是,因为那时它必须使用弧来膨胀顶点,但让我们暂时忘掉它;)).

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 picture they are not, since then it would have to use arcs for inflated vertices, but let's forget about that for now ;) ).

我正在寻找的数学术语实际上是向内/向外的多边形偏移.+1 balint 指出这一点.替代命名是多边形缓冲.

The mathematical 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.

我的搜索结果:

这里有一些链接:

推荐答案

我想我可以简单提一下我自己的多边形裁剪和偏移库 - Clipper.

I thought I might briefly mention my own polygon clipping and offsetting library - Clipper.

虽然 Clipper 主要是为多边形裁剪操作而设计的,但它也可以进行多边形偏移.该库是用 Delphi、C++ 和 C# 编写的开源免费软件.它有一个非常不受限制的 Boost 许可证,可以免费用于免费软件和商业应用程序.

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.

这篇关于一种用于膨胀/放气(偏移、缓冲)多边形的算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆