Skip to content

Instantly share code, notes, and snippets.

@chuck-h
Last active December 10, 2015 05:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuck-h/4391674 to your computer and use it in GitHub Desktop.
Save chuck-h/4391674 to your computer and use it in GitHub Desktop.
sample extopenscad module with units
/* size34.escad, units=inch, for 3.4-inch-frame motor */
module size34_cutout() {
unit("in") {
pilot_dia = 2.875+0.015;
bolt_hole_spacing = 2.75;
hole_dia = 0.21;
union(r=0.25) {
circle(pilot_dia/2);
for (rot = [0, 90, 180, 270]) {
rotate(rot+45) union() {
bolt_rad = bolt_hole_spacing/sqrt(2);
translate([bolt_rad, 0]) circle(hole_dia/2);
translate([bolt_rad/2,0]) square([bolt_rad, hole_dia], center=true);
}
}
}
}
}
/* this should put the pattern in the middle of a 4x4 inch plate */
unit("in") {
difference() {
square([4,4], center=true);
size34_cutout();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment