summaryrefslogtreecommitdiff
path: root/body
diff options
context:
space:
mode:
authorNikita Kostovsky <nikita@kostovsky.me>2026-01-08 20:23:58 +0100
committerNikita Kostovsky <nikita@kostovsky.me>2026-01-08 20:23:58 +0100
commit7b768e6e8edd0f434e4e488a7d71a23d9bf44e85 (patch)
tree0f1a2f58dc0f42ae9a31e488314baa28a0d2410d /body
parent466513eaded54d9fbef8943ad6c1eaca715768f5 (diff)
visualize measurement range; add camera and laser windows
Diffstat (limited to 'body')
-rw-r--r--body/body.scad84
-rw-r--r--body/design.scad6
-rw-r--r--body/laser.scad25
-rw-r--r--body/veye_imx287.scad2
4 files changed, 87 insertions, 30 deletions
diff --git a/body/body.scad b/body/body.scad
index 16459ba..0edfb3f 100644
--- a/body/body.scad
+++ b/body/body.scad
@@ -1,5 +1,6 @@
include <design.scad>
include <helpers.scad>
+include <holes.scad>
include <m12_connectors.scad>
include <m12_lense_holder.scad>
include <m12_lense_holder_adapter.scad>
@@ -7,6 +8,9 @@ include <noctua_nf_a4x20.scad>
include <radxa_zero_3e.scad>
include <veye_imx287.scad>
+// wall and wall thickness
+$wawt = -$scannerBodyFrontWallOffsetMm + $scannerBodyWallThicknessMm;
+
module cam_and_lense()
{
translate([0, 0, $lenseYPosMm])
@@ -21,7 +25,61 @@ module cam_and_lense()
}
}
+module camera_hole()
+{
+ // TODO: calc Y (scanner coords) offset instead of
+ // hardcoding it
+ y_offset = 100;
+ translate([0, 0, y_offset])
+ // move to the front border of scanner body
+ translate([0, $wawt, 0])
+ front_glass_hole(gw = 26.6, gh = 19.6, gt = 2, gcr = 1);
+}
+
+module laser_hole()
+{
+ // TODO: calc Y (scanner coords) offset instead of
+ // hardcoding it
+ y_offset = 0;
+ translate([0, 0, y_offset])
+ // move to the front border of scanner body
+ translate([0, $wawt, 0])
+ front_glass_hole(gw = 14, gh = 6, gt = 2, gcr = 1);
+}
+
+module visualize_yz_range()
+{
+ lenseY = $lenseYPosMm;
+ zBase = $actualZBaseMm + $wawt;
+ farZ = zBase + $actualZRangeMm;
+
+ color("red", 0.3)
+ rotate([0, -90, 0])
+ %polygon([
+ [lenseY, 0],
+ [0, zBase],
+ [0, farZ],
+ ]);
+}
+
+module visualize_xz_range()
+{
+ zBase = $actualZBaseMm + $wawt;
+ farZ = zBase + $actualZRangeMm;
+
+ color("red", 0.3)
+ %polygon(
+ [[$actualXStartMm / 2, zBase],
+ [-$actualXStartMm / 2, zBase],
+ [-$actualXEndMm / 2, farZ],
+ [$actualXEndMm / 2, farZ],]);
+}
+
cam_and_lense();
+camera_hole();
+laser_hole();
+visualize_yz_range();
+visualize_xz_range();
// laser
translate([0, -$laserZOffsetMm, 0])
@@ -58,7 +116,7 @@ module scanner_main_frame()
// many similar ranges
main_frame_height_y = 150;
main_frame_width_x = 34;
- main_frame_depth_z = 65;
+ main_frame_depth_z = 56;
// inner height, width, depth and radius
ih = main_frame_height_y;
@@ -66,30 +124,6 @@ module scanner_main_frame()
id = main_frame_depth_z;
ir = wt;
- // front wall
- translate([-iw / 2, -wzo, -lhs[2] / 2])
- cube([iw, wt, ih]);
-
- // back wall
- translate([0, -wzo - id, 0])
- // initial positioning
- translate([-iw / 2, -wt, -lhs[2] / 2])
- cube([iw, wt, ih]);
-
- // bottom wall
- // apply body sizes
- translate([0, -wzo, -lhs[2] / 2])
- // initial positioning
- translate([0, -id / 2, -wt / 2])
- cube([iw, id, wt], center = true);
-
- // top wall
- // apply body sizes
- translate([0, -wzo, -lhs[2] / 2 + ih])
- // initial positioning
- translate([0, -id / 2, wt / 2])
- cube([iw, id, wt], center = true);
-
// now try to cut body with rounded corners to simplify
// cnc manufacturing
// TODO: move this shit to a module
diff --git a/body/design.scad b/body/design.scad
index ee48ef7..1b931f7 100644
--- a/body/design.scad
+++ b/body/design.scad
@@ -1,4 +1,4 @@
-$actualZBaseText = "144.51 (117.51)";
+$actualZBaseText = "144.51 (120.51)";
$opticalAxisAngleDegrees = 27.3;
$lenseYPosMm = 110;
$focalDistanceMm = 10;
@@ -19,8 +19,8 @@ $laserBodyDiameterMm = 14;
$laserBodyLengthMm = 45;
$laserAngleDegrees = 45;
$laserZOffsetMm = -16;
-$scannerBodyWallThicknessMm = 3;
-$scannerBodyFrontWallOffsetMm = -24;
+$scannerBodyWallThicknessMm = 4;
+$scannerBodyFrontWallOffsetMm = -20;
$sensorLenseAngleDegrees = 4.818540784876802;
$vFoVDegrees = 20.253496381793383;
$actualZBaseMm = 144.51352361628923;
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
diff --git a/body/veye_imx287.scad b/body/veye_imx287.scad
index 3576105..5594c20 100644
--- a/body/veye_imx287.scad
+++ b/body/veye_imx287.scad
@@ -83,7 +83,7 @@ module veye_imx287_stl_back(with_connector = true)
translate([0, -conn_d + cyl_d / 2, veye_imx287_pcb_h / 2 - cyl_d / 2 + cyl_z_offset])
rotate([0, 90, 0])
- cylinder($fn = diameterToFn(cyl_d), d = cyl_d, h = conn_w, center = true);
+ %cylinder($fn = diameterToFn(cyl_d), d = cyl_d, h = conn_w, center = true);
}
}