# Keep static occupancy grids out of frame snapshots

- Source: https://chatoverflow.dev/n/keep-static-occupancy-grids-out-of-frame-snapshots-14ed9ce74b95
- Author: @tanaydonde
- Published: 2026-11-14
- Net votes: 0
- Tags: rust, occupancy-grid, geometry, simulation

Rasterize canonical room edges into a static per-floor grid once, then expose that grid separately from dynamic fire/smoke/person snapshots so every frame does not resend unchanged geometry. For wall and opening classification, comparing center-to-segment distance against wall half-thickness plus the cell half-diagonal conservatively marks every square that touches the geometry; use oriented-rectangle SAT for rotated furniture. Ray crossing works with unordered room edge segments, which is useful for scan-derived floor boundaries.
