Mapping a paper-folded object
Shape Mapper lends itself well to projection mapping objects fabricated from digital models, for example 3D printing. Paper craft is attractive because of the low cost of materials.
In this tutorial, we'll design a simple model with Blender, build it using paper, and projection map it with Shape Mapper.
Note: this tutorial assumes you have access to a printer, or even better, an automatic cutting machine such as a Cricut.
Design and fabricate a model
- Download and install Blender.
-
Install the Export Paper Model add-on for Blender.
- Within Blender, navigate to Edit > Preferences > Add-ons.
- Select the "Community" tab if it is not already selected.
- Search for "Export Paper Model".
-
Click the checkbox next to the name of the add-on to install it.
-
Delete the default cube in the Blender scene by selecting it with the mouse, and then pressing
X
followed byD
. -
Press
Shift + A
to activate the "Add" menu. -
Navigate to Mesh > Ico Sphere to add it to the scene.
-
In the lower left hand corner, the "Add Ico Sphere" options will appear. Click these and set the subdivisions to 1.
-
Adjust the size of your paper model to fit the dimensions of your paper.
- Select the newly created Ico Sphere.
-
In the upper right hand corner of the scene view, there is a small arrow. Click this to reveal the context menu.
-
Click the "Paper" tab.
-
Check the "Automatic Scale" and "Limit Island Size" checkbox, and select the size of paper you're using.
-
Go to File > Export > Paper Model.
- If you are printing the paper model, export the model as PDF.
- If you are using a cutting machine, you likely need to export as SVG to import the template to your cutting machine's software. Preparing the template for your cutting machine is outside of the scope of this tutorial.
- Go to File > Export > Wavefront (.obj). We'll use this file when we start writing code.
-
Print and cut out your model, or use a cutting machine to automatically cut it out.
-
Fold your model and adhere the tabs with glue or tape to create a 3D object.
Write the Processing sketch
- Install Shape Mapper (see Getting Started).
- Create a Processing sketch and copy the
.obj
file you exported above into adata/
folder in the sketch's folder. -
Import and initialize the Shape Mapper library, and load the
.obj
file: -
Write a draw function that renders the shape. To map our rendered geometry to the physical object, we'll need to sandwich the drawing code within the
mapper.beginMapping()
andmapper.endMapping()
lines.
Calibrate the projection mapping
- Connect your computer to a projector and point the projector at the object.
- Run the sketch. The Shape Mapper GUI will appear in the upper left hand portion of the screen. (Note: you can hide this GUI by hitting
T
, or in the code usingmapper.hideGui()
.) -
Hit
Space
to switch fromRender
mode toCalibrate
mode. This will reveal the calibration GUI. -
Your 3D model will appear in the center of the screen. You can navigate the model with the following controls:
- Click + drag to orbit
- Command + click + drag to pan
- Scroll to zoom in and out
- Click a point on your model to select it.
- Hit
Tab
to switch to mapping mode. - Look at your object in physical space and move your mouse so that the crosshairs are centered on the corresponding vertex of the physical object. Click to create a point in the projected space.
- Hit
Tab
to switch back to point selection. Choose another point and repeat the process. -
After mapping 6 points, a full calibration will be automatically estimated. Press
Space
so switch back toRender
mode. In physical space, your object should now be successfully mapped.