OpenSCAD Parts Library
Description
Shape primitives
Hexagrams,
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, 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, thingiverse.com/thing:4765
The dovetails can be seen on my Makerbottable filament Spool, thingiverse.com/thing:4337
Hardware Parts
Hex Nuts,
Washers,
Cap Bolts,
Hex Bolts, and
Bearings
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.
Instructions
2) Use the command include 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.
You must be logged in to post a comment.
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/thi... Everything else looks great though!
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/MCAD
The best way is to fork and merge you code in, but if you do nothing, then I might eventually get to this.


Thanks this library is great. :-D