Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top