50 lines
No EOL
1.4 KiB
OpenSCAD
50 lines
No EOL
1.4 KiB
OpenSCAD
include <BOSL2/std.scad>
|
|
|
|
g_th = 4.5;
|
|
t = 2;
|
|
g_len = 70;
|
|
$fn = 46;
|
|
|
|
hinge_num = 5;
|
|
hinge_d = 5;
|
|
hinge_h = 2;
|
|
// do not edit
|
|
|
|
// clip-on glasses
|
|
diff("r") {
|
|
bez = bezpath_curve([[0,0], [6.5,g_len/2], [0,g_len]], N=2);
|
|
path_extrude2d(bezpath_curve(bez, N=2)) {
|
|
|
|
diff("R") {
|
|
square([g_th+2*t, g_th+t], anchor=TOP);
|
|
tag("R") square([g_th, g_th], anchor=TOP);
|
|
}
|
|
}
|
|
cuboid([g_th+2*t,t,(g_th+t)*2]);
|
|
tag("r") cuboid([g_th+2*t,g_th+2*t,g_th*2], anchor=FWD+RIGHT);
|
|
tag("r")back(g_len) cuboid([20,20,20], anchor=BACK+RIGHT);
|
|
// magnet
|
|
right(g_th/2 + t) zrot(-10) cuboid([t,g_th*2, g_th*2], anchor=FWD+RIGHT);
|
|
tag("r") right(g_th/2 + t) zrot(-10) back(2) xcyl(d=5, h=2*(t-0.5), $fn=36);
|
|
}
|
|
|
|
// hinge
|
|
back(g_len - 2) right(g_th/2 + t/2) zrot(11) diff("R") {
|
|
right(4) for(i=[0 : hinge_num-1]) {
|
|
up(hinge_h/2 + i * hinge_h*5 / (hinge_num-1))
|
|
if(i%2==0) {
|
|
fwd(t/2) cuboid([hinge_d,hinge_d+t,hinge_h], rounding=1, edges="Z");
|
|
} else {
|
|
left(t/2) cuboid([hinge_d+t,hinge_d,hinge_h], rounding=1, edges="Z");
|
|
}
|
|
}
|
|
up(2) cuboid([t,t*2,15]);
|
|
tag("R") right(4) cyl(h=100, d=1);
|
|
}
|
|
|
|
// blind
|
|
back(g_len) right(g_th/2 + t/2 + 4) zrot(11) right(1.15) fwd(4.5) down(3) union() {
|
|
cuboid([t,60,22], anchor=BOT+BACK, rounding=3, edges="X");
|
|
fwd(30) cuboid([t,30,40], anchor=BOT+BACK, rounding=3, edges="X");
|
|
cuboid([t,60,40], anchor=BOT+BACK, rounding=20, edges="X");
|
|
} |