Showing posts with label Scripted CAD. Show all posts
Showing posts with label Scripted CAD. Show all posts

Sunday, 27 October 2013

OpenSCAD - Intro and Example: Designing a filament holder

Over the last few years I have increasingly used OpenSCAD for creating designs of 3D objects. Like many others I was initially put off by the lack of a WYSIWYG point and click interface - it takes time to get used to this scripted method of working.


The OpenSCAD design environment
OpenSCAD - scripted 3D CAD


A common question in forum posts is "why bother", a point and click CAD program is easier to use. For me the advantages come down to these key reasons:

  • Parametrization - Scripted CAD is at the core of the Thingiverse customiser and working with parameters is easy and natural to do when using a programming based approach.
  • Code re-use - Useful elements of designs can be used again and again, as you would with a library of functions in a program. A change to the library can easily be cascaded down to designs which use it.
  • Collaboration - The key advantage, tools like Git can be used to fork and merge the code. Many people can work on the same project in a robust way a method proven in software development.
Like everything its not perfect, I can see the following disadvantages in comparison to a point and click CAD program:
  • Not intuitive to start with - If you are used to learning a program by clicking on stuff to see what happens, as I do for most programs, it can be frustrating.
  • There is no simple way to import or export model files to other non scripted CAD programs other than as an .stl file - fine for 3d printing but not for people who want to use these other tools.
The rest of this (long!) post is a worked example using OpenSCAD to design a filament spool holder for the Lasercut Mendel90. I hope this will help to ease the transition into scripted CAD for those just starting out. This is not meant to replace the manual, or even be a tutorial of all functions. The OpenSCAD documentation is a comprehensive reference and links to a number of tutorials and other worked examples. The final filament holder code is available on github, and its a thing in the thingiverse.

A preview of what the spool holder looks like mounted on the printer:




On to the example!