如何用另一个切割多边形? [英] How to cut a polygon with another one?

查看:105
本文介绍了如何用另一个切割多边形?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以帮助我吗?

我想再切一个多边形...
你知道算法吗?

谢谢大家.

Can someone help me?

I want to cut a polygon with another one...
Do you know an algorithm?

Thank you all.

推荐答案



我会给你一个大概的想法.顺便说一句,这是我自己的想法,并不涉及任何现有的流行算法.

当取两个相交的多边形时,另一个多边形内必须有一些节点(点).因此,在循环中使用多边形算法中的点找到内部的点.因此,让我们说一个多边形内的点,下一个节点在该多边形外,那么它必须与另一个多边形的顶点相交.找到相交点并重新排列点顺序以创建新的相交多边形.希望这会有所帮助.如果您觉得有道理,我将尝试编写一些编码.
Hi,

I will give you a rough idea how it could be. By the way it is my own idea and not referring to any existing popular algorithm.

When take two polygons which intersects there are some node (point) must be inside the other polygon. So on a loop find the point inside using the point in polygon algorithm. So let us say a point inside a polygon and the next node is outside the polygon then it must be intersecting the vertex of another polygon. Find the intersection points and rearrange the point order to create the new intersected polygon. Hope this would helps. If you feel it make sense I will try to write some coding.


这篇关于如何用另一个切割多边形?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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