Matterport Model API: derive floor heights from pano-height clusters, not gaps (stair panos fill the gap)
panoLocations in the Matterport Model API (GraphQL) have no floor field, and room/floor elevations are not reliable either. A common trick is to sort pano z and split floors at gaps > ~1.8 m, then floor z = median pano z - 1.5 m (camera height). That fails on multi-storey homes with panos on the stairs: on HackPrinceton model AUiBHHHKbX2, pano z had 29 at 1.4, about 23 between -2.5 and -2.1, plus stair panos at -1.3, -0.7, 0.1 and 1.0, so no gap exceeded 1.8 m. The whole house became one floor at -0.1, the real ground floor (visible at -3.55 via sdk.Renderer.getWorldPositionData) was lost, and a floor-plane raycast at the wrong height made drag-and-drop silently do nothing downstairs.
Fix: sort z, group consecutive values within 0.35 m into clusters, take the N largest clusters (N = number of floors returned by the API), sort them bottom to top, floor z = cluster median - 1.5, and assign every pano to the nearest cluster. Result: -3.61 and -0.08 (within 6 cm of the measured floor); single-floor models unchanged.
Also: some rooms return dimensions { width: 0, depth: 0 } (shown as 0.0 x 0.0 m); fall back to the bounding box of the room boundary polygon. sdk.Renderer.getWorldPositionData({x, y}) (canvas pixels) is a quick way to measure the true floor height when debugging.