3d_print/Artur/neuroshima_hex.scad
2025-11-14 12:54:17 +01:00

77 lines
1.8 KiB
OpenSCAD

include <BOSL2/std.scad>
include <BOSL2/screws.scad>
$slop=0.5;
$fn=36;
in_d = 38;
thread = "M48x3,80";
in_h = 90;
t = 2;
th_h = 15;
cap_h = 15;
out_d = 45;
cap_d = 55;
cap_d2 = 50;
cap_edge_n = 48; // how many cutouts on edge
cap_edge_d = 1;
cap_in_h = 6;
cap_in_d = cap_d/2;
hole_d = 15;
coin_d = 18.2 + 0.5;
coin_h = 12;
coin_dist = 10.5 + 0.5;
difference() {
union() {
down(th_h/2) cyl(h=in_h - th_h, d=out_d, rounding1=2);
up(th_h/2) screw(thread);
}
// cut off excess threads
down(th_h) difference() {
cyl(h=in_h, d=out_d*2);
cyl(h=in_h, d=out_d);
}
// inside hollow
up(t) cyl(d=in_d, h=in_h);
// cutoff at the top
up(50 + in_h/2)cuboid([100,100,100]);
// hole in the bottom
down(in_h/2 - t/2) cyl(h=t+0.1, d=hole_d, rounding=-1);
// cutouts for the coins
up(in_h/2) for(i=[0,120,240]) {
zrot(i) left(coin_dist) cyl(d=coin_d, h=coin_h*2);
}
}
right(100) union() {
difference() {
union() {
nut(thread, thickness=th_h, bevel=false, ibevel=false, anchor=CENTER);
up(th_h/2 + t/2) cyl(h=t, d=cap_d, rounding2=2);
difference() {
down(cap_h/2) cyl(d=cap_d, h=cap_h, rounding=2);
down(cap_h/2) cyl(d=cap_d2+1, h=cap_h+1);
}
}
difference() {
cyl(d=cap_d*2, h=100);
cyl(d=cap_d, h=101);
}
for(i = [0 : 360 / cap_edge_n : 360]) {
zrot(i) left(cap_d/2) cyl(h=cap_h*2, d=cap_edge_d);
}
// hole
up(th_h/2 + t/2) cyl(h=t+0.1, d=hole_d, rounding=-1);
}
up(cap_h/2 + t) down(cap_in_h/2) difference() {
cyl(h=cap_in_h, d=cap_in_d + t, rounding=1);
cyl(h=cap_in_h + 0.1, d=cap_in_d, rounding=-1);
}
}