Throwaway artifact for #43: six SVG scenarios (thin vs thick, corner joint, doorway in a thick wall closed/open, 1 m wall with a tall and a short viewer, terrain = no wall, one-way from both sides), each with explored cells and the sight polygon, plus a cost table against the current thin baseline on the prototype scene and 5k sparse/dense. server/ untouched: sightmodel.nim wraps geometry.visibilityPolygon and adds only the 5.8 filter, the thickness expansion (3-face silhouette / 4-face quad) and the per-target height predicate. Headline numbers: hoisted quad 0.263 ms sparse / 12.7 ms dense (3.15x / 10.15x); the 5.8 filter per query costs +0.15 ms per polygon at 5k walls. Open questions for #44/#45 are listed with suggested answers in prototype-wall-sight/index.html. Branch prototype/wall-sight, not pushed.
PROTOTYPE #43 — sight with thick and low walls
Throwaway. Branch prototype/wall-sight only; never pushed, never merged, server/ not modified.
Open index.html (double-click) — it links every picture, the cost table and the open questions.
Question it answers: what does sight actually look like with thick and low walls in our polygon code? (issue #43, map #38; constraints from #42 / DESIGN 5.8 and #41 / DESIGN 5.7.)
What is here
| file | what |
|---|---|
sightmodel.nim |
the model the tickets argue about: 5.8 switch filter (no kind logic), thickness → 3-face or 4-face expansion, per-target height predicate. Wraps the real server/geometry.nim unchanged. |
pictures.nim |
the six scenarios, rendered as SVG into img/. |
img/*.svg |
the pictures (open in any browser; regenerated by pictures.nim). |
bench_thick.nim |
cost: thin baseline vs 3-face and 4-face thickness, per-query and hoisted, on the prototype scene and the 5k sparse/dense scenes from tools/bench.nim. |
cost.txt |
raw output of the last bench run. |
index.html |
the artifact: pictures + captions + cost table + surprises / open questions with suggested answers. |
Run
nim c -r prototype-wall-sight/pictures.nim # rewrites img/*.svg
nim c -d:release -r prototype-wall-sight/bench_thick.nim # rewrites cost.txt
Model in one paragraph
A wall is {blocks_sight, blocks_movement, door, open, sight_dir, thickness, height}. Before any geometry the
sight input is filtered: absent when blocks_sight is off (that is terrain, and it costs nothing), absent when it
is an open door, absent for the unblocked side of a one-way wall. What survives contributes either one zero-width
segment (today) or 3–4 rectangle faces (thick). height never touches the polygon: it is one comparison per wall
crossing on the line to the target's top, because a nearest-hit ray fan can shorten a ray but never resume it
(research #39 §3.3). The explored/fog set in the pictures comes from the strict polygon, and the dashed polygon in
scenario 4 is the permissive alternative, so the pictures show what each choice reveals.
Verdict / where it feeds back
Captured on #43 for the owner; the lists in index.html are written to feed #44 (low walls: sight and movement) and
#45 (thick walls). Main branch keeps only whatever the owner decides there.