OpenSCAD tips for RepRap developers
I was motivated to write this page by reading the OpenSCAD source for dozens of printed parts used in various 3D printers (i.e the famous "Vitamins"). If you are a developer, please take note of the following tips and guidelines for writing OpenSCAD code when designing your new 3D printer, extruder or any other part.
Contents
- 1 Use OpenSCAD!
- 2 Read the OpenSCAD source of your predecessors
- 3 Choose an Open Source license and stick to it
- 4 Include a header with the name of the part, your name, date of publishing, etc
- 5 Use indentation
- 6 Use comments
- 7 Use modules
- 8 Use parameters
- 9 Use costly functions wisely
- 10 Some links
Use OpenSCAD!
OK, this may seem trivial, but there are many CAD experts that would rather use the latest version of some proprietary (and expen$$$ive) CAD package which they have probably been using for many years. Well, to these experts, I say: don't! Please use OpenSCAD. There is a learning curve for sure, but it takes at most a couple of days to learn the basics of OpenSCAD, and the advantages of using it will quickly become clear. Basically it makes collaborative work on Open Source hardware much, much easier.
Read the OpenSCAD source of your predecessors
Best way to learn how to design things properly!
Choose an Open Source license and stick to it
I prefer GPLV3, for various reasons.
Include a header with the name of the part, your name, date of publishing, etc
There is a minimum of documentation that is required for collaborative work to take place.
Use indentation
It makes the code easier to read and understand.
Use comments
It makes the code easier to understand and maintain/modify.
Use modules
It makes the code shorter and easier to read.
Use parameters
It makes the code easier to read and maintain/modify. Also, it goes without saying, use proper names for your parameters.
Use costly functions wisely
Minkowski comes to mind.
Some links
- Open-Source Hardware FAQ
- Check the Licenses category right here in this wiki (a search for licenses will take you there).