summaryrefslogtreecommitdiff
path: root/body/holes.scad
diff options
context:
space:
mode:
authorNikita Kostovsky <nikita@kostovsky.me>2026-01-09 13:53:34 +0100
committerNikita Kostovsky <nikita@kostovsky.me>2026-01-09 13:53:34 +0100
commitd2df7e752e422bca585342162c40f6fc256b2103 (patch)
treed70395e0c356e82db735762b90d5a280f2918533 /body/holes.scad
parent5cdddc9039fe2bfc7dcf32758b0de5d658d533a0 (diff)
implement holes
Diffstat (limited to 'body/holes.scad')
-rw-r--r--body/holes.scad83
1 files changed, 66 insertions, 17 deletions
diff --git a/body/holes.scad b/body/holes.scad
index 0512fda..ce61604 100644
--- a/body/holes.scad
+++ b/body/holes.scad
@@ -7,23 +7,17 @@ include <helpers.scad>
// 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;
+hole_side_front = [90, 0, 0];
+hole_side_back = [-90, 0, 0];
+hole_side_top = [180, 0, 0];
+hole_side_bottom = [0, 0, 0];
+hole_side_left = [0, 90, 0];
+hole_side_right = [0, -90, 0];
-// 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)
+hole_insert_height = 4;
+m2_head_diameter = 3.75;
+m2_head_height = 1.9;
+m2 = 2;
// gw - glass width
// gh - glass height
@@ -105,4 +99,59 @@ module front_glass_hole(gw, gh, gt, gcr)
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
+// m - bolt deameter, like M2
+// id - insert diameter
+// il - insert length
+// hd - screw head diameter
+// hh - screw head height
+// hs - hole side, see values above for details
+// wt - wall thickness
+// TODO: use `bolt` or `screw` everywhere
+module screw_hole(m, id, il, hd, hh, hs, wt = $scannerBodyWallThicknessMm)
+{
+ screw_diameter_delta = 0.2;
+ sdd = screw_diameter_delta;
+
+ head_diameter_delta = 1;
+ hdd = head_diameter_delta;
+
+ head_height_delta = 0.1;
+ hhd = head_height_delta;
+ subwall_thickness = 2;
+
+ rotate(hs)
+ {
+ // insert cutter
+ cylinder($fn = dToFn(id), d = id, h = il);
+
+ // screw cutter
+ rotate([180, 0, 0])
+ {
+ // full screw diameter
+ fsd = m + sdd;
+ translate([0, 0, -$tiny_padding])
+ %cylinder($fn = dToFn(fsd), d = fsd, h = wt + $tiny_padding * 2);
+
+ // screw head cutter
+ // full head diameter
+ fhd = hd + hdd;
+ fhh = hh + hhd;
+ echo("hh:", hh);
+ echo("fhh:", fhh);
+ translate([0, 0, wt - fhh])
+ cylinder($fn = dToFn(fhd), d = fhd, h = fhh);
+ }
+ }
+}
+
+*screw_hole(
+ m = m2,
+ id = 4,
+ il = hole_insert_height * 2,
+ hd = m2_head_diameter,
+ hh = m2_head_height,
+ hs = hole_side_front);
+
+//front_glass_hole(gw = 26.6, gh = 19.6, gt = 2, gcr = 1);
+
+//screw_hole(2); \ No newline at end of file