多边形添加算法
我想做以下事情:我在 3D 空间中有一些面作为多边形。我有一个投影方向和一个投影平面。我在投影平面上有一个凸裁剪多边形。我想要得到一个代表平面上所有面的阴影的多边形。
到目前为止我所做的:我将面的投影计算为投影平面中的多边形。
我可以使用 Sutherland–Hodgman 算法来裁剪所有单个投影多边形,以裁剪到所需的区域。
现在我的问题是:如何将投影(可能被剪切)的多边形组合在一起?我必须使用像 Margalit/Knott 这样的算法吗?
该算法应该非常高效,因为它必须经常运行。那么你认为什么算法呢?
是否可以修改 Sutherland-Hodgman 算法来解决合并问题?
I want to do the following: I have some faces in the 3D space as polygons. I have a projection direction and a projection plane. I have a convex clipping polygon in the projection plane. I wnat to get a polygon representing the shaddow of all the faces clipped on the plane.
What I do till now: I calculate the projections of the faces as polygons in the projection plane.
I could use the Sutherland–Hodgman algorithm to clip all the singe projected polygons to clip to the desired area.
Now my question: How can I combine the projected (maybe clipped) polygons together? Do I have to use algorithms like Margalit/Knott?
The algorithm should be quite efficient because it has to run quite often. So what algorithm do you suppose?
Is it maybe possible to modify the algorithm of Sutherland–Hodgman to solve the merging problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我目前正在使用 Bentley–Ottmann 实现此算法(n 个凹多边形的并集)来查找所有边缘交叉点,同时跟踪边缘段两侧的多边形嵌套级别(线的每侧有多少个重叠多边形接触) )。一侧嵌套级别为 0 的边将输出到结果多边形。要把事情做好是相当困难的。具有不同算法设计的现有解决方案可以在以下位置找到:
http://sourceforge.net/projects/polyclipping/< /a>
I'm currently implementing this algorithm (union of n concave polygons) using Bentley–Ottmann to find all edge intersections and meanwhile keeping track of the polygon nesting level on both sides of edge segments (how many overlapping polygons each side of the line is touching). Edges that have a nesting level of 0 on one side are output to the result polygon. It's fairly tricky to get done right. An existing solution with a different algorithm design can be found at:
http://sourceforge.net/projects/polyclipping/