summaryrefslogtreecommitdiff
path: root/body/laser_holder.scad
diff options
context:
space:
mode:
authorNikita Kostovsky <nikita@kostovsky.me>2026-01-07 02:09:00 +0100
committerNikita Kostovsky <nikita@kostovsky.me>2026-01-07 02:09:00 +0100
commit8afef3bc72c8b73244cb5fe083e16fc3d9066fa6 (patch)
tree1af5b753786a33f1177f22602e335e5c99e05f15 /body/laser_holder.scad
parente69aa61989896a6dfd65acb7753377eb69630203 (diff)
add cam pcbs, laser and laser holder, updated m12 lense holder
Diffstat (limited to 'body/laser_holder.scad')
-rw-r--r--body/laser_holder.scad106
1 files changed, 106 insertions, 0 deletions
diff --git a/body/laser_holder.scad b/body/laser_holder.scad
new file mode 100644
index 0000000..e22c052
--- /dev/null
+++ b/body/laser_holder.scad
@@ -0,0 +1,106 @@
+include <helpers.scad>
+include <laser.scad>
+
+default_laser_holder_padding = [4, 1.5, 1.5];
+
+// d - laser body diameter
+// l - laser body length
+// padding - see `laser_holder_wo_holes` for details
+function laser_holder_size(
+ d = default_laser_d,
+ l = 45,
+ padding = default_laser_holder_padding) = ([d, l / 2, d] + padding * 2);
+
+// create a holder for laser with diameter `d` and
+// length `l`. no holes
+// with one-side `padding` for each axis
+module laser_holder_wo_holes(
+ d = default_laser_d,
+ l = 45,
+ padding = default_laser_holder_padding)
+{
+ translate([0, -l / 2 , 0])
+ cube(laser_holder_size(d = d, l = l, padding = padding), center = true);
+}
+
+// create a hole for laser holder for laser with diameter `d`.
+// hole will have diameter `hd` and height `hh`
+module laser_holder_tension_hole(d = default_laser_d, hd = 4, hh = 4)
+{
+ rotate([0, -45, 0])
+ translate([0, 0, d / 2 - hh / 2])
+ cylinder($fn = diameterToFn(hd), d = hd, h = hh * 3);
+}
+
+// d - laser body diameter
+// hd - hole diameter
+// hh - hole height
+// padding - see `laser_holder_wo_holes` for details
+module laser_holder_bottom_hole(
+ d = default_laser_d,
+ hd = 4,
+ hh = 4,
+ padding = default_laser_holder_padding)
+{
+ //translate([0, -10, -((d + hh) / 2)])
+ z_padding = $tiny_padding;
+ translate([0, 0, -d / 2 - padding[2] - z_padding])
+ cylinder($fn = diameterToFn(hd), d = hd, h = hh + z_padding * 2);
+}
+
+// see `laser_holder_bottom_hole` for args details
+module laser_holder_bottom_holes(
+ d = default_laser_d,
+ l = default_laser_l,
+ hd = 4,
+ hh = 4,
+ padding = default_laser_holder_padding)
+{
+ x_mults = [-1, +1];
+ y_mults = [1 / 3, 2 / 3];
+
+ union()
+ {
+ for (x_mult = x_mults, y_mult = y_mults)
+ {
+ x = (d / 2 + padding[0] / 2 - $tiny_padding) * x_mult;
+ y = -l * y_mult;
+
+ translate([x, y, 0])
+ laser_holder_bottom_hole();
+ }
+ }
+}
+
+module laser_holder_holes(d = default_laser_d, l = default_laser_l, d_padding = 0.5)
+{
+ union()
+ {
+ laser_body(d = d + d_padding);
+ // front tension hole
+ translate([0, -l * 1 / 3, 0])
+ laser_holder_tension_hole(d=d);
+ // back tension hole
+ translate([0, -l * 2 / 3, 0])
+ laser_holder_tension_hole(d=d);
+ // bottom holes
+ laser_holder_bottom_holes();
+ }
+}
+
+// create a holder for laser with diameter `d` and
+// length `l`. with holes.
+// hole for laser has diameter `d` + padding `d_padding`
+module laser_holder(d = default_laser_d, l = default_laser_l, d_padding = 0.5)
+{
+ difference()
+ {
+ laser_holder_wo_holes();
+ laser_holder_holes(d=d, l=l, d_padding = d_padding);
+ }
+}
+
+//laser_holder_wo_holes();
+//*#laser_body();
+laser_holder();
+//laser_holder_bottom_holes(); \ No newline at end of file