luniebox/hardware/case/luniebox-helper.scad
2022-02-06 10:19:03 +01:00

74 lines
1.4 KiB
OpenSCAD

$fa = 1;
$fs = 0.05;
render_limiter = 0.001;
depth = 2;
length = 190;
width = 70;
height = 70;
clip_space=20;
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]);
}
module screw_hole(depth=0,d=clip_d/2) {
z= -depth - render_limiter;
h=7+depth;
translate([0,0,z])
cylinder(d=d,h=h);
}
module screw(d=clip_d,h=clip_h) {
difference() {
cylinder(d=d,h=h);
screw_hole(d=d/2);
}
}
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);
}
}