格雷纳 - 霍曼削减与简并格雷

2023-09-11 05:16:44 作者:Passerby 过路人

我想明白纸任意多边形与简并的裁剪,由E.L。福斯特和JR Overfelt [1],号称通过处理简并的延长经典格雷纳 - 霍曼多边形裁剪算法。

I'm trying to understand the paper "Clipping of Arbitrary Polygons with Degeneracies" by E. L Foster and J. R. Overfelt [1], which claims to extend the classic Greiner-Hormann polygon clipping algorithm by handling of degeneracies.

不过,我遇到了与它们所描述的过程有些困难。考虑描绘如图6(c)的情况,并假设多边形被定向以相同的方式。开始从I5标记阶段(从I1反对,因为他们这样做):为主体的多边形​​S和裁剪多边形C,I5有previous和下一个标签(在上)。因此,根据表1,首先删除的交点标志(1),然后标记当前和相邻节点作为中/在(2)。这符合为例。接下来,I6有(输入/输出)为S,和(内/表)为C.表1说:恩/ EN(或EX / EX,尚不清楚是否$ P $光伏适用于列或行)。然后,表2表示,除去路口烯/恩和标签中(在/于presumably)[2]。但这个例子指出:恩/ EN,而不是中/中。

However, I ran into some difficulties with the procedure they describe. Consider the situation depicted on Figure 6(c) and suppose the polygons are oriented in the same way. Start the labeling phase from the I5 (as opposed from I1, as they do): for both subject polygon S and clipping polygon C, I5 has previous and next labels (on, on). Therefore, according to Table 1, first remove the intersection flag (1), then label current and neighbor nodes as "in/in" (2). This agrees with the Example. Next, I6 has (in/out) for S, and (in/on) for C. Table 1 says "en/en" (or "ex/ex", not clear whether "prev" applies to columns or rows). Then, Table 2 says, remove intersection "en/en" and label "in" (presumably "in/in") [2]. But the example states "ex/en", and not "in/in".

请,任何人都可以向我解释为什么会出现这种情况?如何在前/ EN到达?是否真的重要,我在那里开始的标签相?

Please, can anyone explain to me why is this happening? How to arrive at "ex/en"? Does it really matter, where I start the labeling phase?

[1] https://github.com/erichlf/PolyClipping /blob/master/Paper/PolyClip.pdf [2]他们也说入口/出口标志设置为等于previous节点的进入/退出的标志,这运气也恰好是中/中,但它不是很清楚怎么做的表2与此规则。

[1] https://github.com/erichlf/PolyClipping/blob/master/Paper/PolyClip.pdf [2] They also say "the entry/exit flag is set to be equal to the previous node’s entry/exit flag" which by luck also happens to be "in/in" but it is not very clear how does the Table 2 relates to this rule.

推荐答案

看来,这是本文的错误。标签根据表1先给EX / EX,然后根据表2将产生出输入/输出。我们去哪里IN - >上,甚至EX->上的情况下比在纸上的解释更为复杂。

It appears that this is a mistake in the paper. Labeling based on Table 1 would first give ex/ex and then based on table 2 would produce out/out. The case where we go in->on or even ex->on is more complicated than the explanation in the paper.

似乎工作将是什么,如果交集IN->办理入住手续的邻居,如果邻居没有在 - >上贴上标签电流作为邻居的对面。因此,在I6的情况下,我们将其标记为EX / EN。现在,如果我们有一个情况下,无论是邻居和电流分别为IN - >上,我们将要检查的下一个点的序列,即I2和S2研究。如果这两点的顺序上,然后删除此交汇和标签的(在中)。否则,标签应连接,如果这第二点是在和前如果下点了。

What appears to work would be if the intersection is in->on check the neighbor and if the neighbor is not in->on then label the current as the opposite of the neighbor. So in the case of I6 we would label it as ex/en. Now if we had a case where both the neighbor and current were in->on we would want to check the next point in the sequence, i.e. I2 and S2. If both points in the sequence are on then remove this intersection and label as (in,in). Otherwise the label should be en if this next point is in and ex if the next point is out.

在这里我们从输出>上的情况是相反的。

The case where we go from out->on would be the opposite.

我希望这回答了你的问题。

I hope this answers your question.

相关推荐