commit e8cc5a15ea743f20600874b0edbf523c82602483 Author: secretspecter Date: Mon Apr 29 15:17:50 2024 -0600 snaptron diff --git a/snaptron.scad b/snaptron.scad new file mode 100644 index 0000000..008c3bd --- /dev/null +++ b/snaptron.scad @@ -0,0 +1,40 @@ +// polygon quality +$fn=60; //[20:10:200] + +// for the ball and the socket +radius=5; //[1:.5:25] + +// how deeply the ball snaps into the socket +inset=1.5; //[0:.1:25] + +// how long it be +stem_length=1; //[1:.5:100] + +// how thick the stem should be +stem_radius=radius * .5; //[.5:.5:24] + +// added to the radius of the socket to make wiggle room, if desired +play=0; //[0:.1:1] + +// without some padding the socket cuts too closely to the edge of the cylinder it is in +padding=.1; //[0.1:.1:1] + +union() { + // socket + difference() { + cylinder(radius + inset + play, radius + padding + play, radius + padding + play); + translate([0, 0, inset]) { + sphere(radius + play); + } + } + + // stem + translate([0, 0, radius + inset + play]) { + cylinder(stem_length, stem_radius, stem_radius); + } + + // ball + translate([0, 0, radius * 2 - 1 + stem_length + inset]) { + sphere(radius); + } + } \ No newline at end of file