3d_print/Neptune4/wkladka_do_rolki.scad
2026-01-01 13:11:23 +01:00

76 lines
No EOL
1.9 KiB
OpenSCAD

include <BOSL2/std.scad>
include <BOSL2/threading.scad>
// the values are diameter, length
// specify diameter 2-3mm smaller for clearance, length doesn't matter much
spectrum = [51, 65]; // in diam = 53
rosa_500g = [53, 45];
elegoo = [54, 65]; // in diam 56
t = 2;
//roll = spectrum;
//roll = rosa_500g;
roll = elegoo;
grid_const = 100;
grid = 18;
$slop = 0.3;
$fn = 360;
module holes(size, num) {
down(100/2) textured_tile("trunc_diamonds", size, tex_depth=100, tex_reps=[num,num], tex_extra=0);
}
// bottom
union() {
difference() {
// main body
cyl(d=roll[0], h=t, anchor=BOTTOM);
// holes
holes(roll[0], grid);
}
}
// wall
union() {
difference() {
// main body
tube(h=roll[1], od=roll[0], wall=t, anchor=BOTTOM);
// holes
// cyl(h=roll[1], d=20, tex_reps=[40,20], texture="pyramids", tex_depth=roll[0]*2, anchor=BOTTOM);
}
// top threads
for(a = [0,180] ) {
zrot(a) up(roll[1] - 2*t) thread_helix(d=roll[0] - 4*t, pitch=5, thread_depth=2, turns=0.2, internal=true);
}
}
top_d = roll[0] + 5;
top_h = 6;
thread_h = 17;
chamfer_h = 4;
chamfer_t = 8;
// top
up(roll[1] + 50) union() {
// top
difference() {
cyl(d=roll[0], h=t, anchor=TOP);
holes(roll[0], grid);
}
// cylinder with threads
tube(od=roll[0] - 4*t - $slop, wall=t, h=thread_h, anchor=TOP);
for(a = [0,180] ) {
zrot(a) down(thread_h - 4) thread_helix(d=roll[0] - 4*t - $slop, pitch=5, thread_depth=2, turns=0.2);
}
// outer part with texture
difference() {
cyl(d=top_d, h=top_h, anchor=TOP, texture="hex_grid");
cyl(h=top_h+1, d=roll[0]-4*t-$slop, anchor=TOP);
}
// tube(od=top_d, id=roll[0]-4*t-$slop, h=top_h, anchor=TOP, texture="hex");
// chamfered part
down(top_h) tube(id=roll[0] - 4*t - $slop, od2=roll[0] - 2*t - $slop + chamfer_t, od1=roll[0] - 4*t - $slop, h=chamfer_h);
}