summaryrefslogtreecommitdiff
path: root/body/holes.scad
diff options
context:
space:
mode:
authorNikita Kostovsky <nikita@kostovsky.me>2026-01-08 22:32:58 +0100
committerNikita Kostovsky <nikita@kostovsky.me>2026-01-08 22:32:58 +0100
commit6bc0a3523b4711437b96aeebba44c4e9931e134d (patch)
tree62600cbe29c760fcb0f13346221bacc4bb91634e /body/holes.scad
parent64374d0ce953904a0ab3ddbcd54aca6dcba9cbda (diff)
add missing files; add draft camera_lense holder
Diffstat (limited to 'body/holes.scad')
-rw-r--r--body/holes.scad108
1 files changed, 108 insertions, 0 deletions
diff --git a/body/holes.scad b/body/holes.scad
new file mode 100644
index 0000000..0512fda
--- /dev/null
+++ b/body/holes.scad
@@ -0,0 +1,108 @@
+include <design.scad>
+include <helpers.scad>
+
+// `Heat` in module name means heat brass threaded insert
+
+// in scanner coords:
+// Z facing towards laser beam
+// X facing right on laser beam plane
+// Y facing top (for scanner body)
+hole_side_front = 0;
+hole_side_back = 1;
+hole_side_top = 2;
+hole_side_bottom = 3;
+hole_side_left = 4;
+hole_side_right = 5;
+
+// some draft here, don't pay attention:
+// id - insert diameter
+// il - insert length (unused?)
+// m - screw deameter, like M2
+// r - glass corner radius
+// hole_side - see hole_side_* values above. affects hole
+// initial position. unused here, glass is always facing Z+
+// in scanner coords
+// TODO: cleanup unused params
+//module glass_hole(id, il, m, r, hole_side)
+
+// gw - glass width
+// gh - glass height
+// gt - glass thickness
+// gcr - glass corner radius
+module glass_hole(gw, gh, gt, gcr)
+{
+ wt = $scannerBodyWallThicknessMm;
+ padding_around_glass = 0.4;
+ padding_under_glass = 1;
+
+ pag = padding_around_glass;
+ pug = padding_under_glass;
+
+ // visualize glass
+ color("yellow", 0.5)
+ hull()
+ {
+ for (x_mult = [-1, 1], y_mult = [-1, 1])
+ {
+ translate([
+ (-gw / 2 + gcr) * x_mult,
+ (-gh / 2 + gcr) * y_mult,
+ 0])
+ cylinder($fn = dToFn(gcr * 2), r = gcr, h = gt);
+ }
+ }
+
+ // area to cut around glass
+ // TODO: create a module for such rounded rects
+ color("blue", 0.5)
+ hull()
+ {
+ w = gw + pag * 2;
+ h = gh + pag * 2;
+ // I'm not sure it's needed, but epoxy should
+ // have some thickness as well, and this padding should
+ // protect the glass a bit (the glass will not protrude
+ // from the scanner body)
+ t = gt + pag + $tiny_padding;
+
+ for (x_mult = [-1, 1], y_mult = [-1, 1])
+ {
+ translate([
+ (-w / 2 + gcr) * x_mult,
+ (-h / 2 + gcr) * y_mult,
+ // cut without artifacts
+ -$tiny_padding])
+ cylinder($fn = dToFn(gcr * 2), r = gcr, h = t);
+ }
+ }
+
+ // area to cut under glass
+ color("blue", 0.5)
+ hull()
+ {
+ w = gw - pug * 2;
+ h = gh - pug * 2;
+ // cut without artifacts
+ // area in front of glass is already taken
+ // into account above
+ t = wt + $tiny_padding;
+
+ for (x_mult = [-1, 1], y_mult = [-1, 1])
+ {
+ translate([
+ (-w / 2 + gcr) * x_mult,
+ (-h / 2 + gcr) * y_mult,
+ 0])
+ cylinder($fn = dToFn(gcr * 2), r = gcr, h = t);
+ }
+ }
+}
+
+// see `glass_hole` docs for params details
+module front_glass_hole(gw, gh, gt, gcr)
+{
+ rotate([90, 0, 0])
+ glass_hole(gw, gh, gt, gcr);
+}
+
+//front_glass_hole(gw = 26.6, gh = 19.6, gt = 2, gcr = 1); \ No newline at end of file