🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Unproject 3D shape so you can print it n paper and cut it out with scissors

Started by
1 comment, last by JoeJ 4 years, 2 months ago

Imagine this i would like to somehow project the top curvy surface onto a 2D plane (lets assume its a 0,1,0 surf (a piece of paper) so i could print it on the printer and cut the shape off and bend it to original curve.

Simple projection of all verts wont work cause it wont preserve original size

Advertisement

It's pretty simple:

Traverse the triangles of the mesh with any floodfill, shortest ptahs, or spanning tree algorithm. (Important is to go from a triangle to another adjacent triangle but crossing every each only once, until all triangles have been visited.)

During this process create a 2D mesh on the plane, preserving triangle shapes (so same edge lengths and angles). Add adjacent triangles at the traversed edge. You end up with an unfolded mesh with many open edges that need to be glued together to make it back 3D from paper.

Imagine a cube, you would end up for example with the typical cross shape we know from cube map textures. The whole process is indeed equivalent to UV unwrapping, but you are not allowed to skew / distort triangles to reduce the number of open boundary edges.

With more complex shapes you also will get overlaps on the plane, so you need to cut your 2D mesh into multiple pieces to resolve overlaps. Just glue multiple pieces together afterwards from paper. Multiple pieces is unavoidable for any mesh that has genus > 1. (meaning more holes than one - a tours has genus one so one hole, and you can unwarp it without overlaps and the 2D mesh is one single connected surface.)

If you want the optimal solution, minimizing overlaps, number of open edges, or area of required paper, it becomes an NP hard problem. So optimal is not possible, but you'll get good results from greedy algorithms. E.g.: https://www.cs.cmu.edu/~kmcrane/Projects/LoopsOnSurfaces/

This topic is closed to new replies.

Advertisement