Enclosures – 3D Printing’s Killer App (Part 2 – Design simple enclosures)

Part 1 of this series discussed why electronic enclosures are 3D printers’ killer app and 3D printing is uniquely suited for creating electronic enclosures for single unit prototyping or small-run production needs.  It left off with the observation that 3D printing is great, but you need CAD skills to really develop the full potential of 3D printing.

This second article will focus on the basic CAD skills and designs to master in order to start printing your first simple enclosures.  The end result will be a simple clam-shell style enclosure like this – effectively a hollowed out box that forms the basis for much more complicated enclosures later.  We’ll take this all the way from a blank page to an actual 3D printed object so you can see the end-to-end process using a simple, but useful example. 

All the source files for this tutorial are available on ThingiVerse to download for free.

Clam shell enclosure

The CAD package used is an affordable, consumer level CAD package called ViaCAD 2D3D 8.   

Included in this article are two videos – one is a tutorial on how to create a clam shell enclosure using ViaCAD and the second is a time-lapse video of the enclosure being 3D printed on a LulzBot AO-100…from creation to printing.  This is an image of the printed enclosure built using the techniques in this tutorial.

Clam shell enclosure

A Simple Clam-Shell Enclosure

This design really isn’t much more than a project box, I realize, but before getting to the more complicated aspects of enclosure design, it’s useful to start with the basics and go from design to print – get the end to end process nailed early on.  It’s still a useful design despite its simplicity and it’s relatively easy to add features to, so you can use this as a starting point for more advanced enclosures.

Think Like a 3D Solid Modeler 

Most 3D CAD packages are solid modeling tools and require a certain mind-set in order to be successful with the tool.  It’s partly a visual/spacial mindset and partly a mathematical/logical mindset.  Either way, I think it’s fairly intuitive to most people who have ever tried to make an object with Play-Doh.  The hard part is translating the 3D vision and intention into the commands or mouse clicks needed by the CAD tool – that is often the nut of the problem.

So, what is a basic enclosure?  It’s a hollowed out box, or in solid modeling parlance, it’s a block that’s been shelled.  Another way to think about it is if you pored molten plastic in the shape of a box around the object you want to protect, then extracted that object, you’d have a hollowed out center that was the shape of your object.

There are the two main approaches to the interior design of your enclosure and both have their advantages.  The first approach is to create a hollow using a simple geometric shape such as a block.  The second is to create a complex model of the object you want to insert into the enclosure, then extract that solid model from the enclosure solid.   We’ll focus on the first approach, an outer solid block that has been shelled using another simple, geometric shape, an interior block.

Lets make an enclosure that’s 100mm long, 60mm wide, and 30mm high, then hollow it out (shell it), then split it in half to make a clam-shell.  Following is a video tutorial on making a basic clam shell electronics enclosure using ViaCAD, a consumer-level (inexpensive) 3D CAD package.  While this is shown using a Mac version of ViaCAD, the exact same steps and menus are applicable to the Windows version of ViaCAD and this tutorial will be identical in Windows:

All the source files for this tutorial are available on ThingiVerse to download for free.

Exporting the CAD Design to an STL File

STL files are 3D descriptions of a part that are suitable for ingesting into the tools required to make the part – say a CNC router, or 3D printer.  ViaCAD lets you export the design as an STL file which works well for the next stage.  First export the clam-shell enclosure as an STL:

Skitch

You’ll get a popup dialog for what kind of file you want to save.  Choose STL, ASCII STL format:

Export

Next you’ll be presented with a standard file dialog which lets you name and store the STL file in a specific location on your hard drive:

Save 1

Click Save and you’l be presented with one more popup allowing you to choose various STL file options, but you can simply take the defaults for this exercise:

Mesh Parameters

Select OK and the STL file will be generated and saved.

Preparing the CAD STL File for 3D Printing

There are two steps to getting from the CAD design above to an actual, 3D printed part.  The first is to generate the GCode needed by the printer and the second is to load that GCode into the software that actually controls the printer and does the printing.

We’re targeting the LulzBot AO-100 3D printer and we’ll use Slic3r for the first part, generating the GCode from an STL file, and we’ll use Pronterface (Printrun), specifically MacPronterface, for the second part, 3D printing the enclosure.

Slic3r – Creating a GCode file with Slic3r

Slic3r reads in the STL file and will generate GCode suitable for Pronterface to ingest and control the 3D printing process.

