luniebox/hardware/case/square/luniebox-helper.scad

74 lines
1.4 KiB
OpenSCAD
Raw Permalink Normal View History

2022-02-06 10:19:03 +01:00
$fa = 1;
$fs = 0.05;
render_limiter = 0.001;
depth = 2;
2022-03-13 09:28:58 +01:00
length = 120;
width = 120;
height = 120;
2022-02-06 10:19:03 +01:00
2022-03-13 09:28:58 +01:00
front_offset=10+depth*2;
clip_space=30;
2022-02-06 10:19:03 +01:00
clip_d=5;
clip_h=6;
clip_length_space=length - clip_space + depth;
clip_width_space=width - clip_space + depth;
clip_height_space=height - clip_space + depth;
module clip_screw() {
d=clip_d;
h=clip_h;
translate([0,0,d/2+depth])
rotate([-90,0,0])
difference() {
union() {
cylinder(d=d,h=h);
translate([-d/2,0,0])
cube([d,d/2,h]);
}
translate([0,0,-render_limiter])
cylinder(d=d/2,h=h+render_limiter*2);
}
}
module clip_hole(h=0) {
d=clip_d;
translate([0,0,-render_limiter])
cylinder(d=d/2,h=h+depth+render_limiter * 2);
}
module clip(width=15) {
translate([-render_limiter,-render_limiter,-render_limiter])
cube([width +render_limiter * 2,depth + render_limiter * 2,depth + render_limiter * 2]);
}
2022-03-13 09:28:58 +01:00
module screw_hole(depth=0,d=clip_d/2,height=clip_h) {
2022-02-06 10:19:03 +01:00
z= -depth - render_limiter;
2022-03-13 09:28:58 +01:00
h=height+depth+1;
2022-02-06 10:19:03 +01:00
translate([0,0,z])
cylinder(d=d,h=h);
}
module screw(d=clip_d,h=clip_h) {
difference() {
cylinder(d=d,h=h);
2022-03-13 09:28:58 +01:00
screw_hole(d=d/2,height=h);
2022-02-06 10:19:03 +01:00
}
}
module rounded_cube(s=[1,1,1],r=0.5) {
x = s[0];
y = s[1];
z = s[2];
mx = x - 2*r;
my = y - 2*r;
mz = z / 2;
minkowski() {
cube([mx,my,mz]);
translate([r,r,-render_limiter])
cylinder(r=r,h=mz+render_limiter*2);
}
}