dos2unix, decrease thickness, code clean up

This commit is contained in:
Felix Pankratz 2025-04-25 18:49:59 +02:00
parent 24fbf922fa
commit a6270a26d2

View File

@ -1,62 +1,48 @@
use <threads.scad>; use <threads.scad>;
$fa = 1; $fa = 1;
$fs = 0.4; $fs = 0.4;
outer_radius = 30; outer_radius = 30;
height_total = 35; height_total = 35;
thickness = 3; thickness = 2;
cap_height = 10; cap_height = 10;
inner_radius = outer_radius - thickness; inner_radius = outer_radius - thickness;
height_base = height_total - cap_height; height_base = height_total - cap_height;
height_thread = cap_height - thickness; height_thread = cap_height - thickness;
thread_radius = inner_radius + (thickness / 2); thread_radius = inner_radius + (thickness / 2);
// base shape // base shape
difference() { difference() {
cylinder(h=height_base, r=outer_radius); cylinder(h=height_base, r=outer_radius);
translate([0, 0, thickness]) translate([0, 0, thickness])
cylinder(h=height_base, r = inner_radius); cylinder(h=height_base, r = inner_radius);
} }
// divider // 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);
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])
// divider stage 2 cube([inner_radius*2 - (thickness * 3), thickness, height_thread+0.01], center=true);
translate([0, 0, height_base + (height_thread/2) - 0.01])
cube([inner_radius*2 - thickness * 2, thickness, height_thread+0.01], center=true); // thread and neck
translate([0, 0, height_base - 1]) {
// thread (neck) difference() {
union() {
//translate([0, 0, height_base - 0.01]) { ScrewThread( thread_radius*2, height_thread + 1, pitch=4);
// difference(){ cylinder(h = 1, r=outer_radius);
// cylinder(h=height_thread + 0.01, r=outer_radius - (thickness / 2)); }
// translate([0,0,-0.01]) translate([0, 0, -0.01])
// cylinder(h=height_thread + 1, r=inner_radius); cylinder(h=height_thread+2, r=thread_radius - thickness*2);
// } }
//} }
translate([0, 0, height_base - 1]) { // cap
difference() { translate([70, 0, cap_height]) rotate([180, 0,0]) {
union() { ScrewHole(thread_radius * 2, cap_height - thickness, pitch=4)
ScrewThread( thread_radius*2, height_thread + 1, pitch=4); cylinder(h=cap_height, r=outer_radius);
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) {