Created
December 30, 2019 01:39
-
-
Save jstults/e77dcc664ed8916147bce97b98989828 to your computer and use it in GitHub Desktop.
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
//CUSTOMIZER VARIABLES | |
// Overall radius of the sphere | |
sphereRadius = 30; | |
// Radius of each hole at the surface of the sphere | |
holeTopRadius = 5.5; | |
// Radius of each hole at the bottom of the hole | |
holeBottomRadius = 5; | |
// Depth of the hole | |
holeDepth = 12; | |
// number of holes at middle +/- 45 degree from z-axis row | |
n45 = 5; | |
// number of holes at equatorial, 90 degree, from z-axis row | |
n90 = 10; | |
//CUSTOMIZER VARIABLES END | |
module hole(holeTopRadius, holeBottomRadius, holeDepth, sphereRadius) { | |
translate([0,0,sphereRadius-holeDepth/2]) | |
cylinder(h=holeDepth, r1=holeBottomRadius, r2=holeTopRadius, center=true); | |
} | |
module holes(holeTopRadius, holeBottomRadius, holeDepth, sphereRadius) { | |
// top hole, z+ | |
hole(holeTopRadius, holeBottomRadius, holeDepth, sphereRadius); | |
// 5 holes around the circumference 45 degress from z+ top hole | |
for(i=[1:n45]){ | |
rotate([0,0,i*360/n45]) rotate([45,0,0]) hole(holeTopRadius, holeBottomRadius, holeDepth,sphereRadius); | |
} | |
// 10 holes around the circumference 90 degress from z+ top hole | |
for(i=[1:n90]){ | |
rotate([0,0,i*360/n90]) rotate([90,0,0]) hole(holeTopRadius, holeBottomRadius, holeDepth,sphereRadius); | |
} | |
// 5 holes around the circumference 135 degress from z+ top hole | |
for(i=[1:n45]){ | |
rotate([0,0,i*360/n45]) rotate([135,0,0]) hole(holeTopRadius, holeBottomRadius, holeDepth,sphereRadius); | |
} | |
// bottom hole, z- | |
rotate([180,0,0]) hole(holeTopRadius, holeBottomRadius, holeDepth, sphereRadius); | |
} | |
module crazyFortBall(sphereRadius, holeTopRadius, holeBottomRadius, holeDepth) { | |
difference() { | |
//union() { | |
sphere(r=sphereRadius); | |
holes(holeTopRadius, holeBottomRadius, holeDepth, sphereRadius); | |
} | |
} | |
crazyFortBall(sphereRadius, holeTopRadius, holeBottomRadius, holeDepth); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment