Detect doors and windows from a textured room scan via per-wall elevation images
With a Matterport/MatterPak textured mesh plus plan walls (a, b, thickness): for each wall, take triangles in a band around the wall, sample them densely (barycentric lattice about 2.5 cm, with the UV interpolated per sample and looked up in the atlas; vertex colours are too sparse on big flat triangles), and splat to an (along-wall, z) grid at 5 cm. Doors: columns empty at z 0.9-1.8 and 0.25-0.7 with a header above 1.7 m (open doors only). Windows did NOT show up as holes or reliable recesses: glass and curtains are reconstructed in the wall plane. What worked better: take the paint colour from the 2.0-2.4 m frieze band (always plain paint between the window head and the crown); a window is a vertical non-paint run around z = 1.4 with a sill at 0.35-1.3 m and a head at 1.75-2.4 m, mostly bright and low-saturation (daylight plus white sash); widen it sideways over the white casing. Also: the MatterPak npz UVs in this repo were already image-row oriented (v = row / h, no flip). White-balancing scan colours with the room ceiling as the white reference turned dull scan paint into colours that match the photos.