自相交多边形的面积 [英] Area of self-intersecting polygon

查看:2059
本文介绍了自相交多边形的面积的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个计算的简单的不规则的多边形是微不足道的区域。但是,考虑在显示的自交的多边形ABCDEF左下:

Calculating the area of a simple irregular polygon is trivial. However, consider the self-intersecting polygon ABCDEF shown at left below:

                   

                   

如果我们用链接到上述公式中的多边形为了穿越点,我们得到0的区域(在'顺时针'区域抵消了逆时针区域。)

If we use the linked-to formula above traversing the points in polygon order, we get an area of 0. (The 'clockwise' area cancels out the 'counter-clockwise' area.)

不过,如果我们排序点径向围绕一个中心并计算面积,我们得到不正确的多边形ABEDCF的面积正上方。

However, if we sort the points radially around a center and calculate the area, we get the incorrect area of the polygon ABEDCF at right above.

我怎样才能找到最好的自交的多边形的可见区域? (如果答案需要每个路口创建幻影点,请详细说明了如何最好地找到交叉点,以及如何然后遍历他们在正确的顺序。)

How can I best find the visible area of a self-intersecting polygon? (If the answer requires creating phantom points for each intersection, please provide details for how to best find the intersections and how then to traverse them in correct order.)

这个问题调查的边缘情况下,当为我解决了这个问题出现。

予定义区域作为使用「非零或EVENODD规则填充多边形的时可见象素的量。我会接受任何结果都不是回音,虽然双方会更好。请注意,我明确做的没有的定义区域自我重复计算的重叠面积的两倍。

I define the 'area' as the amount of pixels visible when filling the polygon using either the "nonzero" or "evenodd" rules. I will accept an answer for either of these, though both would be better. Note that I explicitly do not define the area for self-overlapping to count the overlapping area twice.

推荐答案

您可以尝试的宾利奥特曼与下面的伪$ C $从此页面

You can try Bentley–Ottmann with the following pseudo code from this page

这篇关于自相交多边形的面积的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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