Rectangle Fitting — area (surface) minimization

The objective is the area of the axis-aligned bounding box; the search minimizes it (θ*). In Full the minimum sits cleanly at 0°/90°. Switch to Half (only the two near faces): the missing corner drops out of the extents, so extra minima appear — the box hugs the diagonal of the L (~63.5°) just as tightly — and min-area turns ambiguous, able to pick a wrong angle. That fragility on partial LiDAR is why detect.cpp uses closeness instead.

■ true 0°/90° — bbox = real rectangle (Half also has false minima) φ = 0.0° · area = 0.00 m² · inflation = 1.00×
gray = full box (ghost) · blue = visible faces · yellow fill = bounding-box area · orange/purple = x/y projection
bounding-box area vs φ · dot = now · dashed = θ* (area min) · floor = true rect area
visible face(s) hidden half cluster points + noise bounding-box area x proj y proj