After bringing up Slic3r, just add the STL file to the layout using the Add… button and the file dialog:

Slic3r

Select the STL file we exported in the previous step:

Slic3r Open

You’ll get results that are similar to this.  Load your printer’s configuration file for whatever filament type you’re planning to use (I won’t go into all the options related to Slic3r configuration, but you should have received an .INI file or directions for downloading a Slic3r .INI file from LulzBot that is a good starting point for a most prints.)

Slic3r 3

Once you’ve loaded the STL file, you’ll hit the “Export G-Code” button on the lower right and select the filename for the GCode:

Save 2

It’s this GCode file you’ll use for the next step.

Pronterface – Loading the GCode file and 3D Printing

Next bring up Pronterface (Printrun) and load the GCode file you just created with Slic3r – make sure to use the file with the .gcode extension.  Use the “Load file” button on Pronterface to get the file dialog to select the GCode file:

Open file to print

Once the GCode file is ingested by Pronterface, you’ll see a screen similar to this where you can see the footprints of the top and bottom portions of the enclosure we designed above.  The heavy black line around the perimeter is an extrusion loop that the printer uses to get the plastic flowing before starting on the part.

Printer Interface

From here, you connect to the LulzBot AO-100 printer and start the print run.

Connecting Pronterface with LulzBot AO-100

After you’ve loaded the GCode you can connect to the LulzBot AO-100 3D printer – it’s not order dependent, you can do the connection first, then load the GCode.  Make sure to turn on the LulzBot first and have it connected by USB before bringing up Pronterface otherwise, the USB connection won’t be recognized and enumerated.  Each system is slightly different, but on a Mac, the interface shows up as a /dev/tty.XYZ where XYZ is whatever OS X enumerated the LulzBot USB device.  In my case it looks like this when I select the device to connect to (/dev/tty.usbmodem411)

Menubar

After selecting the USB device, you can hit the “Connect” button and Pronterface will be talking to the LulzBot AO-100.

Heat it up

Before printing, you have to do two things in Pronterface.  First, you need to start the heat on the hot-end extruder.  Secondly, you have to start the heat on the heated bed – the print surface.  The latter is needed because parts will warp and sometimes peel off the bed if the bed is not hot enough.  You click the “Set” button next to “Heater” and also “Bed”.  If you’re printing ABS plastic, the temperature for the hot-end will be 230C and the bed will be 110C.  After that, monitor the temperature of the two parts until they’ve reached their set points.

Printer Interface 1

Finally – 3D Print

The last step is the easiest, just hit “Print” to start the 3D print process.  Below is a video of the top and bottom parts of the clam-shell printing on a LulzBot AO-100 3D printer.

Final Product

Below is a closeup image of the final printed clam-shell.  No filing or any other kind of post-production work was done on these parts – they’re exactly as they came off the LulzBot AO-100 in the video above.  I think you’ll agree, the final part print looks nearly identical to the isometric view of the parts shown at the start of this tutorial and that’s one of the main things I wanted to show – end-to-end, from creation to physical part.

IMG 1055

These parts were printed with a layer height of 0.4mm, ABS plastic filament, 2.89mm diameter (what’s referred to as 3mm filament.)

Summary

It’s clear from the actual part print that the enclosure is much thicker than it needs to be, but that wasn’t really the point of this article – the point was to show how the design process works for a clam shell starting from scratch all the way to an actual 3D print.  

It’s also possible to radically speed up the print through additional tweaks in Slic3r including the density of the infill and layer height.  Tweaking a build for optimal print time and quality is a fairly time consuming process and one you would go through if you were planning to print even a small batch – say 5 to 10 units.  It’s usually worth it to dial it in especially if you know you’ll be printing more over time.

Where to?

Upcoming parts in this series will demonstrate how to design two additional enclosure styles.  One, a shelled enclosure with a horizontal faceplate, and two, an enclosure with a thin lid or bottom that snaps into place.  Both these are versatile and scalable designs that can be easily adapted to your own needs.

Other parts of this series

Enclosures – 3D printing’s Killer App (Part 1)

Enclosures – 3D printing’s Killer App (Part 3 – Designing enclosures with front panels)

All the source files for this tutorial are available on ThingiVerse to download for free.

Landon Cox

Inhale3D.com

One comment

  1. anonymous says:

    You hit the nail on the head with this. I’m just starting to run into this problem and it’s frustrating to find no real solutions to getting a decent enclosure.

    Thank you for posting this tutorial!