Paperfold
About
Paperfold is another flattener for triangle mesh files, heavily based on https://github.com/felixfeliz/paperfoldmodels by Felix Scholz aka felixfeliz.
Possible input files are STL, Wavefront OBJ, PLY and OFF. (possible import file types with OpenMesh in principle: https://www.graphics.rwth-aachen.de/media/openmesh_static/Documentations/OpenMesh-8.0-Documentation/a04096.html)
Prepare to install openmesh
To run this extension you need to install OpenMesh bindings with python pip. When installing Paperfold by installing MighyScape, this will already be done for you on Linux systems. Else:
Ubuntu
sudo apt install cmake
sudo apt install g++
sudo apt install python3-dev
pip3 install openmesh
Fedora
sudo dnf install cmake
sudo dnf install g++
sudo dnf install python3-devel
pip3 install cmake
pip3 install pybind11
pip3 install openmesh
Windows
-
Windows requires CMake executable
-
Install MS Visual Studio Community Edition → If you receive an error like "NMake Makefiles does not support platform specification, but platform x64 was specified." In case the instalation fails you can also try to install precompiled Windows binaries from https://gitlab.vci.rwth-aachen.de:9000/OpenMesh/OpenMesh
-
Install openmesh bindings
pip3 install openmesh
How it works
The algorithm of paperfoldmodels consists of three steps:
- Find a minimum spanning tree of the dual graph of the mesh.
- Unfold the dual graph.
- Remove self-intersections by adding additional cuts along edges.
Reference: The code is mostly based on the algorithm presented in a by Straub and Prautzsch (https://geom.ivd.kit.edu/downloads/proj-paper-models_cut_out_sheets.pdf).
Please also have a look at DXF 2 Papercraft and Papercraft Unfold.
Example with a Ruby model file
https://www.thingiverse.com/thing:1315127/files
STL preview | Unwrapped by Paperfold |
![]() |
![]() |
Differences between poly facets and triangles
There is a great difference which comes fromt the input file. If you use polygonal input file, the unfolded mesh looks better because it has less useless folds and glue tab numbers. There is no algorithm to remove fold lines for coplanar adjacent triangles which form a polygon facet.
Triangle mesh file (model saved stl) | Polygonal facets (model saved as .obj) | |
3D mesh preview (Blender) | ||
Unfolding |
Hot tips
- Add some joints to your paperfold using Joinery
- ...or add tabs using Tab Generator
- Simulate using Origami Simulator
- generate cool model files from more complex 3d models using a vertice reducing tool:
Keine Kommentare