Clean up bottom screw script, add ALT and HEX parameters to change the design.

This commit is contained in:
mmcwilliams 2018-03-05 14:55:51 -05:00
parent ce5b2b9ff2
commit cebe5d2310
1 changed files with 65 additions and 44 deletions

View File

@ -1,69 +1,90 @@
t = 0; t = 0;
include <../../libraries/threads.scad>; include <../../libraries/threads.scad>;
FINE = 60; //RESOLUTION
FINE = 200;
module base () { module base ( HEX = false) {
$fn = FINE; D = 8.45 * 2;
BUMP = 2; H = 20;
//for grip
BUMP = 2; //diameter
BUMPS = 6; BUMPS = 6;
TOP_D = 19;
TOP_H = 9.5; TOP_H = 9.5;
TOP_OFFSET = -24.5;
union() { union() {
translate([0, 0, -15])cylinder(r = 8.45, h = 20, center = true); translate([0, 0, -15]) {
//hex top cylinder(r = D / 2, h = H, center = true, $fn = FINE);
//translate([0, 0, -24.5])cylinder(r = 11.1, h = 9.5, center = true, $fn = 6); }
translate([0, 0, -24.5]) cylinder(r = 19 / 2, h = TOP_H, center = true); //hex version
if (HEX) {
translate([0, 0, TOP_OFFSET]) {
cylinder(r = 11.1, h = TOP_H, center = true, $fn = 6);
}
} else {
translate([0, 0, TOP_OFFSET]) {
cylinder(r = TOP_D / 2, h = TOP_H, center = true, $fn = FINE);
}
}
for (i = [0 : BUMPS]) { for (i = [0 : BUMPS]) {
rotate([0, 0, (360 / BUMPS) * i]) translate([0, 8.9, -24.5]) cylinder(r = BUMP, h = TOP_H, center = true, $fn = 60); rotate([0, 0, (360 / BUMPS) * i]) {
translate([0, 8.9, TOP_OFFSET]) {
cylinder(r = BUMP, h = TOP_H, center = true, $fn = 60);
}
}
} }
} }
} }
module lomo_bottom_screw (LEN = 27.1) { module outer_screw (LEN) {
difference () { OD = 10;
base(); PITCH = 1.5;
//negative cylinder (reference) THREAD = 1.6;
//translate([0, 0, -20]) cylinder(r = 13.6 / 2, h = 20, center = true, $fn = 100);
//negative plug (reference) difference () {
//translate([0, 0, -20]) cylinder(r = 12 / 2, h = 20, center = true, $fn = FINE); translate([0, 0, -7.1]) metric_thread (diameter=OD, pitch=PITCH, thread_size = THREAD, length=LEN);
//bevel top of screw
translate([0, 0, LEN - 8]) difference() {
cylinder(r = 8, h = 3, center = true, $fn = FINE);
cylinder(r1 = 6, r2 = 3, h = 3.01, center = true, $fn = FINE);
}
}
}
module lomo_bottom_screw (ALT = false, HEX = false) {
OD = 13.6 + .5;
PITCH = 1.5;
THREAD = 1.6;
IN_LEN = 21;
LEN = 17.1;
ALT_LEN = 27.1;
difference () {
base(HEX);
//inner screw negative
translate([0, 0, -30]) union() { translate([0, 0, -30]) union() {
metric_thread (diameter=13.6 + .5, pitch=1.5, thread_size = 1.6, length = 21); metric_thread (diameter=OD, pitch=PITCH, thread_size = THREAD, length = IN_LEN);
translate([0, 0, 0.2]) metric_thread (diameter=13.6 + .5, pitch=1.5, thread_size = 1.6, length = 21); translate([0, 0, 0.2]) {
metric_thread (diameter=OD, pitch=PITCH, thread_size = THREAD, length = IN_LEN);
}
} }
} }
difference () { difference () {
//outer screw //outer screw
translate([0, 0, -7.1]) metric_thread (diameter=10, pitch=1.5, length=LEN); if (ALT) {
translate([0, 0, 26]) cylinder(r = 8, h = 5, center = true, $fn = FINE); outer_screw(ALT_LEN);
//taper top of screw } else {
translate([0, 0, LEN - 4.2]) difference() { outer_screw(LEN);
cylinder(r = 8, h = 3, center = true, $fn = FINE);
cylinder(r1 = 6, r2 = 3, h = 3.01, center = true, $fn = FINE);
} }
//hollow center //hollow center
cylinder(r = 3.8 / 2, h = 100, center = true, $fn = 60); cylinder(r = 3.8 / 2, h = 100, center = true, $fn = 60);
} }
} }
difference() {
//color("green")
//center
translate([0, 0, 29]) lomo_bottom_screw();
//translate([-25, 0, 29]) cube([50, 50, 100], center = true); translate([0, 0, 29]) rotate([0, 0, t]) lomo_bottom_screw();
}
//translate([0, 0, 7]) cylinder(r = 13.6 / 2, h = 20, center = true, $fn = 100);
translate([0, 0, -20]) rotate([0, 0, t]) difference() {
//translate([-100, 0, 0])cube([200, 200, 200], center = true);
}
translate([0, 0, -30]) {
//metric_thread (diameter=13.6, pitch=1.5 ,thread_size = 1.6, length = 20);
}