From 8afef3bc72c8b73244cb5fe083e16fc3d9066fa6 Mon Sep 17 00:00:00 2001 From: Nikita Kostovsky Date: Wed, 7 Jan 2026 02:09:00 +0100 Subject: add cam pcbs, laser and laser holder, updated m12 lense holder --- body/laser_holder.scad | 106 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 body/laser_holder.scad (limited to 'body/laser_holder.scad') 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 +include + +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 -- cgit v1.2.3-70-g09d2