A LiDAR scan does not contain a wall. It contains a large number of distance measurements, each slightly off, that happen to fall near a plane. ICIDO's saved maps draw walls as crisp straight lines anyway. This post is about the steps in between.
Why the mesh is not the map
Scanning produces a triangle mesh. The obvious top-down map would be that mesh seen from above, and the coordinate frame makes that easy. The frame is metric and gravity-aligned with Y pointing up, so a top-down view is the same points with the Y value dropped.
The trouble is the triangles. A time-of-flight sensor times light out and back, and every range it reports carries a small error. Points measured off a flat wall form a thin layer, not a plane. The mesh built from them is noisy, full of thin, spiky triangles. So the map is not drawn from triangle edges.
First, a grid
The mesh is rasterized into a fixed top-down grid with cells of about 12 cm. Each cell keeps one surface, the one with the highest priority. Wall beats furniture, and furniture beats floor. The ceiling is dropped, so it does not cover the floor from above.
Small disconnected islands of cells are then removed. What remains is merged into solid rectangles, measured in world meters.
That gives a clean, solid floor plan. It also gives walls made of squares. On a grid, a wall is a band of filled cells, and a wall that does not run along the grid's axes becomes a staircase. The plan is solid, but its walls are blobs.
Then, lines
The technique for getting from scattered points to a line is called RANSAC, short for random sample consensus. Fischler and Bolles published it in 1981. For a line it works like this. Pick two points at random. Draw the line through them. Count how many of the other points lie within a set distance of that line. Repeat, and keep the line with the most support.
The useful property is what happens to points that do not belong. In an ordinary least-squares fit, a far-off point drags the line toward itself. In RANSAC it simply does not count.
ICIDO runs this over the wall cells of the grid. Each segment gets 40 trials, and a cell supports a line when it lies within 9 cm of it.
A line is longer than a wall
A mathematical line runs on forever. A wall does not. Cells from two separate walls can sit on the same line with an opening between them, and a fit that only counts support cannot tell the difference.
So each fitted line is cut down. A gap of more than 35 cm splits the cells along a line into separate runs, and only the longest contiguous run is kept for that line. A segment is therefore not drawn across a gap wider than that.
Squaring up
Two segments fitted to noisy cells along parallel walls will rarely come out exactly parallel.
ICIDO takes the dominant orientation and snaps onto it any segment within 8 degrees of it. The comparison is made modulo 90 degrees, so a wall at right angles to the dominant direction counts as aligned with it. The rule applies only inside that 8 degree window.
The result is what the architecture notes describe as blobby rasterized walls becoming a crisp architectural plan.
When it runs
The segments are extracted once per saved map, off the main thread. The map's paths are stored in world meters. When the map rotates to follow the person walking, the per-frame work is a change of transform and a fill of paths that are already cached. Nothing is re-tessellated.
The renderer strokes the segments when it has them and falls back to the rasterized fill when there are none. The live preview during a scan is that case. It shows filled cells on a coarser 24 cm grid, because a fine-grained preview grid froze the scan screen on a device.
What the lines do not claim
ICIDO once went a step further and split a map into named rooms at its doorways. That shipped in test builds and was removed in build 197, because it guessed at boundaries a scan does not really contain.
The wall lines start from something the scan does contain. Each one is fitted to wall cells that are already in the grid.
One limit is worth stating. The map uses colour alone to tell floor from wall, so Differentiate Without Color is not honoured, and it is not claimed on the App Store accessibility label.
ICIDO is on the App Store (opens in a new tab), at version 1.3 since 11 September 2026.