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. 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.
- 1 Use OpenSCAD!
- 2 Read the OpenSCAD source of your predecessors
- 3 Choose an Open Source license and stick to it
- 4 Include a standard header with the name of the part, your name, date of publishing, license, etc
- 5 Use indentation
- 6 Use comments
- 7 Use modules
- 8 Use parameters
- 9 Use costly functions wisely
- 10 Some links
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! If you are a RepRap developer, 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.
If you still can't fall in love with OpenSCAD, there's also [Blender] for more artistic work and FreeCAD with usage patterns similar to many of the commercial, technical CAD applications. Note that while it is easy to export any design from OpenSCAD and import it into Blender or FreeCAD or any other Open Source or proprietary CAD program, there is no automated way to import an existing design into OpenSCAD (you'll have to manually reverse-engineer it).
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 standard header with the name of the part, your name, date of publishing, license, etc
There is a minimum of documentation that is required for collaborative work to take place.
(add example of good header)
It makes the code easier to read and understand.
(add examples of none, bad and good indentation)
It makes the code easier to understand and maintain/modify. Also, preferably, write your comments in English.
It makes the code shorter and easier to read.
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.
- Open-Source Hardware FAQ
- Check the Licenses category right here in this wiki (a search for licenses will take you there).