Created
May 22, 2020 00:26
-
-
Save zikes/f4ee592ad66621aabc7395b2cf0ea34b to your computer and use it in GitHub Desktop.
OpenSCAD Spherical Cap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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