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) {