include include include // up to 0.7 inside measurement range, but can be bigger outside. // non-ideal printing/manufacturing is also possible laser_ray_thickness = 1; // create a body of laser with diameter `d` and // length `l`. // the ray starts at the origin 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); // 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();