构造多边形的轮廓(特别是三角剖分)
我将如何构建仅由三角形组成的二维多边形的轮廓,它可以有孔,外部轮廓可以是凹/凸的,孔也可以是凹/凸的。
从我在这里读到来看,这似乎正是三角测量问题的反演。 您知道有哪些文章可以解决此类问题吗?
八叉树/四叉树与此相关吗?
How would I go about constructing the contour of 2d polygon which is formed of only triangles and it can have holes and the external contour can be concave/convex and the holes can also be concave/convex.
From what I'm reading over here it seems that It's exactly the inverse of the triangulation problem.
Do you know any articles treating this type of problem?
Are octrees/quadtrees relevant to this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我猜您拥有三个点集形式的数据,这三个点构成了一个“填充”三角形,这些三角形沿边相邻,并且将成为完整形状的角的所有顶点也是所有三角形的顶点触及这一点。 然后,您只需找到所有未加倍的边,即不属于两个相邻三角形的边。
I guess that you have data in the form of sets of three points, which constitute a "filled" triangle, that these triangles are adjoined along edges, and that all vertices that will be corners of the complete shape are also vertices of all the triangles that touch this point. You would then just have to find all edges that are not doubled, i.e. do not belong to two adjoined triangles.
我认为您可以通过创建一个拓扑数据结构来表示三角形集,然后使用该结构按顺序迭代位于边界上的三角形边来解决您的问题。
例如:您可以创建半边数据结构。 假设您甚至在边界上插入半边(正确),则迭代边界轮廓就像在边界上定位一个半边一样简单,然后迭代它的“下一个”指针,直到回到开始的半边。
与半边类似,您可以使用其他拓扑结构,例如翼边等,但概念是相同的。
I think you can solve your problem by creating a topological data structure to represent your set of triangles, and then using that structure to iterate in order over the triangle edges that lie on the boundary.
For example: you can create a halfedge data structure. Assuming you insert halfedges even on the boundary (correctly), iterating over the boundary contour is as simple as locating one halfedge on the boundary and then iterating over it's "next" pointer until you get back to the halfedge you started from.
Similarly to halfedges, you can use other topological structures like winged-edge, etc., but the concept is the same.
这是在三角形网格上运行的实现,查找并连接所有非双边,如此答案中所述。
Here is an implementation operating on a triangle-mesh, finding and connecting all non-doubled edges as explained also in this answer.