Question

I have an ordered list of vertices in 3D, that form a polygon.

I'm looking to project these onto a 2D plane (as a way to triangulate and then calculate the area of them).

I'm not entirely sure how to go about doing this though, anyone have any suggestions?

Edit:

I've clarified the title to the real problem I had and posted the fairly specific solution that I used. It might come in helpful to someone at some point, even if it is a bit niche.

Was it helpful?

Solution

The solution I eventually went with, which is far from optimal, but it might help some people:

  1. Begin by taking an axis aligned bounding box of the polygon you're working with (this is simple done by taking the maximum and minimum of each x, y and z value for the pointset you have).

  2. Project the points you have onto each of the 3 axes, the planes of which you can get from your bounding box. For help with projecting I recommend this: Projecting to a plane

  3. From here, we now have 3 two dimensional polygons. Check if they are convex, which can be done by taking the dot product of every corner in the polygon, normalising it, and comparing it the others, if they're not all the same , it's not convex.

  4. If any of them are convex, pick one and triangulate it (I used Triangle.NET). The indices of the points you get out of that will correspond to your original points, giving you a functional triangulation.

Notes:

This isn't ideal, it doesn't always work (although it will in a lot of cases). In particular if the polygon overlaps with itself.

A more suitable but still not ideal method would be the minimum bounding box, but that's a lot more complicated to work out.

OTHER TIPS

While this is not immediately obvious, the total surface vector is fully specified by the polygonal loop. Simply choose a point K, preferably inside the convex hull of your polygon vertices (not actually necessary! but it helps suppress roundoff errors), and generate a triangulation using K as the hub. The sum of the individual face vectors doesn't depend upon the choice of K. To project to a plane to generate an actual triangulated surface, you can use F to define that plane.

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