Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
OpenSCAD Spherical Cap
module spherical_cap(height,diameter) {
R=(pow(diameter/2,2)+pow(height,2))/(height*2);
translate([0,0,-R+height])difference() {
sphere(r=R,$fn=100);
translate([0,0,-height])cube(size=[R*2,R*2,R*2], center=true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment