OpenSCAD Parts Library

by randyy, published

OpenSCAD Parts Library by randyy Feb 2, 2011
0 Share
Download All Files

Thing Apps Enabled

Order This Printed View All Apps



OpenSCAD Parts Library by randyy is licensed under the GNU - LGPL license.

Use This Project

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag.

Print Thing Tag

Thing Statistics

17453Views 4463Downloads


I've been using these OpenSCAD modules in my models, developing new parts for my different projects. I decided to compile the parts into one library and release it into the Thingiverse wild. Several people have been looking for printable washers and nyloc nuts recently, and have released them as individual things. Also, someone just asked me for specs on the dovetail I used on my makerbottable filament spool. All of these things are in my library, including:

Shape primitives
Equilateral triangles (prisms),
3 sided pyramids and tetrahedrons,
4 sided pyramids including a Johnson's Solid square pyramid (a cube cut along its diagonal),
tubes (hollow cylinders with variable wall thicknesses),
slots with selectable round or square end(s),
teardrop (as designed by whosawhatsis, www.thingiverse.com/thing:3457)
dovetail pins and slots to attach parts without connectors,
rounded corner rectangles, and
keyhole slots.
The rounded rectangles and keyholes can be seen my quick release x-Rod caps, http://www.thingiverse.com/thing:4765
The dovetails can be seen on my Makerbottable filament Spool, http://www.thingiverse.com/thing:4337

Hardware Parts
Hex Nuts,
Cap Bolts,
Hex Bolts, and

These parts are modeled by the part's name or size for mockups or to difference out voids in a model. For instance hexNut("M6") will give the appropriate sized hardware. The sizes are included in an extensible table, so if you have a specific part, you can just add it's dimension, name it, and use it.

Miscellaneous functions and useful stuff
I included a function that will globally adjust the number of triangles used in rounded objects based upon a single "displayMode" variable. For screen display, spheres will be facetless, but by changing only one variable, you can reduce the facet count for printing to about 1mm resolution.

Several functions to rotate and translate objects in only one plane, with names that (to me) are easy to remember. for instance, rotate(tighten()) will twist an object along the z plane clockwise 90 degrees (like tightening a lid on a jar). Likewise Push() moves an object away, Slide() to the side, and Lift() up.

Last, is a rudimentary table module and access functions (alluded to under the hardware section). You can put any data in the table, with a named header row, add names for the various columns in a column table, and subsequently locate all of the data in that row or any individual entry by using the functions tableRow(rowName) or tableEntry(rowName, columnName). The library has a selection of bearings, and both metric and US bolts/washers/nuts included, but you can always add more. The table can be used for just about anything, including positions within your model that you can refer to like this: translate(tableRow("Front Tire Position");

I hope you like it and if you have upgrade ideas, e-mail me and I'll try to incorporate the changes here.

If you REALLY like it, feel free to flattr it. :o)

UPDATE New version uploaded on 5/7/11, old version removed. Fixed bug in bearing() module that doubled the expected size (used diameter as radius). Added rezPrinter and rezScreen functions for adjusting facet sizes.


1) Download the Libs.scad file and put it in the same location as your project file.
2) Use the command include <"Libs.scad"> at the start of your file to access the library -
3) Just use the modules like you would use your own.

For a demo (the STL you see here) use the command libDemo();
the command libHelp(); will echo the prototype of all modules to the console.
the command libMoveHelp(); will echo the rotation and translation function names to the console.

All Apps

3D Print your file with 3D Hubs, the world’s largest online marketplace for 3D printing services.

App Info Launch App

Auto-magically prepare your 3D models for 3D printing. A cloud based 3D models Preparing and Healing solution for 3D Printing, MakePrintable provides features for model repairing, wall thickness...

App Info Launch App

Kiri:Moto is an integrated cloud-based slicer and tool-path generator for 3D Printing, CAM / CNC and Laser cutting. *** 3D printing mode provides model slicing and GCode output using built-in...

App Info Launch App
KiriMoto Thing App

With 3D Slash, you can edit 3d models like a stonecutter. A unique interface: as fun as a building game! The perfect tool for non-designers and children to create in 3D.

App Info Launch App

Print through a distributed network of 3D printing enthusiasts from across the US, at a fraction of the cost of the competitors. We want to change the world for the better through technology, an...

App Info Launch App

Quickly Scale, Mirror or Cut your 3D Models

App Info Launch App

3D Print a wide range of designs with Treatstock. Easy to use tools to get the perfect result. The global 3D printing network that connects you with high-quality and fast working print services nea...

App Info Launch App

Bella idea e ottimo lavoro. Grazie!
Nice idea and good job. Thanks!

Can the size of the solids be adjusted? For example, I'd like to make cubes and also half-cubes of dimensions s x s x s/2 .

Really good, plain library easy to understand.

This is so helpful. The best ever. Thank you so much.

Where can I create my prototype for a children toy I
designed that calls for 1050 pieces, most cost effectively?

1000 of the pieces are a very simple 10x10x10mm cubes.

Thanks this library is great. :-D

Had some trouble with the dovetail in this one, would probably like it better if it were just the trapezoid part, for now I'm using jag's dovetail. http://www.thingiverse.com/thing:10269http://www.thingiverse.com/thi... Everything else looks great though!

Dovetail modules for openscad
by jag

Sorry you had issues. What specifically was the problem? Obviously, everybody's workflow is different but I use the tabs to register the parts and assure the male sticks out as far as the female sticks in. Works for me as a sanity check. Depending on your calibration and desired tightness or looseness of the joint, the male may need to be a fraction of a mm smaller than the female. If you can suggest an improvement, lemme know. :-D

You should really add all this to MCAD, the definitive opensca library: http://reprap.org/wiki/MCADhttp://reprap.org/wiki/MCAD

The best way is to fork and merge you code in, but if you do nothing, then I might eventually get to this.