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
-
The GNU Project Celebrates Its 40th Birthday
September 27 marks the 40th anniversary of the GNU Project, and it was celebrated with a hacker meeting in Biel/Bienne, Switzerland.
-
Linux Kernel Reducing Long-Term Support
LTS support for the Linux kernel is about to undergo some serious changes that will have a considerable impact on the future.
-
Fedora 39 Beta Now Available for Testing
For fans and users of Fedora Linux, the first beta of release 39 is now available, which is a minor upgrade but does include GNOME 45.
-
Fedora Linux 40 to Drop X11 for KDE Plasma
When Fedora 40 arrives in 2024, there will be a few big changes coming, especially for the KDE Plasma option.
-
Real-Time Ubuntu Available in AWS Marketplace
Anyone looking for a Linux distribution for real-time processing could do a whole lot worse than Real-Time Ubuntu.
-
KSMBD Finally Reaches a Stable State
For those who've been looking forward to the first release of KSMBD, after two years it's no longer considered experimental.
-
Nitrux 3.0.0 Has Been Released
The latest version of Nitrux brings plenty of innovation and fresh apps to the table.
-
Linux From Scratch 12.0 Now Available
If you're looking to roll your own Linux distribution, the latest version of Linux From Scratch is now available with plenty of updates.
-
Linux Kernel 6.5 Has Been Released
The newest Linux kernel, version 6.5, now includes initial support for two very exciting features.
-
UbuntuDDE 23.04 Now Available
A new version of the UbuntuDDE remix has finally arrived with all the updates from the Deepin desktop and everything that comes with the Ubuntu 23.04 base.