summaryrefslogtreecommitdiff
path: root/body/laser.scad
diff options
context:
space:
mode:
Diffstat (limited to 'body/laser.scad')
-rw-r--r--body/laser.scad25
1 files changed, 24 insertions, 1 deletions
diff --git a/body/laser.scad b/body/laser.scad
index 2b8cab9..b4dc8aa 100644
--- a/body/laser.scad
+++ b/body/laser.scad
@@ -1,3 +1,4 @@
+include <design.scad>
include <helpers.scad>
default_laser_d = 14;
@@ -11,4 +12,26 @@ module laser_body(d = default_laser_d, l = default_laser_l)
rotate([-90, 0, 0])
translate([0, 0, -l])
cylinder($fn = diameterToFn(d), d = d, h = l);
-} \ No newline at end of file
+
+ // visible ray
+ zBase = $actualZBaseMm;
+ farZ = zBase + $actualZRangeMm;
+
+ // non-valid
+ color("red", 0.15)
+ *polygon(
+ [[0, 0],
+ [$actualXStartMm / 2, zBase],
+ [-$actualXStartMm / 2, zBase]]);
+
+ // non-valid, should ignore laser pos
+ // TODO: visualize laser beam
+ color("red", 0.3)
+ *polygon(
+ [[$actualXStartMm / 2, zBase],
+ [-$actualXStartMm / 2, zBase],
+ [-$actualXEndMm / 2, farZ],
+ [$actualXEndMm / 2, farZ],]);
+}
+
+*laser_body(); \ No newline at end of file