From e8cc5a15ea743f20600874b0edbf523c82602483 Mon Sep 17 00:00:00 2001 From: secretspecter Date: Mon, 29 Apr 2024 15:17:50 -0600 Subject: [PATCH] snaptron --- snaptron.scad | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 snaptron.scad 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