Skip to content

Instantly share code, notes, and snippets.

@majabojarska
Created July 30, 2019 18:21
Show Gist options
  • Save majabojarska/449cd900a24266022bd6c1ef67552305 to your computer and use it in GitHub Desktop.
Save majabojarska/449cd900a24266022bd6c1ef67552305 to your computer and use it in GitHub Desktop.
OpenSCAD Custom Shim Generator
/*
This script generates a custom shim based
on the given parameter values
*/
$fn=50;
internal_diameter=4;
external_diameter=8;
height=4;
Shim(internal_diameter, external_diameter, height);
module Shim(int_diam, ext_diam, height){
assert(int_diam < ext_diam);
assert(height > 0);
difference(){
cylinder(h=height,d=ext_diam);
translate([0,0,-1]) cylinder(h=height+2,d=int_diam);
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment