Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

OpenSCAD Parametric CAD Library (LGPL 2.1)

branch: master

This branch is 0 commits ahead and 0 commits behind master

Merge pull request #13 from traverseda/master

Mergining libtrianlges
latest commit 6079e6d50b
Elmo authored
Octocat-spinner-32 bitmap Some more potential mistakes and an OpenSCAD syntax error January 21, 2011
Octocat-spinner-32 2Dshapes.scad Added layout and 2D shapes modules November 22, 2012
Octocat-spinner-32 README.markdown clarify that you cannot use wildcards in OpenSCAD use/include statements August 01, 2012
Octocat-spinner-32 TODO Added some items to TODO February 03, 2011
Octocat-spinner-32 __init__.py Add __init__.py to be able to import the python code also October 06, 2010
Octocat-spinner-32 bearing.scad API change! This actually makes the bearing code usable sice it works… October 07, 2010
Octocat-spinner-32 boxes.scad Added code from the openscad svn repo for easy use and improvement. August 26, 2010
Octocat-spinner-32 constants.scad Clarified the licenses in use in this library, has GPL2 and GPL3 whic… July 25, 2010
Octocat-spinner-32 curves.scad Randome bits of syntax that openscad doesn't treat as errors January 21, 2011
Octocat-spinner-32 gears.scad Fixed some copyright disclaimers January 18, 2011
Octocat-spinner-32 gridbeam.scad added functions and fixes to gridbeam.scad January 05, 2011
Octocat-spinner-32 hardware.scad fixed up license of hardware.scad January 18, 2011
Octocat-spinner-32 involute_gears.scad Randome bits of syntax that openscad doesn't treat as errors January 21, 2011
Octocat-spinner-32 layouts.scad Added layout and 2D shapes modules November 22, 2012
Octocat-spinner-32 lgpl-2.1.txt Changed to LGPL, since all the code is now compatible July 26, 2010
Octocat-spinner-32 libtriangles.scad Added licensing stuff. February 16, 2013
Octocat-spinner-32 materials.scad Added testing infra using py.test. Catches parse errors already, but … July 26, 2010
Octocat-spinner-32 math.scad Clarified the licenses in use in this library, has GPL2 and GPL3 whic… July 25, 2010
Octocat-spinner-32 metric_fastners.scad moved ellipse and egg_outline to regular_shapes.scad January 18, 2011
Octocat-spinner-32 motors.scad Added a tolerance parameter tor motors.scad, by D1plo1d February 03, 2011
Octocat-spinner-32 nuts_and_bolts.scad Fixed some copyright disclaimers January 18, 2011
Octocat-spinner-32 openscad_testing.py Moved testing code to another file for easier using outside MCAD October 13, 2010
Octocat-spinner-32 openscad_utils.py Raised the default timeout for calling openscad to make tests not fail October 07, 2010
Octocat-spinner-32 regular_shapes.scad Made square pyramid actually work February 15, 2011
Octocat-spinner-32 screw.scad auger() actually builds augers with all params November 05, 2012
Octocat-spinner-32 servos.scad Testing improvements and cleanup August 26, 2010
Octocat-spinner-32 shapes.scad Added layout and 2D shapes modules November 22, 2012
Octocat-spinner-32 stepper.scad Randome bits of syntax that openscad doesn't treat as errors January 21, 2011
Octocat-spinner-32 teardrop.scad fixed license and typo for teardrop.scad October 30, 2011
Octocat-spinner-32 test_docs.py Improved docs based on failures of test_docs.py October 30, 2010
Octocat-spinner-32 test_mcad.py Moved testing code to another file for easier using outside MCAD October 13, 2010
Octocat-spinner-32 triangles.scad Merged changes from a fork August 28, 2010
Octocat-spinner-32 units.scad Added a switch to generate bearing outlines for hole cutting etc. July 26, 2010
Octocat-spinner-32 utilities.scad Added a spin module, does what the transformation with the same name … February 16, 2011
README.markdown

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 is licensed under the LGPL 2.1 See http://creativecommons.org/licenses/LGPL/2.1/ or the included file, lgpl-2.1.txt.

Usage

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:

  • involute_gears.scad (http://www.thingiverse.com/thing:3575):

    • 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)

Other 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

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 (http://www.thingiverse.com/thing:3457): parametric teardrop module
  • shapes.scad: simple shapes by Catarina Mota

External utils that generate and and process openscad code:

  • openscad_testing.py: testing code, see below
  • openscad_utils.py: code for scraping function names etc.

Development

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.

Testing

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 openscad_testing.py, and can be imported to be used in other codebases.

Something went wrong with that request. Please try again.