Skip to content

Instantly share code, notes, and snippets.

@madex
Created July 3, 2018 19:40
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 madex/c9cc78d9d2fd413b81510015cf9a73ff to your computer and use it in GitHub Desktop.
Save madex/c9cc78d9d2fd413b81510015cf9a73ff to your computer and use it in GitHub Desktop.
module rcube(v, r, center=false, $fn=40) translate(center ? [-v[0]/2,-v[1]/2,-v[2]/2] : [0,0,0]) hull() {
translate([r,r, r]) sphere(r=r); translate([r, r, v[2]-r]) sphere(r=r);
translate([v[0]-r, r, r]) sphere(r=r); translate([v[0]-r, r, v[2]-r]) sphere(r=r);
translate([r, v[1]-r,r]) sphere(r=r); translate([r, v[1]-r,v[2]-r]) sphere(r=r);
translate([v[0]-r, v[1]-r,r]) sphere(r=r); translate([v[0]-r, v[1]-r,v[2]-r]) sphere(r=r);
}
translate([0, 20, 0]) rcube([15,10,20], r=1, center=false);
translate([0, 0, 0]) cube([15,10,20], center=false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment