split_reel/split_reel.scad

87 lines
2.8 KiB
OpenSCAD

include <./common/common.scad>;
include <./common/threads.scad>;
Core16mm = 25.5;
PlatterThickness = 1.6;
Platter120m = 178;
module thread_16mm ( pos = [0, 0, 0], length = 11, chamfer = false, pad = 0) {
translate(pos) {
if (chamfer) {
metric_thread (diameter=18.5, pitch=1.5, length=length, internal=false, n_starts=1, thread_size=-1, groove=false, square=false, rectangle=0, angle=30, taper=0, leadin=2, leadfac=1.5);
} else {
metric_thread (diameter=18.5, pitch=1.5, length=length, internal=false, n_starts=1, thread_size=-1, groove=false, square=false, rectangle=0, angle=30, taper=0, leadin=0, leadfac=1.5);
}
}
}
module threaded_core (pos = [0, 0, 0], format = "16mm") {
$fn = 120;
translate (pos) {
if (format == "16mm") {
union () {
cylinder(r = R(Core16mm), h = 6, center = true);
thread_16mm([0, 0, 0], length = 11, chamfer = true);
}
}
}
}
module socket_core (pos = [0, 0, 0], format = "16mm") {
$fn = 120;
translate (pos) {
if (format == "16mm") {
difference () {
cylinder(r = R(Core16mm), h = 11, center = true);
}
}
}
}
module platter (pos = [0, 0, 0], length = 120) {
if (length == 120) {
difference () {
cylinder(r = R(Platter120m), h = PlatterThickness, center = true, $fn = 300);
for (i = [0 : 3]) {
rotate([0, 0, i * 90]) translate([105 / 2, 0, 0]) cylinder(r = R(44.5), h = PlatterThickness + 1, center = true, $fn = 100);
}
}
}
}
//length in meters
module split_reel (format = "16mm", length = 120, half = "A") {
if (half == "A") {
difference () {
union () {
platter([0, 0, 0], length = length);
threaded_core([0, 0, (PlatterThickness / 2) + (6 / 2)], format = "16mm");
rotate([0, 0, 135]) translate([18.5, 0, (PlatterThickness / 2) + (4.75 / 2)]) cylinder(r = R(6.25), h = 4.75, center = true, $fn = 60);
}
if (format == "16mm") {
cube([8.5, 8.5, 50], center = true);
rotate([0, 0, 45]) translate([5.5, 0, 0]) cube([3, 3, 50], center = true);
}
}
} else if (half == "B") {
difference () {
union () {
platter([0, 0, 0], length = length);
socket_core([0, 0, (PlatterThickness / 2) + (11 / 2)], format = "16mm");
}
rotate([180, 0, 0]) scale([1.02, 1.02, 1]) {
thread_16mm([0, 0, -13], 15);
thread_16mm([0, 0, -13.1], 15);
}
}
}
}
PART = "split_reel_16mm_120m_A";
if (PART == "split_reel_16mm_120m_A") {
split_reel("16mm", 120, "A");
} else if (PART == "split_reel_16mm_120m_B") {
split_reel("16mm", 120, "B");
}