A friend of mine is pretty much obsessed with papercraft. Over the years he has built many beautiful models and I really like the aesthetic of this white, minimalistic and precisely folded paper geometries. He always starts by modeling them first in Blender and when he’s satisfied with the shape he uses Pepakura to unfold it to a plane so that he can actually build it out of paper. Pepakura is a simple yet powerful small program and can unfold pretty much everything into a foldable pattern. I found it quite fascinating and so I thought it might be a good idea trying to implement something like this in Houdini. Not that I’m building much paper models but nevertheless it’s sometimes useful to unfold meshes. After some research and several tests it turned out to be actually quite easy. And after some more test I finally implemented a simple version of an unfolding algorithm in VEX. Basically it works as follows:

Build the dual graph of the mesh

Calculate a spanning tree to minimize cuts and prevent faces from overlapping

Thank you so much for this blog. So many interesting topics and it’s really helpful to see these advanced algorithms broken down to be more understandable!

I’ve implemented a basic version of the unfolder but found that a simple spanning tree results in a lot of overlaps. Any hints on constructing a better tree?

I’ve found that a good heuristic for constructing the spanning tree is to use the dihedral angles of the primal mesh. You can apply it as a weighting function to compute the trees with the smallest but positive added up angles. I usually start to construct the tree from the largest polygon in the mesh. If there’s a problem with overlapping polys, the algorithms starts iterating over the mesh. The spanning tree is then computed from the second largest poly and so on. This might not be blazingly fast but usually it works surprisingly well. The general problem is rather that not every mesh can be unfolded to a single connected piece without overlaps …

thanks a lot for this informative blog.
may you -please- share a hip file for this unfolding effect; I can’t figure out how to build the vex code for unfolding the mesh.

Thank you so much for this blog. So many interesting topics and it’s really helpful to see these advanced algorithms broken down to be more understandable!

I’ve implemented a basic version of the unfolder but found that a simple spanning tree results in a lot of overlaps. Any hints on constructing a better tree?

LikeLike

Thanks!

I’ve found that a good heuristic for constructing the spanning tree is to use the dihedral angles of the primal mesh. You can apply it as a weighting function to compute the trees with the smallest but positive added up angles. I usually start to construct the tree from the largest polygon in the mesh. If there’s a problem with overlapping polys, the algorithms starts iterating over the mesh. The spanning tree is then computed from the second largest poly and so on. This might not be blazingly fast but usually it works surprisingly well. The general problem is rather that not every mesh can be unfolded to a single connected piece without overlaps …

LikeLike

thanks a lot for this informative blog.

may you -please- share a hip file for this unfolding effect; I can’t figure out how to build the vex code for unfolding the mesh.

LikeLike