From 24fbf922fa2f94c1fe1f92dfc3ea771532d3e98e Mon Sep 17 00:00:00 2001 From: Felix Pankratz Date: Fri, 25 Apr 2025 18:30:46 +0200 Subject: [PATCH] version 1 - confirmed working --- pills.scad | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 pills.scad diff --git a/pills.scad b/pills.scad new file mode 100644 index 0000000..cc63ac7 --- /dev/null +++ b/pills.scad @@ -0,0 +1,62 @@ +use ; +$fa = 1; +$fs = 0.4; + +outer_radius = 30; +height_total = 35; +thickness = 3; + +cap_height = 10; + +inner_radius = outer_radius - thickness; +height_base = height_total - cap_height; +height_thread = cap_height - thickness; + +thread_radius = inner_radius + (thickness / 2); + +// base shape +difference() { + cylinder(h=height_base, r=outer_radius); + translate([0, 0, thickness]) + cylinder(h=height_base, r = inner_radius); +} +// divider +//translate([-outer_radius + (thickness/2), 0, 0]) +// cube([outer_radius*2 - thickness, thickness, height_base ]); + +translate([0, 0, height_base/2 - 0.01]) + cube([outer_radius*2 - thickness * 2, thickness, height_base+0.01], center=true); + +// divider stage 2 +translate([0, 0, height_base + (height_thread/2) - 0.01]) + cube([inner_radius*2 - thickness * 2, thickness, height_thread+0.01], center=true); + +// thread (neck) + +//translate([0, 0, height_base - 0.01]) { +// difference(){ +// cylinder(h=height_thread + 0.01, r=outer_radius - (thickness / 2)); +// translate([0,0,-0.01]) +// cylinder(h=height_thread + 1, r=inner_radius); +// } +//} + +translate([0, 0, height_base - 1]) { + difference() { + union() { + ScrewThread( thread_radius*2, height_thread + 1, pitch=4); + cylinder(h = 1, r=outer_radius); + } + translate([0, 0, -0.01]) + cylinder(h=height_thread+2, r=thread_radius - thickness*2); + } +} + + +// cap +translate([70, 0, cap_height]) rotate([180, 0,0]) { + ScrewHole(thread_radius * 2, cap_height - thickness, pitch=4) + cylinder(h=cap_height, r=outer_radius); +} +//module ScrewHole(outer_diam, height, position=[0,0,0], rotation=[0,0,0], pitch=0, tooth_angle=30, tolerance=0.4, tooth_height=0) { +