Improved link strap interoperability
This commit is contained in:
parent
b85aee5fe1
commit
f17455be4f
144
strap_link.scad
144
strap_link.scad
@ -1,6 +1,6 @@
|
|||||||
links_count=6; // [1..20]
|
links_count=3; // [1..20]
|
||||||
include_terminal=true; // [true,false]
|
include_terminal=true; // [true,false]
|
||||||
export=3; // [0:6]
|
export=0; // [0:6]
|
||||||
|
|
||||||
MODEL_DEMO=0;
|
MODEL_DEMO=0;
|
||||||
MODEL_LINKS=1;
|
MODEL_LINKS=1;
|
||||||
@ -33,6 +33,7 @@ function get_link_socket_size() = [get_link_segment_size().z,
|
|||||||
get_link_segment_size().z];
|
get_link_segment_size().z];
|
||||||
|
|
||||||
function get_link_clip_size() = [get_link_pin_diameter()*5, get_link_segment_size().y - 5, get_link_segment_size().z];
|
function get_link_clip_size() = [get_link_pin_diameter()*5, get_link_segment_size().y - 5, get_link_segment_size().z];
|
||||||
|
function get_link_socket_roundgap() = 2;
|
||||||
|
|
||||||
echo("===============================");
|
echo("===============================");
|
||||||
echo(str("Strap length: ", (links_count * get_link_segment_size().x), " mm"));
|
echo(str("Strap length: ", (links_count * get_link_segment_size().x), " mm"));
|
||||||
@ -41,46 +42,68 @@ echo("===============================");
|
|||||||
assert(get_link_segment_size().x >= 10, "Link segment is too short.");
|
assert(get_link_segment_size().x >= 10, "Link segment is too short.");
|
||||||
assert(get_link_segment_size().z >= (get_link_pin_diameter() + get_link_socket_slack().z + 1), "Link segment is too thin.");
|
assert(get_link_segment_size().z >= (get_link_pin_diameter() + get_link_socket_slack().z + 1), "Link segment is too thin.");
|
||||||
|
|
||||||
module link(terminal=false) {
|
module pin() {
|
||||||
segment_size=get_link_segment_size();
|
segment_size=get_link_segment_size();
|
||||||
module pin() {
|
h=segment_size.y;
|
||||||
h=segment_size.y;
|
d=get_link_pin_diameter();
|
||||||
d=get_link_pin_diameter();
|
back(h/2) xrot(90) cylinder(h=h, d=d, $fn=$preview ? 10 : 30);
|
||||||
back(h/2) xrot(90) cylinder(h=h, d=d, $fn=$preview ? 10 : 30);
|
}
|
||||||
|
module pin_socket_area() {
|
||||||
|
segment_size=get_link_segment_size();
|
||||||
|
h=segment_size.y-get_link_socket_slack().y;
|
||||||
|
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();
|
||||||
|
scaleup = [
|
||||||
|
((get_link_pin_diameter() + get_link_socket_slack().x) / get_link_pin_diameter()),
|
||||||
|
((get_link_pin_diameter() + get_link_socket_slack().y) / get_link_pin_diameter()),
|
||||||
|
((get_link_pin_diameter() + get_link_socket_slack().z) / get_link_pin_diameter())
|
||||||
|
];
|
||||||
|
scale(scaleup) pin();
|
||||||
}
|
}
|
||||||
module pin_socket_area() {
|
}
|
||||||
h=segment_size.y-get_link_socket_slack().y;
|
|
||||||
d=segment_size.z;
|
module arm() {
|
||||||
back(h/2) xrot(90) cylinder(h=h, d=d, $fn=$preview ? 10 : 30);
|
arm_size=get_link_joiner_arm_size();
|
||||||
}
|
fwd(segment_size.y/2 + arm_size.y/2 - 1) right(arm_size.x/2 - 1) cuboid(arm_size, fillet=1, edges=EDGES_FRONT + EDGES_Y_ALL);
|
||||||
module pin_socket() {
|
}
|
||||||
difference() {
|
module armFront() {
|
||||||
pin_socket_area();
|
arm();
|
||||||
scaleup = [
|
}
|
||||||
((get_link_pin_diameter() + get_link_socket_slack().x) / get_link_pin_diameter()),
|
module armBack() {
|
||||||
((get_link_pin_diameter() + get_link_socket_slack().y) / get_link_pin_diameter()),
|
scale([1, -1, 1]) arm();
|
||||||
((get_link_pin_diameter() + get_link_socket_slack().z) / get_link_pin_diameter())
|
}
|
||||||
];
|
module armJoiner() {
|
||||||
scale(scaleup) pin();
|
gap=get_link_socket_roundgap();
|
||||||
}
|
arm_size=get_link_joiner_arm_size();
|
||||||
}
|
joiner_size=[arm_size.x-get_link_socket_size().x, segment_size.y, segment_size.z];
|
||||||
module joiner() {
|
right(joiner_size.x/2 + get_link_socket_size().x/2 + gap) cuboid(joiner_size, fillet=1, edges=EDGES_Z_ALL + EDGES_BOTTOM);
|
||||||
gap=2;
|
}
|
||||||
|
module link_arms() {
|
||||||
|
armFront();
|
||||||
|
armBack();
|
||||||
|
armJoiner();
|
||||||
|
}
|
||||||
|
|
||||||
|
module link_connector_pin() {
|
||||||
|
pin();
|
||||||
|
link_arms();
|
||||||
|
}
|
||||||
|
|
||||||
|
module link_connector_socket() {
|
||||||
|
pin_socket();
|
||||||
|
}
|
||||||
|
|
||||||
|
module link(terminal=false) {
|
||||||
|
|
||||||
|
module link_joiner() {
|
||||||
|
gap=get_link_socket_roundgap();
|
||||||
arm_size=get_link_joiner_arm_size();
|
arm_size=get_link_joiner_arm_size();
|
||||||
module arm() {
|
|
||||||
fwd(segment_size.y/2 + arm_size.y/2 - 1) right(arm_size.x/2 - 1) cuboid(arm_size, fillet=1, edges=EDGES_FRONT + EDGES_Y_ALL);
|
module pin_to_socket_joiner() {
|
||||||
}
|
|
||||||
module armFront() {
|
|
||||||
arm();
|
|
||||||
}
|
|
||||||
module armBack() {
|
|
||||||
scale([1, -1, 1]) arm();
|
|
||||||
}
|
|
||||||
module armJoiner() {
|
|
||||||
joiner_size=[arm_size.x-get_link_socket_size().x, segment_size.y, segment_size.z];
|
|
||||||
right(joiner_size.x/2 + get_link_socket_size().x/2 + gap) cuboid(joiner_size, fillet=1, edges=EDGES_Z_ALL + EDGES_BOTTOM);
|
|
||||||
}
|
|
||||||
module socketJoiner() {
|
|
||||||
joiner_size=[segment_size.x-get_link_socket_size().x+get_link_socket_size().x*0.2,
|
joiner_size=[segment_size.x-get_link_socket_size().x+get_link_socket_size().x*0.2,
|
||||||
segment_size.y-4,
|
segment_size.y-4,
|
||||||
segment_size.z];
|
segment_size.z];
|
||||||
@ -89,31 +112,16 @@ module link(terminal=false) {
|
|||||||
right(segment_size.x) scale([1, 2, 1]) pin_socket_area();
|
right(segment_size.x) scale([1, 2, 1]) pin_socket_area();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
module terminalArm() {
|
|
||||||
left(5) {
|
pin_to_socket_joiner();
|
||||||
shift=arm_size.x - get_link_pin_diameter();
|
|
||||||
right(segment_size.x + shift + gap/2) pin();
|
|
||||||
right(segment_size.x + gap/2) {
|
|
||||||
armFront();
|
|
||||||
armBack();
|
|
||||||
}
|
|
||||||
right(arm_size.x - get_link_socket_size().x + gap) armJoiner();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
armFront();
|
|
||||||
armBack();
|
|
||||||
armJoiner();
|
|
||||||
if (terminal) {
|
|
||||||
terminalArm();
|
|
||||||
} else {
|
|
||||||
socketJoiner();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pin();
|
link_connector_pin();
|
||||||
joiner();
|
if (terminal) {
|
||||||
if (!terminal) {
|
right(segment_size.x + 2) zrot(180) link_connector_pin();
|
||||||
right(segment_size.x) pin_socket();
|
} else {
|
||||||
|
link_joiner();
|
||||||
|
right(segment_size.x) link_connector_socket();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,7 +149,7 @@ module clip() {
|
|||||||
module joiner(groove) {
|
module joiner(groove) {
|
||||||
slack=groove?0.5:0;
|
slack=groove?0.5:0;
|
||||||
joiner_size=[entry_size.x-6+slack, entry_size.y-6+slack, entry_size.z-4+slack];
|
joiner_size=[entry_size.x-6+slack, entry_size.y-6+slack, entry_size.z-4+slack];
|
||||||
joiner_pos=[entry_pos.x, entry_pos.y, entry_pos.z - entry_size.z/2];
|
joiner_pos=[entry_pos.x, entry_pos.y, entry_pos.z - entry_size.z/2 + joiner_size.z/2];
|
||||||
translate(joiner_pos) cube(joiner_size, center=true);
|
translate(joiner_pos) cube(joiner_size, center=true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,7 +183,7 @@ module clip() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module clip_ratcheting(ratchet_length=30) {
|
module clip_ratcheting(ratchet_length=28) {
|
||||||
socket_size=get_link_socket_size();
|
socket_size=get_link_socket_size();
|
||||||
clip_size=get_link_clip_size();
|
clip_size=get_link_clip_size();
|
||||||
pin_diam=get_link_pin_diameter();
|
pin_diam=get_link_pin_diameter();
|
||||||
@ -195,10 +203,10 @@ module clip_ratcheting(ratchet_length=30) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
module hookRight() {
|
module hookRight() {
|
||||||
hook();
|
right(12.5) zrot(180) link_connector_pin();
|
||||||
}
|
}
|
||||||
module hookLeft() {
|
module hookLeft() {
|
||||||
scale([-1, 1, 1]) hook();
|
left(12.5) link_connector_pin();
|
||||||
}
|
}
|
||||||
wall=2;
|
wall=2;
|
||||||
tooth_size=[4, 3, 3];
|
tooth_size=[4, 3, 3];
|
||||||
@ -296,7 +304,7 @@ module clip_ratcheting(ratchet_length=30) {
|
|||||||
railBack();
|
railBack();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_model(MODEL_CLIP_RATCHETING_A) || is_model(MODEL_CLIP_RATCHETING)) {
|
left(2) if (is_model(MODEL_CLIP_RATCHETING_A) || is_model(MODEL_CLIP_RATCHETING)) {
|
||||||
left(ratchet_length + wall + 1) {
|
left(ratchet_length + wall + 1) {
|
||||||
hookLeft();
|
hookLeft();
|
||||||
left(0.1) {
|
left(0.1) {
|
||||||
@ -335,7 +343,7 @@ if (!is_undef(validation)) {
|
|||||||
left(get_link_clip_size().x) clip();
|
left(get_link_clip_size().x) clip();
|
||||||
}
|
}
|
||||||
if (is_model(MODEL_CLIP_RATCHETING) || is_model(MODEL_CLIP_RATCHETING_A) || is_model(MODEL_CLIP_RATCHETING_B)) {
|
if (is_model(MODEL_CLIP_RATCHETING) || is_model(MODEL_CLIP_RATCHETING_A) || is_model(MODEL_CLIP_RATCHETING_B)) {
|
||||||
left(get_link_clip_size().x) clip_ratcheting();
|
left(get_link_clip_size().x * 2 + 3) clip_ratcheting();
|
||||||
}
|
}
|
||||||
if (is_model(MODEL_LINKS)) for (i = [0:links_count-1]) {
|
if (is_model(MODEL_LINKS)) for (i = [0:links_count-1]) {
|
||||||
terminal=(i==links_count-1) && include_terminal;
|
terminal=(i==links_count-1) && include_terminal;
|
||||||
|
Loading…
Reference in New Issue
Block a user