Search code examples
math3dgeometryprojection

2D outline algorithm for projected 3D mesh


Given: A 3D mesh defined with a set of vertices and triangles building up the mesh with these points.

Problem: Find the 2d outline of the projected arbitrarily rotated mesh on an arbitrary plane.

The projection is easy. The challenge lies in finding the "hull" of the projected triangle edges in the plane. I need some help with input/pointers on researching this algorithm. For simplicity, we can assume the 3D edges are projected straight down onto the xy plane.


Solution

    • Start with the rightmost point (the point with the biggest x coordinate)
    • Get all edges from this point
    • Follow the edge with the smallest angle to the positive x-axis, and also add it to the solution set
    • From the point reached, follow and add the edge with the smallest angle to the edge you came from
    • Repeat until you reach the original point