Use Inkscape extensions to create 3D objects from paper
Paper Tiger
Papercraft is coming back into fashion. Linux users can turn to Inkscape and plugins such as Boxes.py, Paperfold, and Tabgen to create templates from 3D objects for printing.
Papercraft is an old form of crafting. It requires nothing more than scissors, paper, and a little glue. Architects use the technique to visualize models quickly and inexpensively, despite digital developments such as virtual reality. Driven by trends such as low-poly modeling and Minecraft, the technique is also experiencing a revival in the hobby sector. In some areas of the world – such as Japan, which has traditionally cultivated origami, another papercraft – there are now many creative people posting their work on the various social media platforms. In Japan, this form is called pepakura, and there is also a software tool of the same name for it.
Unfolding objects and displaying the individual sides as faces is also the basis for other crafts – they usually just require a different node definition for the individual nodes. The templates you need for this can be created with Inkscape in combination with extensions such as Boxes.py [1], Quickjoint [2], Lasercut tabbed box [3], and Paperfold [4]. The tools prepare the objects in such a way that they can be further processed in Joinery [5] without any problems.
More Than Just Boxes
Boxes.py is very interesting here, particularly because it comes with a variety of predefined objects – and by no means just simple boxes (Figure 1). For example, rendering a Raspberry Pi case is child's play. But more complex designs with curves and similar features are also available in Boxes.py, you just have to adapt them to your own needs. Pepakura [6] and other software tools for this work are only available for Windows, which forces Linux users to find other ways to indulge in their hobbies.
One option from the world of free software for designing 3D objects is Blender. Of course, it can do far more than is required for the task. For Papercraft, the 3D objects also need to be unfolded. This step is handled by a flattener, and there is even an add-in for Blender to match. But if you want to print the unfolded object later on and perhaps also decorate it with graphics, a program like Inkscape is more suitable.
There are many extensions for Inkscape for this kind of work. Often, however, these are not coordinated with the other extensions because each author has their own way of working or view of how to do things. One of the most important extensions of this kind is Paperfold. There is another extension from the same developer with similar functions, but the author considers Paperfold to be the better choice.
Unfolding with Paperfold
As usual with Inkscape, the Paperfold extension is installed by copying the appropriate files either to ~/.config/inkscape/extensions/
or to /usr/share/inkscape/extensions/
for a global installation. Download the paperfold_1zSsmQj.zip
file by pressing the down arrow on the project's website. For Paperfold to work, it requires OpenMesh and the appropriate Python bindings. You can use the commands in Listing 1 to install the packages on a Fedora system.
Listing 1
Installing OpenMesh
$ sudo dnf install OpenMesh cmake g++ python3-devel $ pip3 install pybind11 $ pip3 install openmesh
CMake and the GNU C++ compiler are required because the following commands not only download the appropriate bindings, but also adapt them to the installed version. The two pip3
commands from Listing 1 also work on other distributions. You will need to modify the first command there. After restarting Inkscape, Paperfold is available in Extensions | FabLab Chemnitz | Papercraft Flatteners | Paperfold (Figure 2).
To get started, it is best to choose a simple object because it takes a while to develop a feel for objects spread out onto surfaces. Paperfold expects either an OFF, OBJ, PLY, or STL file as the initial object. The number of allowed faces has to be adjusted in most cases. However, you should not set the value too high because this will push up your memory consumption. All other values can be safely enabled. They will help you later when you go about gluing the model.
The rendered object consists of grouped single objects, so you have to ungroup for editing. After ungrouping the first group, you will see more groups: One contains all the label elements, the other the paths. After ungrouping again, they too can be edited.
The author has thought of post processing using Joinery; this is hidden away in the Post Processing tab. But papercraft and the required adhesive tabs were not considered. If required, you need to add them to the right edges manually or use another extension, such as Tabgen [7].
Adhesive Tabs with Tabgen
Installing Tabgen is much like installing Paperfold. The next time you launch Inkscape, the plugin is available in Extensions | Papercraft | Tabgen (Figure 3). But some preliminary work is needed to be able to apply Tabgen to objects created with Paperfold. The two tools work in different ways. Tabgen expects closed paths, while Paperfold creates each page as a single path. You'll need to create an appropriate closed path object using Inkscape's tools – not too tricky once you know how.
To use the Edit | Select Same function, you first need to select the individual paths. This depends on whether the numbering was rendered in Paperfold. If so, you have to change its appearance a little before you can select the paths of the edges with this function. To do this, select one of the circles around the numbering and use the Edit | Select Same | Fill and Outline function. Because the paths of the edges have no fill, they are dropped from the selection.
Once you have selected all the circles of the numbering, simply change the color of the contour by selecting a different color while holding down the Shift key. After that you can select an edge and execute the function Edit | Select Same | Contour, which tells Inkscape to include all the paths of the edge in the selection.
Since the following steps are difficult to undo, create a duplicate of all the selected paths with Ctrl+D. After that, apply Path | Stroke to Path and then Path | Combine. Now you should be able to apply Tabgen to the object.
Doing so renders another path object, enlarging it by the dimensions chosen in the extension's settings for the glue tabs (Figure 4). But there is a small shortcoming here as well: The developer of this extension seems to glue every single side of an object and never fold it. So you get glue folds even where you don't need them and have to delete them manually from the object.
The developer needs to put in a little more work to make the extension useful for a wider audience. In addition, the tool shows some errors, due to the fact that the code does not catch any errors and the returned error messages are of little help even to experienced users. The developer is probably just getting into programming and creating these extensions for their own use. A little feedback, praise, and also help could probably go a long way here.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
System76 Refreshes Meerkat Mini PC
If you're looking for a small form factor PC powered by Linux, System76 has exactly what you need in the Meerkat mini PC.
-
Gnome 48 Alpha Ready for Testing
The latest Gnome desktop alpha is now available with plenty of new features and improvements.
-
Wine 10 Includes Plenty to Excite Users
With its latest release, Wine has the usual crop of bug fixes and improvements, along with some exciting new features.
-
Linux Kernel 6.13 Offers Improvements for AMD/Apple Users
The latest Linux kernel is now available, and it includes plenty of improvements, especially for those who use AMD or Apple-based systems.
-
Gnome 48 Debuts New Audio Player
To date, the audio player found within the Gnome desktop has been meh at best, but with the upcoming release that all changes.
-
Plasma 6.3 Ready for Public Beta Testing
Plasma 6.3 will ship with KDE Gear 24.12.1 and KDE Frameworks 6.10, along with some new and exciting features.
-
Budgie 10.10 Scheduled for Q1 2025 with a Surprising Desktop Update
If Budgie is your desktop environment of choice, 2025 is going to be a great year for you.
-
Firefox 134 Offers Improvements for Linux Version
Fans of Linux and Firefox rejoice, as there's a new version available that includes some handy updates.
-
Serpent OS Arrives with a New Alpha Release
After months of silence, Ikey Doherty has released a new alpha for his Serpent OS.
-
HashiCorp Cofounder Unveils Ghostty, a Linux Terminal App
Ghostty is a new Linux terminal app that's fast, feature-rich, and offers a platform-native GUI while remaining cross-platform.