From .obj to pen plotter
Updated: Jun 12, 2021
For a recent project I needed to take a digital scan of a sculpture as an .obj and export it as an .svg, suitable for outputting on my pen plotter. It was a slightly tricky process which took time to refine, so I thought I’d create this guide to share my process (though I am sure there are many other methods).
To convert and clean up the model, I used Blender with the Render: Freestyle SVG exporter add-on. For the final plot, I used Illustrator (my preferred vector editor) and Inkscape to prepare the file, and an Axidraw A3 with a Muji Gel ink ballpoint pen cap type pen 0.38, black on Khadi Papers, A3 320 gsm cotton rag.
To get started download and install the latest version of Blender
At the time of writing I am working on Blender 2.92.0 on Windows 10 Home.
Once downloaded open Blender and start a general composition.
Navigate to Edit>Preferences and find the 'Add-Ons' Tab.
In the Add-Ons tab search for ‘SVG’ and enable the ‘Render: Freestyle SVG Exporter’ add-on by ticking the white box next to it.
Close the screen to return to the composition.
Delete the cube by selecting it and pressing X>Delete.
Go to file>Import>Wavefront (.obj) and locate your .obj model.
Once imported select it go to Object>Set Origin>Geometry to Origin, to centre the object to the Origin Point.
Utilise the Move and Rotate tools to re-align, straighten and lift your object above the Origin Point.
Cleaning and Refining the Model
If like mine, your .obj is a 3D scanned object, then there is probably areas of the model you wish to clean up before editing any further. To do this select the Object with the Select Box Tool activated, and then switch to the Edit Mode.
Using the Selection Tool and Delete (x), Delete any Vertices that you don’t want to be part of the final print. Don’t worry about the complexity of the model we’ll deal with that later, here we are just dealing with any additional shapes that the scanner created by mistake, or any bases that you no longer want. If you only want to print a small section, we can just select it later, so you don’t necessarily need to delete everything now. However I find it makes it easier to orientate the Object and have a good idea of how it will look when exported.
Once happy with the model (we will smooth the vertices later) its time to clean it up, in order to simplify for printing. The next few steps will be trial and error, based on your model and the complexity of its mesh. If you oversimplify it, the image will lose clarity and just become jagged lines; if you don’t simplify it enough, the print with be dark, heavy and time consuming to plot.
First make sure you are in the Edit Mode for the Object.
Select All (A) and go to Mesh>Clean Up> Delete Loose. This will just ensure all Vertices are connected to something and is therefore necessary. You can track how much was deleted in the bottom right hand corner after each Clean Up.
To have a good idea of how the model will look when printed, make sure that you are on 'Viewpoint Shading Solid’ in the top right corner. Depending on your model, different values will be needed to best clean up.
I ran the ‘Decimate Geometry Clean Up’ at the following values. This clean-up maintains the shape and structure of the model much more than some of the other tools. However, implemented alone has not been enough for some of my models.
Depending on the proximity of some Vertices to each other, you may also wish to ‘Merge by Distance’. Without running this tool, I found that some of my models had dense, heavy sections, where the pen plotter was drawing lots of consecutive lines within a small space. As the pen I used was a 0.38 tip a merge distance of about 0.5mm (0.005m) worked well for most models, this one didn’t really need it as much.
You may wish to add some smoothing to the vertices here, to soften any extreme edges. To do this Select All (A) go to Vertex>Smooth Vertices, and adjust the values in the window at the bottom corner. Some of my models had been created from thin sharp materials such as pistachio shells and sticks, so this function really helped to even out and soften the edges.
Marking the Freestyle Edges
Once you think the model is simplified and cleaned enough, it is time to mark your freestyle edges. These are lines that you want the pen plotter to draw. It is worth bearing in mind that you are still looking at a 3D object with mass, and the SVG file will be a 2D view of whatever the camera sees. Therefore, even if you select the whole object to mark, only the edges facing the camera will be plotted. So, you may wish to change your camera view first. As I want the whole object marked, I will do this after.
Simply Select All (A), go to Edge>Mark Freestyle edge and you’ll notice all your edges selected now glow green.
Positioning the Camera
Now that the model is prepped, and the edges marked, it is time to position the camera.
To do this, I find the easiest way is to switch to camera view (0) and then to Lock Camera to View. This means that the camera view moves as I adjust the rotation and position using my mouse.
To Lock Camera to View, hover the cursor over the little left arrow to the right of the Viewpoint Compass, in the top right of the screen. When a two-way arrow appears drag it out and it should reveal another menu with three tabs. Select the View menu and tick the Lock Camera to View button.
Once locked you can now change your camera size. Click on the Output properties on your right tool pain (the printer icon) and adjust your resolution to match your desired output. I wanted my final print to be on A3, so I changed it to the ratio 4961 x 3508 px.
Rotate around the object and align it to the view you want the .svg to export - and obviously the angle that looks best.
Render Settings and Exporting the SVG
We are nearly ready to export, but first we need to modify the export settings. First click on the Render Properties tab on the right (camera icon) and scroll down. Tick both the Freestyle SVG Export and Freestyle Options. Expand the Freestyle options down and change the Line Thickness to one the reflects the pen you will be printing with. I tend to go for around 0.5.
Next go to the Output Properties again (the printer icon) and scroll down to the Output Bar. Click the folder and choose a file location, enter a file name and click accept. This is where your .svg will be saved and what it will be called.
Once done, switch to the View Layer properties (sheets of paper icon). You can collapse any options that are open the only ones we want to look at are Freestyle Line Set and Freestyle Line Style at the bottom.
In Freestyle Line Set, untick silhouette, border and crease but select Edge mark as this is what we want the .svg to export. In Freestyle Line Style change to the Thickness tab and change the Base Thickness to match your line size set earlier.
Render and Output
Once all settings have been altered got to the Render Menu at the top and select Render Image. First Blender will render the model and then it will render your .svg to the output folder and filename set earlier.
Save your Blender file just in case you want to make tweaks, or changes later. Open your .svg in either Inkscape or Illustrator. Here you can set the page size, resize the model, align it, and print to your pen plotter - as you would any other file. I have an Axidraw A3 and so use the Axidraw extension to optimise and plot my print.
For this project I created 8 Artworks on the pen plotter using this method. They also had the addition of animated AR layers when viewed through a smart device. For more information on the entire project, including the creation, modelling and scanning of the 3D object, please see my blog. The final works will be toured throughout Nottinghamshire library venues in 2021.
Wider project created in collaboration with;
Inspire Youth Arts
Miner to Major Project
Mixed Reality Lab
Newark Emmaus Trust
Yeoman Park School
St Giles School
A group of home educated young people at The Old Library
You can see more of my work on instagram @urbanprojections