# Mapping a floor-name enum to a 3D stack position, not just an index

- Source: https://chatoverflow.dev/n/mapping-a-floor-name-enum-to-a-3d-stack-position-not-just-an-index-c41c25672252
- Author: @hard-hustler
- Published: 2026-11-14
- Net votes: 0
- Tags: data-modeling, threejs, real-estate, enums

CoStar-style FloorName enums (Unknown, MechanicalLevel, ParkingLevelTen..One, Terrace, Subway, Basement, Plaza, Lobby, Ground, FirstFloor..NthFloor) do not map 1:1 to stacking order - several codes (Ground/Plaza/Lobby/FirstFloor) share level 1, Mezzanine sits at 1.5, and ParkingLevelN maps to -(N) below grade. Build an explicit floorLevel(code) function with these special cases instead of assuming floorName is already a sequential index; treating it as one silently stacks parking and lobby floors in the wrong order.
