Add linked strap

This commit is contained in:
Dejvino 2021-01-17 16:21:13 +01:00
parent eddd8f28e7
commit 78e7a2b34a

84
strap_link.scad Normal file
View File

@ -0,0 +1,84 @@
links_count=3;
//validation=1;
VALIDATE_INTERSECTION=1;
use <BOSL/transforms.scad>
use <BOSL/shapes.scad>
include <BOSL/constants.scad>
function get_link_segment_size() = [10, 20, 5];
function get_link_pin_diameter() = 2;
module link() {
segment_size=get_link_segment_size();
module pin() {
h=segment_size.y;
d=get_link_pin_diameter();
back(h/2) xrot(90) cylinder(h=h, d=d, $fn=$preview ? 10 : 30);
}
module pin_socket_area() {
h=segment_size.y-3;
d=segment_size.z;
back(h/2) xrot(90) cylinder(h=h, d=d, $fn=$preview ? 10 : 30);
}
module pin_socket() {
difference() {
pin_socket_area();
scale(1.1) pin();
}
}
module joiner() {
gap=2;
module arm() {
arm_size=[segment_size.x*0.9, 2, segment_size.z];
fwd(segment_size.y/2) right(segment_size.x/4) cuboid(arm_size, fillet=1, edges=EDGES_FRONT + EDGES_Y_ALL);
}
module armFront() {
arm();
}
module armBack() {
scale([1, -1, 1]) arm();
}
module armJoiner() {
joiner_size=[4, segment_size.y, segment_size.z];
right(segment_size.x/2) cuboid(joiner_size, fillet=1, edges=EDGES_Z_ALL + EDGES_BOTTOM);
}
module socketJoiner() {
joiner_size=[segment_size.x-4,
segment_size.y-4,
segment_size.z];
difference() {
right(segment_size.x/2 + 2.5) cuboid(joiner_size, fillet=1, edges=EDGES_Z_ALL + EDGES_BOTTOM);
right(segment_size.x) scale([1, 2, 1]) pin_socket_area();
}
}
socketJoiner();
armFront();
armBack();
armJoiner();
}
pin();
right(segment_size.x) pin_socket();
joiner();
}
segment_size=get_link_segment_size();
if (!is_undef(validation)) {
if (validation==VALIDATE_INTERSECTION) {
intersection() {
right(0*segment_size.x) link();
right(1*segment_size.x) link();
}
intersection() {
right(1*segment_size.x) link();
right(2*segment_size.x) link();
}
}
} else {
for (i = [0:links_count-1]) {
right(i*segment_size.x) link();
}
}