|
|
@@ -1,6 +1,6 @@ |
|
|
|
links_count=6; // [1..20] |
|
|
|
include_terminal=true; // [true,false] |
|
|
|
export=4; // [0:5] |
|
|
|
export=5; // [0:5] |
|
|
|
|
|
|
|
MODEL_DEMO=0; |
|
|
|
MODEL_LINKS=1; |
|
|
@@ -138,7 +138,7 @@ module clip_ratcheting(ratchet_length=20) { |
|
|
|
pin_diam=get_link_pin_diameter(); |
|
|
|
slot_slack=get_link_socket_slack(); |
|
|
|
size=[clip_size.x+socket_size.x, clip_size.y, clip_size.z]; |
|
|
|
slot_size=[clip_size.x+slot_slack.x, size.y+1, pin_diam+slot_slack.z]; |
|
|
|
slot_size=[clip_size.x+slot_slack.x + 0.2, size.y+1, pin_diam+slot_slack.z]; |
|
|
|
entry_size=[slot_size.x-5, clip_size.y+1, clip_size.z]; |
|
|
|
//right(clip_size.x/2) |
|
|
|
module hook() { |
|
|
@@ -158,7 +158,7 @@ module clip_ratcheting(ratchet_length=20) { |
|
|
|
scale([-1, 1, 1]) hook(); |
|
|
|
} |
|
|
|
wall=2; |
|
|
|
tooth_size=[2, 2, 3]; |
|
|
|
tooth_size=[2, 3, 3]; |
|
|
|
module tooth() { |
|
|
|
s=[tooth_size.x, tooth_size.z, tooth_size.y]; |
|
|
|
up(tooth_size.z/2) xrot(-90) right_triangle(s); |
|
|
@@ -187,29 +187,35 @@ module clip_ratcheting(ratchet_length=20) { |
|
|
|
difference() { |
|
|
|
cube([ratchet_length, clip_size.y, clip_size.z], center=true); |
|
|
|
up(wall/2) cube([ratchet_length, clip_size.y-wall*2, clip_size.z], center=true); |
|
|
|
right(ratchet_length/2+1) { |
|
|
|
slideRailGuide(groove=true); |
|
|
|
scale([1,-1,1]) slideRailGuide(groove=true); |
|
|
|
} |
|
|
|
} |
|
|
|
teethFwd(); |
|
|
|
teethBack(); |
|
|
|
} |
|
|
|
} |
|
|
|
ratchet_tooth_count=3; |
|
|
|
ratchet_wall=1; |
|
|
|
ratchet_wall=3; |
|
|
|
ratchet_slack=0.3; |
|
|
|
rail_slack=0.2; |
|
|
|
module ratchetTeethFront() { |
|
|
|
module ratchetButton() { |
|
|
|
size=[3,wall*4,2]; |
|
|
|
up(4) fwd(wall*2 - ratchet_wall) cuboid(size, fillet=1, edges=EDGES_FRONT); |
|
|
|
up(2) back(wall/2) cube([size.x, wall, tooth_size.z + size.z], center=true); |
|
|
|
size=[8,wall*4,4]; |
|
|
|
up(size.z+1) fwd(wall*2 - ratchet_wall) cuboid(size, fillet=1, edges=EDGES_FRONT); |
|
|
|
up(2) back(ratchet_wall/2) cube([size.x, ratchet_wall, tooth_size.z + size.z], center=true); |
|
|
|
} |
|
|
|
fwd((clip_size.y-wall*2)/2 - tooth_size.y - 0.5) |
|
|
|
fwd((clip_size.y-wall*2)/2 - tooth_size.y - ratchet_slack) |
|
|
|
left(ratchet_length) { |
|
|
|
for (i=[0:ratchet_tooth_count-1]) { |
|
|
|
right(i*tooth_size.x) scale([-1,-1,1]) tooth(); |
|
|
|
right(i*tooth_size.x) scale([-1,-1,0.8]) tooth(); |
|
|
|
} |
|
|
|
ratchetButton(); |
|
|
|
} |
|
|
|
|
|
|
|
module ratchetWall() { |
|
|
|
up(tooth_size.z/2) left(ratchet_length/2 + wall - wall/2) fwd(clip_size.y/2-wall-tooth_size.y-ratchet_wall) |
|
|
|
up(tooth_size.z/2) left(ratchet_length/2 + wall - wall/2) fwd(clip_size.y/2-wall-tooth_size.y-ratchet_wall/2 - ratchet_slack) |
|
|
|
down(wall/2+0.5) cube([ratchet_length + wall, ratchet_wall, tooth_size.z], center=true); |
|
|
|
} |
|
|
|
ratchetWall(); |
|
|
@@ -218,21 +224,47 @@ module clip_ratcheting(ratchet_length=20) { |
|
|
|
scale([1,-1,1]) ratchetTeethFront(); |
|
|
|
} |
|
|
|
module ratchetRight() { |
|
|
|
left(wall/2) cube([wall, clip_size.y, clip_size.z], center=true); |
|
|
|
left(wall) cube([wall*2, clip_size.y + rail_slack*2, clip_size.z], center=true); |
|
|
|
|
|
|
|
ratchetTeethFront(); |
|
|
|
ratchetTeethBack(); |
|
|
|
} |
|
|
|
module slideRailGuide(groove) { |
|
|
|
size=[ratchet_length, wall, wall]; |
|
|
|
fwd(clip_size.y/2 + rail_slack) |
|
|
|
left(size.x/2) scale(groove?1.5:1) cuboid(size, fillet=0.5); |
|
|
|
} |
|
|
|
module slideRailLeft() { |
|
|
|
size=[ratchet_length, clip_size.y/2 - ratchet_wall*2 - wall - ratchet_slack - tooth_size.y, clip_size.z]; |
|
|
|
right(size.x/2) cube(size, center=true); |
|
|
|
} |
|
|
|
module slideRailRight() { |
|
|
|
size=[ratchet_length + 3, wall*1.5, clip_size.z]; |
|
|
|
module railFront() { |
|
|
|
fwd(clip_size.y/2 + size.y/2 + rail_slack) left(size.x/2) |
|
|
|
cuboid(size, fillet=1, edges=EDGES_FRONT); |
|
|
|
slideRailGuide(groove=false); |
|
|
|
} |
|
|
|
module railBack() { |
|
|
|
scale([1, -1, 1]) railFront(); |
|
|
|
} |
|
|
|
railFront(); |
|
|
|
railBack(); |
|
|
|
} |
|
|
|
|
|
|
|
if (is_model(MODEL_CLIP_RATCHETING_A) || is_model(MODEL_CLIP_RATCHETING)) { |
|
|
|
left(ratchet_length + wall + 1) { |
|
|
|
hookLeft(); |
|
|
|
left(0.5) ratchetLeft(); |
|
|
|
left(0.1) { |
|
|
|
ratchetLeft(); |
|
|
|
slideRailLeft(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (is_model(MODEL_CLIP_RATCHETING_B) || is_model(MODEL_CLIP_RATCHETING)) { |
|
|
|
ratchetRight(); |
|
|
|
hookRight(); |
|
|
|
slideRailRight(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@@ -249,23 +281,23 @@ if (!is_undef(validation)) { |
|
|
|
right(2*segment_size.x) link(); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (!is_undef(xray)) { |
|
|
|
intersection() { |
|
|
|
cube([1000, 1000, 1000]); |
|
|
|
for (i = [0:links_count-1]) { |
|
|
|
right(i*segment_size.x) link(); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
if (is_model(MODEL_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)) { |
|
|
|
left(get_link_clip_size().x) clip_ratcheting(); |
|
|
|
} |
|
|
|
if (is_model(MODEL_LINKS)) for (i = [0:links_count-1]) { |
|
|
|
terminal=(i==links_count-1) && include_terminal; |
|
|
|
right(i*segment_size.x) link(terminal=terminal); |
|
|
|
intersection () { |
|
|
|
if (!is_undef(xray)) { |
|
|
|
down(50) cube([100, 100, 100], center=true); |
|
|
|
} |
|
|
|
union() { |
|
|
|
if (is_model(MODEL_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)) { |
|
|
|
left(get_link_clip_size().x) clip_ratcheting(); |
|
|
|
} |
|
|
|
if (is_model(MODEL_LINKS)) for (i = [0:links_count-1]) { |
|
|
|
terminal=(i==links_count-1) && include_terminal; |
|
|
|
right(i*segment_size.x) link(terminal=terminal); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|