RSS
 

How I do it: OpenSCAD

06 May

OpenSCAD Header

As I said in my previous post on SketchUp, I really enjoy reading about how other users setup and use their software. I usually find a plugin or setting that I never knew existed which helps me work more efficiently. I don’t know if my OpenSCAD setup has anything in it that’s out of the ordinary, but maybe something I use will help someone else out.

My Text Editor:

I just recently started using Sublime Text 2 as my primary editor and I’ve got to say it’s really a great addition to my work flow. Not only does it have a clean look and all the features you would expect from a modern editor, but it also has some pretty crazy stuff like a built in package manager! With just a few keystrokes you can search to see if you have syntax highlighting for a particular language installed, pull up the package manager, and install it. All in a matter of seconds. It’s pretty awesome.

Sublime Text 2 Package Manager

One of the nice things about this editor is that it’s cross platform. Last I checked it works on Windows, Mac, and Linux, there are also portable binaries for Windows (pretty handy for on the go coding). It’s always nice to be able to work in a program you’re familiar with regardless of platform, since I often switch between my Windows desktop and Mac laptop this is a big plus for me.

If you’re new to the editor, I’d recommend watching this excellent Sublime Text 2 tutorial series by the genius programmer and trainer Jeffrey Way. The tutorial starts at the basics and goes all the way through to advanced and complex workflows. I learned a lot from this series and would recommend it to anyone looking to pickup some new skills.

To augment the editor I’m using a modified version of Tony Buser’s “OpenSCAD Customizer Textmate/Sublime 2 Bundle” that includes code snippets for the Makerbot Customizer app. This adds syntax highlighting and code snippets for the OpenSCAD language which are not included by default in Sublime Text. All the credit goes to Tony on this one, he did a great job setting up the original package, I just added a few things that have changed since he wrote it.

Something that may be useful to other users is this page on setting up your own “Build Systems” in Sublime. I’ve used it to make it so when I press Command+B in Sublime my current OpenSCAD document (.scad) opens in OpenSCAD.app. This can be pretty handy if I don’t already have the program running.

My Sublime installation is pretty barebones, but my plugin list is as follows:

Sublime Package Control – This is one of the only plugins you need to install manually for Sublime. Instructions are provided in the link and Jeffery Way’s tutorial above.

OpenSCAD Customizer Textmate/Sublime 2 Bundle – My updated verision of Tony Buser’s great OpenSCAD syntax highlighting and code snippet bundle. More instructions are available in the link, this one needs to be installed manually too.

Color Picker – Easy to use color selector for Sublime. This can be installed via Package Control.

Sidebar Enhancements – Adds a lot of functionality to the sidebar in Sublime. This can be installed via Package Control.

Sublimerge – Pretty nice graphical diff/merge interface for Sublime. This also works with GIT and SVN though I haven’t tried it myself. This can be installed via Package Control.

Daylerees Color Schemes – This set of themes includes the one I’ve used in the screenshots above “Earthsong”. I’m a big fan. This can be installed via Package Control.

My OpenSCAD:

I haven’t done too much to customize my OpenSCAD program. The most useful feature I use is the “Automatic Reload and Compile” option found in the “Design” menu. As the name would suggest this automatically re-renders the model every time I hit save in my text editor.

Screen Shot 2013-04-22 at 10.29.51 PM

Because I’m using an external editor I’ve also disabled the built in editor. This is pretty much a no brainer if you’re using any editor other than OpenSCAD, it also give you a little more room to view your model on screen.

Screen Shot 2013-04-22 at 10.51.19 PM

The other setting I’ve tweaked in OpenSCAD is upping the limit for rendered elements. I’ve run into an error message that caused my model not to render on screen a couple of times (I’m not sure if this was caused by poor modeling or just a really complex model), however upping the limit of rendered elements solved the issue (maybe it will help someone else). This setting is in the “Preferences > Advanced” menu.

The only thing I haven’t covered in this post and my post about my SketchUp plugins is how I keep it all in sync across multiple computers. Stay tuned for that post, I use Dropbox and a couple tricks to keep everything synced and playing nice. If there is anything I didn’t cover in this post that you’re curious about leave me a comment and I’ll do my best to fill you in.

 
 
  • Kacie Hultgren

    Great post, Chris. OpenSCAD has been on my long list of things to learn. Now that customizer is here, I’m moving openscad to the top of my list and this info is great for getting started.