# Paperfold ## About Paperfold is another flattener for triangle mesh files, heavily based on [https://github.com/felixfeliz/paperfoldmodels](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](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** ```bash sudo apt install cmake sudo apt install g++ sudo apt install python3-dev pip3 install openmesh ``` **Fedora** ```bash sudo dnf install cmake sudo dnf install g++ sudo dnf install python3-devel pip3 install cmake pip3 install pybind11 pip3 install openmesh ``` **Windows** 1. Windows **requires** [CMake executable](https://cmake.org/download/) 2. 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](https://gitlab.vci.rwth-aachen.de:9000/OpenMesh/OpenMesh) 3. Install openmesh bindings ```bash pip3 install openmesh ``` ## How it works The algorithm of paperfoldmodels consists of three steps: 1. Find a minimum spanning tree of the dual graph of the mesh. 2. Unfold the dual graph. 3. 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](https://geom.ivd.kit.edu/downloads/proj-paper-models_cut_out_sheets.pdf)).

Please also have a look at [DXF 2 Papercraft](https://wiki.stadtfabrikanten.org/books/fablab-chemnitz-boxespapercraft/page/dxf-2-papercraft "DXF 2 Papercraft") and [Papercraft Unfold](https://wiki.stadtfabrikanten.org/books/fablab-chemnitz-boxespapercraft/page/papercraft-unfold "Papercraft Unfold").

[![grafik.png](https://wiki.stadtfabrikanten.org/uploads/images/gallery/2025-05/scaled-1680-/vPx3dmjkoIovKK0v-grafik.png)](https://wiki.stadtfabrikanten.org/uploads/images/gallery/2025-05/vPx3dmjkoIovKK0v-grafik.png) [![grafik.png](https://wiki.stadtfabrikanten.org/uploads/images/gallery/2025-05/scaled-1680-/uFR6ALlGDHWbE5gY-grafik.png)](https://wiki.stadtfabrikanten.org/uploads/images/gallery/2025-05/uFR6ALlGDHWbE5gY-grafik.png) ## Example with a Ruby model file [https://www.thingiverse.com/thing:1315127/files](https://www.thingiverse.com/thing:1315127/files)
**STL preview****Unwrapped by Paperfold**
[![grafik.png](https://wiki.stadtfabrikanten.org/uploads/images/gallery/2025-05/scaled-1680-/qbGhmKpXEwMMDYPZ-grafik.png)](https://wiki.stadtfabrikanten.org/uploads/images/gallery/2025-05/qbGhmKpXEwMMDYPZ-grafik.png)[![grafik.png](https://wiki.stadtfabrikanten.org/uploads/images/gallery/2025-05/scaled-1680-/a6nkH6mjsDxcS9Lu-grafik.png)](https://wiki.stadtfabrikanten.org/uploads/images/gallery/2025-05/a6nkH6mjsDxcS9Lu-grafik.png)
[![grafik.png](https://wiki.stadtfabrikanten.org/uploads/images/gallery/2025-05/scaled-1680-/i5a798ZmoVczgakk-grafik.png)](https://wiki.stadtfabrikanten.org/uploads/images/gallery/2025-05/i5a798ZmoVczgakk-grafik.png) [![grafik.png](https://wiki.stadtfabrikanten.org/uploads/images/gallery/2025-05/scaled-1680-/xhFg3qUM34pb2r5i-grafik.png)](https://wiki.stadtfabrikanten.org/uploads/images/gallery/2025-05/xhFg3qUM34pb2r5i-grafik.png)
## 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)[![grafik.png](https://wiki.stadtfabrikanten.org/uploads/images/gallery/2025-05/scaled-1680-/imkK0ICFlHoxVJHX-grafik.png)](https://wiki.stadtfabrikanten.org/uploads/images/gallery/2025-05/imkK0ICFlHoxVJHX-grafik.png) [![grafik.png](https://wiki.stadtfabrikanten.org/uploads/images/gallery/2025-05/scaled-1680-/jZSnwE6SpRUnjicI-grafik.png)](https://wiki.stadtfabrikanten.org/uploads/images/gallery/2025-05/jZSnwE6SpRUnjicI-grafik.png)
Unfolding[![grafik.png](https://wiki.stadtfabrikanten.org/uploads/images/gallery/2025-05/scaled-1680-/6md1MZGlm1qixtID-grafik.png)](https://wiki.stadtfabrikanten.org/uploads/images/gallery/2025-05/6md1MZGlm1qixtID-grafik.png) [![grafik.png](https://wiki.stadtfabrikanten.org/uploads/images/gallery/2025-05/scaled-1680-/CdHDdpcx9VQiJzEy-grafik.png)](https://wiki.stadtfabrikanten.org/uploads/images/gallery/2025-05/CdHDdpcx9VQiJzEy-grafik.png)
## Hot tips - Add some joints to your paperfold using Joinery - [https://clementzheng.github.io/joinery](https://clementzheng.github.io/joinery/) - [https://www.instructables.com/Joinery-Joints-for-Laser-Cut-Assemblies](https://www.instructables.com/Joinery-Joints-for-Laser-Cut-Assemblies/) - ...or add tabs using [Tab Generator](https://wiki.stadtfabrikanten.org/books/fablab-chemnitz-boxespapercraft/page/tab-generator "Tab Generator") - Simulate using Origami Simulator - [https://origamisimulator.org](https://origamisimulator.org/) - [https://github.com/amandaghassaei/OrigamiSimulator](https://github.com/amandaghassaei/OrigamiSimulator) - generate cool model files from more complex 3d models using a vertice reducing tool: - [https://github.com/ipepe/3dless-com](https://github.com/ipepe/3dless-com) [![grafik.png](https://wiki.stadtfabrikanten.org/uploads/images/gallery/2025-05/scaled-1680-/dKl1KQb73mL9cl9a-grafik.png)](https://wiki.stadtfabrikanten.org/uploads/images/gallery/2025-05/dKl1KQb73mL9cl9a-grafik.png) [![grafik.png](https://wiki.stadtfabrikanten.org/uploads/images/gallery/2025-05/scaled-1680-/uw2gqROubQv5Qbph-grafik.png)](https://wiki.stadtfabrikanten.org/uploads/images/gallery/2025-05/uw2gqROubQv5Qbph-grafik.png)