diff options
| author | Nikita Kostovsky <nikita@kostovsky.me> | 2026-01-08 20:57:13 +0100 |
|---|---|---|
| committer | Nikita Kostovsky <nikita@kostovsky.me> | 2026-01-08 20:57:13 +0100 |
| commit | 64374d0ce953904a0ab3ddbcd54aca6dcba9cbda (patch) | |
| tree | de099709361815c2071601a87a51ed417fbff590 /body | |
| parent | 7b768e6e8edd0f434e4e488a7d71a23d9bf44e85 (diff) | |
visualize 3d range
Diffstat (limited to 'body')
| -rw-r--r-- | body/body.scad | 54 |
1 files changed, 52 insertions, 2 deletions
diff --git a/body/body.scad b/body/body.scad index 0edfb3f..6414cde 100644 --- a/body/body.scad +++ b/body/body.scad @@ -75,11 +75,61 @@ module visualize_xz_range() [$actualXEndMm / 2, farZ],]); } +module visualize_range() +{ + lenseY = $lenseYPosMm; + zBase = $actualZBaseMm + $wawt; + // TODO: use `zEnd` name instead of `farZ`? + farZ = zBase + $actualZRangeMm; + xs = $actualXStartMm; + xe = $actualXEndMm; + + // lense center + lc = [0, 0, lenseY]; + // x start left + xsl = [-xs / 2, zBase, 0]; + xsr = [xs / 2, zBase, 0]; + xel = [-xe / 2, farZ, 0]; + xer = [xe / 2, farZ, 0]; + // 0 1 2 3 4 + points = [lc, xsl, xsr, xel, xer]; + + // front (top?) face + // ff = [lc, xel, xer]; + ff = [0, 3, 4]; + // right face + // rf = [xer, lc, xsr]; + rf = [4, 0, 2]; + // back (ass) face + // bkf = [xsr, lc, xsl]; + bkf = [2, 0, 1]; + // left face + // lf = [xsl, lc, xel]; + lf = [1, 0, 3]; + // bottom face + // bmf = [xel, xer, xsr, xsl]; + bmf = [3, 4, 2, 1]; + + faces = [ff, rf, bkf, lf, bmf]; + //faces = [ff]; + + //polyhedron(points, faces); + + + color("red", 0.3) + polyhedron( + [lc, xsl, xsr, xel, xer], + //[ff, rf, bkf] + faces + ); +} + cam_and_lense(); camera_hole(); laser_hole(); -visualize_yz_range(); -visualize_xz_range(); +//visualize_yz_range(); +//visualize_xz_range(); +visualize_range(); // laser translate([0, -$laserZOffsetMm, 0]) |
