Add closable fixed clip

This commit is contained in:
Dejvino 2021-01-19 11:51:51 +01:00
parent a7c184e6cb
commit b85aee5fe1

View File

@ -1,13 +1,14 @@
links_count=6; // [1..20]
include_terminal=true; // [true,false]
export=5; // [0:5]
export=3; // [0:6]
MODEL_DEMO=0;
MODEL_LINKS=1;
MODEL_CLIP=2;
MODEL_CLIP_RATCHETING=3;
MODEL_CLIP_RATCHETING_A=4;
MODEL_CLIP_RATCHETING_B=5;
MODEL_CLIP_A=2;
MODEL_CLIP_B=3;
MODEL_CLIP_RATCHETING=4;
MODEL_CLIP_RATCHETING_A=5;
MODEL_CLIP_RATCHETING_B=6;
//validation=1;
VALIDATE_INTERSECTION=1;
@ -123,16 +124,58 @@ module clip() {
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];
entry_size=[slot_size.x-5, clip_size.y+1, clip_size.z];
right(clip_size.x/2)
entry_size=[slot_size.x, clip_size.y+1, clip_size.z];
entry_pos=[0, 0, 1.5];
module socket_area() {
$fn=$preview? 10 : 20;
xrot(90) down(size.y/2) cylinder(d=size.z, h=size.y);
}
module socket_cutout() {
$fn=$preview? 10 : 20;
xrot(90) down(slot_size.y/2) cylinder(d=slot_size.z, h=slot_size.y);
}
module cover() {
translate(entry_pos) cube(entry_size, center=true);
}
module joiner(groove) {
slack=groove?0.5:0;
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];
translate(joiner_pos) cube(joiner_size, center=true);
}
module model() {
difference() {
cuboid(size, fillet=1);
cuboid(slot_size, fillet=1);
up(entry_size.z/2) cube(entry_size, center=true);
union() {
right(clip_size.x/2) socket_area();
left(clip_size.x/2) socket_area();
cube(clip_size, center=true);
}
right(clip_size.x/2) socket_cutout();
left(clip_size.x/2) socket_cutout();
}
}
module clip_ratcheting(ratchet_length=20) {
right(clip_size.x/2)
if (is_model(MODEL_CLIP_A)) {
difference() {
model();
cover();
}
joiner(groove=false);
} else if (is_model(MODEL_CLIP_B)) {
difference() {
intersection() {
model();
cover();
}
joiner(groove=true);
}
}
}
module clip_ratcheting(ratchet_length=30) {
socket_size=get_link_socket_size();
clip_size=get_link_clip_size();
pin_diam=get_link_pin_diameter();
@ -158,7 +201,7 @@ module clip_ratcheting(ratchet_length=20) {
scale([-1, 1, 1]) hook();
}
wall=2;
tooth_size=[2, 3, 3];
tooth_size=[4, 3, 3];
module tooth() {
s=[tooth_size.x, tooth_size.z, tooth_size.y];
up(tooth_size.z/2) xrot(-90) right_triangle(s);
@ -196,27 +239,28 @@ module clip_ratcheting(ratchet_length=20) {
teethBack();
}
}
ratchet_tooth_count=3;
ratchet_wall=3;
ratchet_tooth_count=2;
ratchet_wall=2.5;
ratchet_slack=0.3;
rail_slack=0.2;
ratchet_tooth_scale_z=0.8;
module ratchetTeethFront() {
module ratchetButton() {
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);
up(2) back(ratchet_wall/2) cube([size.x, ratchet_wall, tooth_size.z*ratchet_tooth_scale_z + size.z], center=true);
}
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,0.8]) tooth();
right(i*tooth_size.x) scale([-1,-1*(1-i/5),ratchet_tooth_scale_z]) 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/2 - ratchet_slack)
down(wall/2+0.5) cube([ratchet_length + wall, ratchet_wall, tooth_size.z], center=true);
down(wall/2+0.5) cube([ratchet_length + wall, ratchet_wall, tooth_size.z*ratchet_tooth_scale_z], center=true);
}
ratchetWall();
}
@ -235,7 +279,7 @@ module clip_ratcheting(ratchet_length=20) {
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];
size=[ratchet_length, clip_size.y/2 - ratchet_wall*2 - wall/2 - ratchet_slack - tooth_size.y, clip_size.z];
right(size.x/2) cube(size, center=true);
}
module slideRailRight() {
@ -287,7 +331,7 @@ if (!is_undef(validation)) {
down(50) cube([100, 100, 100], center=true);
}
union() {
if (is_model(MODEL_CLIP)) {
if (is_model(MODEL_CLIP_A) || is_model(MODEL_CLIP_B)) {
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)) {