3D printing workflow and my modular raygun developments

Screen capture of my current raygun design in OpenSCAD

My raygun design in OpenSCAD

I spent yesterday evening carefully adding to my raygun model in OpenSCAD. The image to the left is a screen capture.

This morning I told my Mendel Prusa to print the model in clear PLA plastic. This is my first large print, and it took three and a half hours. Which is fine, as I can use my computer for other things while the raygun is printing. This post will outline the workflow from idea to physical object.


First up, I model the object in OpenSCAD, as shown in the first screen capture.


My raygun as displayed in netfabb

My raygun as displayed in netfabb

After saving the raygun from OpenSCAD as an STL format file, I load the STL into Netfabb. Netfabb is a very useful free program for viewing, fixing and scaling 3D models (amongst other things).

Here I used Netfabb to scale the model to half the dimensions used in the OpenSCAD file. This resulted in it being 125mm left to right, by 100mm front to back, which fitted easily on my printbed.

I also use Netfabb to ‘mirror’ the model – to create an STL of the other side of the model – if the model is symmetrical like this one. I could also have done that in OpenSCAD, but it is easier to do it here. Especially as I have never had Netfabb crash on me 🙂

If you are downloading STL models from somewhere like Thingiverse.com you’ll often find that your slicing program (Slic3r, SFACT, or Skeinforge for example) will complain about the STL file. Netfabb can often fix these problems and save the ‘fixed’ STL files.


A screen capture of Slic3r's Print settings

Slic3r's Print settings

Next I take the STL file massaged and scaled by Netfabb and load it into Slic3r.

Slic3r looks at the STL file – which represents the model as triangles in three dimensions – and turns it into G-codes, which are instructions for moving a printing nozzle.

To get this right, Slic3r has to know details about my particular printer (nozzle size, thickness of filament, the temperature I like to use with a certain filament, how many ‘perimeters’ I want round the outside – lots of stuff).

Slic3r's filament settings

Slic3r's filament settings

Getting these numbers right, and changing them appropriately when I change filament, for example, is an important part of successful desktop 3D printing. I’ve included screen captures of Slic3r’s two main settings screens in case that is useful to anyone with the same printer components as me.


my RayGun02 as loaded into pronterface

My raygun as loaded into pronterface

Next I load the G-code file generated by Slic3R into Pronterface. Pronterface is the program that talks directly to the Arduino microcontroller built into the printer.

Pronterface takes the lines of G-code from the file and transmits them to the printer, where the printer’s firmware – Marlin, in this case – interprets the codes and tells the motors what to do.


Marlin controls the stepper motors, making the print bed zing backwards and forwards, and the nozzle zip from side to side, and up by a quarter of a millimetre (in my case) each level. Marlin also controls how fast the extruder motor pushes the filament into the heated nozzle,  and monitors and controls the heat of the nozzle and heatbed.

The physical object

Half-scale and quarter scale raygun prototypes

Half-scale and quarter scale raygun prototypes

And the end result is another iteration in my raygun design. It printed beautifully, and without warping. I did use fan cooling after the first 10mm or so of vertical height, because the overhangs in the hollow bore were getting floppy.

I’ve included the previous iteration of the raygun in the photo so you can see the increase in decoration, and the difference in scaling that I did in netfabb. Both rayguns are modelled with exactly the same dimensions in OpenSCAD, but I had reduced the earlier print to a quarter of full size, while I only reduced the new print to half full size.

Modular Vs Parametric

The raygun is not in any way modular yet – I can’t choose which of two barrel decorations to apply, or what grip design to use.

But it is ‘parametric’, which means that many of the design measurements are calculated automatically. If I choose to make the barrel dimension smaller, or longer, everything else recalculates to keep the same basic relationships. If I want an extra ring around the barrel, I copy and paste one line of code and change one number. And if I don’t want any finger cutouts in the grip, I can do it by adding a single character to the file

Ultimately my goal is to have a single OpenSCAD file containing multiple optional and scalable components, and simple compile-time options to choose between them.

This entry was posted in 3d printing, Objects, Software and tagged , , , , , , , , . Bookmark the permalink.

4 Responses to 3D printing workflow and my modular raygun developments

  1. Gary says:

    Another winner. Thanks again for sharing your knowledge in an easy-to-digest way.

  2. Daniel says:

    How about finishing the surfaces of your model? The layer build up made the surface of the object slightly ‘gaggy’… Have you tried sanding the surface or finishing up with spray paint, etc. to make it look like a final product or something? Thanks.

    • BrazenArtifice says:

      I’m not sure what you mean by ‘gaggy’ ? 🙂 I’ve just dragged out that print to have a close look at it. A lot of what you are seeing is the light reflecting off the shiny clear PLA. Under a low-power microscope you can see how smooth the edges of the extruded filament are, unless you get the temperature too low. Coloured PLA has a different appearance, which some folks prefer.

      I’ve filed and sanded PLA, and it works well, though PLA is surprisingly tough. It takes a lot more time and effort than sanding wood. And you have to be careful not to let the friction heat the plastic up above it’s softening point of around 60 degrees Celcius, or it goes soft and soggy.

      I haven’t tried painting it yet, though people say that acrylics work fine. I’d probably lightly sand the surfaces to get some ‘tooth’ for the paint to stick to, and use an undercoat of acrylic medium first, before laying the coloured acrylics on top.

      If you want inspiration, and since I was talking about rayguns here, try this google image search.

      These are what people have managed to create by painting up the $10 ‘Maverick’ model Nerf-brand foam dart guns. Some folks glue on decorative elements, which we might print on our printers.

      If you use a layer of acrylic modelling paste over the undercoat, you can texture the result any way you want. Or even do image transfers onto the painted surface.

  3. Pingback: Beginnings | Strangeness and Charm

Please leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.