Skip to content
OpenSCAD Parametric CAD Library (LGPL 2.1)
Branch: master
Clone or download
#48 Compare This branch is 48 commits ahead of SolidCode:master.
hyperair Merge pull request #53 from RyanBalfanz/patch-4
Fix misspelled local variable in egg() module
Latest commit a7be3d6 Apr 4, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
bitmap Some more potential mistakes and an OpenSCAD syntax error Jan 21, 2011
.gitignore Update test code for Python3. Sep 23, 2018
2Dshapes.scad Added layout and 2D shapes modules Nov 22, 2012
3d_triangle.scad minor fix: Use correct use convention in documentation Feb 2, 2012
README.markdown README: Remove duplicated 'and' Sep 28, 2018
TODO Added items to TODO Mar 25, 2011 Add to be able to import the python code also Oct 6, 2010
bearing.scad added more bearing sizes Nov 10, 2016
boxes.scad Clarified BSD license Nov 5, 2013
constants.scad Clarify licensing Mar 7, 2014
curves.scad Randome bits of syntax that openscad doesn't treat as errors Jan 21, 2011
fonts.scad Clarified license Oct 1, 2013
gears.scad Fixed rotation on demo helical gear Jul 5, 2017
gridbeam.scad remove executable bit and add todo list item May 31, 2013
hardware.scad fixed up license of hardware.scad Jan 18, 2011
involute_gears.scad Fixed orientation issue Dec 30, 2011
layouts.scad Added layout and 2D shapes modules Nov 22, 2012
lego_compatibility.scad Clarify licensing Mar 7, 2014
lgpl-2.1.txt Changed to LGPL, since all the code is now compatible Jul 26, 2010
libtriangles.scad Added licensing stuff. Feb 16, 2013
materials.scad Added testing infra using py.test. Catches parse errors already, but … Jul 26, 2010
math.scad Clarified the licenses in use in this library, has GPL2 and GPL3 whic… Jul 25, 2010
metric_fastners.scad Fixed FSF address Oct 7, 2012
motors.scad Added a tolerance parameter tor motors.scad, by D1plo1d Feb 3, 2011
multiply.scad Added multiply.scad Jan 30, 2012
nuts_and_bolts.scad Merge pull request #37 from telepath/master Aug 9, 2018 Update test code for Python3. Sep 23, 2018 Update test code for Python3. Sep 23, 2018
polyholes.scad Added license info from Oct 31, 2012
regular_shapes.scad Merge pull request #53 from RyanBalfanz/patch-4 Apr 4, 2019
screw.scad auger() actually builds augers with all params Nov 6, 2012
servos.scad Removing execute permissions from OpenSCAD source. Sep 25, 2018
shapes.scad shapes: Make deprecation module name less generic Oct 7, 2018
stepper.scad Randome bits of syntax that openscad doesn't treat as errors Jan 21, 2011
teardrop.scad circle does not have a center parameter Dec 20, 2018 Update test code for Python3. Sep 23, 2018 Moved testing code to another file for easier using outside MCAD Oct 13, 2010
transformations.scad Added license, renamed module to make it actually work Oct 31, 2012
triangles.scad Added optional "center" param to triangle() and a_triangle() modules Jul 10, 2018
trochoids.scad Added trochoids.scad from thingiverse, needs cleaning Apr 28, 2011
units.scad Added multiply.scad Jan 30, 2012
unregular_shapes.scad Added new file for not-so-regular shapes Sep 6, 2011
utilities.scad Added multiply.scad Jan 30, 2012


OpenSCAD MCAD Library

This library contains components commonly used in designing and moching up mechanical designs. It is currently unfinished and you can expect some API changes, however many things are already working.

This library was created by various authors as named in the individual files' comments. All the files are licensed under the LGPL 2.1 (see or the included file lgpl-2.1.txt), some of them allow distribution under more permissive terms (as described in the files' comments).


You can import these files in your scripts with use <MCAD/filename.scad>, where 'filename' is one of the files listed below like 'motors' or 'servos'. Some files include useful constants which will be available with include <MCAD/filename.scad>, which should be safe to use on all included files (ie. no top level code should create geometry). (There is a bug/feature that prevents including constants from files that "include" other files - see the openscad mailing list archives for more details. Since the maintainers aren't very responsive, may have to work around this somehow)

If you host your project in git, you can do git submodule add URL PATH in your repo to import this library as a git submodule for easy usage. Then you need to do a git submodule update --init after cloning. When you want to update the submodule, do cd PATH; git checkout master; git pull. See git help submodule for more info.

Currently Provided Tools:

  • regular_shapes.scad

    • regular polygons, ie. 2D
    • regular polyhedrons, ie. 3D
  • involute_gears.scad (

    • gear()
    • bevel_gear()
    • bevel_gear_pair()
  • gears.scad (Old version):

    • gear(number_of_teeth, circular_pitch OR diametrial_pitch, pressure_angle OPTIONAL, clearance OPTIONAL)
  • motors.scad:

    • stepper_motor_mount(nema_standard, slide_distance OPTIONAL, mochup OPTIONAL)

Tools (alpha and beta quality):

  • nuts_and_bolts.scad: for creating metric and imperial bolt/nut holes
  • bearing.scad: standard/custom bearings
  • screw.scad: screws and augers
  • materials.scad: color definitions for different materials
  • stepper.scad: NEMA standard stepper outlines
  • servos.scad: servo outlines
  • boxes.scad: box with rounded corners
  • triangles.scad: simple triangles
  • 3d_triangle.scad: more advanced triangles

Very generally useful functions and constants:

  • math.scad: general math functions
  • constants.scad: mathematical constants
  • curves.scad: mathematical functions defining curves
  • units.scad: easy metric units
  • utilities.scad: geometric funtions and misc. useful stuff
  • teardrop.scad ( parametric teardrop module
  • shapes.scad: DEPRECATED simple shapes by Catarina Mota
  • polyholes.scad: holes that should come out well when printed


  • alphabet_block.scad
  • bitmap.scad
  • letter_necklace.scad
  • name_tag.scad
  • height_map.scad
  • trochoids.scad
  • libtriangles.scad
  • layouts.scad
  • transformations.scad
  • 2Dshapes.scad
  • gridbeam.scad
  • fonts.scad
  • unregular_shapes.scad
  • metric_fastners.scad
  • lego_compatibility.scad
  • multiply.scad
  • hardware.scad

External utils that generate and process openscad code:

  • testing code, see below
  • code for scraping function names etc.


You are welcome to fork this project in github and request pulls. I will try to accomodate the community as much as possible in this. If for some reason you want collaborator access, just ask.

Github is fun (and easy), but I can include code submissions and other improvements directly, and have already included code from various sources (thingiverse is great :)

Code style

I'd prefer to have all included code nicely indented, at least at the block level, and no extraneous whitespace. I'm used to indent with four spaces as opposed to tabs or other mixes of whitespace, but at least try to choose a style and stick to it.


I've started a minimal testing infrastucture for OpenSCAD code. It's written in python and uses py.test (might be compatible with Nose also). Just type py.test inside the lib dir in a terminal and you should see a part of the tests passing and tracebacks for failing tests. It's very simplistic still, but it should test that no syntax errors occur at least.

The code is included in, and can be imported to be used in other codebases.

You can’t perform that action at this time.