Lightweight state management for furniture editing. All mutations go
through named methods that snapshot state for undo, then notify
listeners. Supports move, rotate, add, remove, full design load,
and serialization via toJSON().
- Export COLORS for external module access (themes)
- Extend _onClick to detect furniture clicks before room clicks,
dispatching 'furnitureclick' with catalog/room/mesh details
- Add setControlsEnabled(enabled) to toggle OrbitControls
- Dispatch 'floorchange' event from showFloor()
- Wire up furnitureclick in index.html to show item info
Renderer improvements:
- Configure shadow camera frustum to cover full house (was default -5..5)
- Add geometry and material caching to reduce GPU allocations
- Add proper disposal of Three.js objects on floor switch (fix memory leak)
- Add error handling for fetch failures with custom event dispatch
- Add room labels as sprites floating in each room
- Support wall-mounted furniture Y positioning via position.y
- Use cached highlight materials instead of mutating shared materials
Data fixes:
- Fix critical room overlap on upper floor: og-kinderzimmer1 and
og-elternbad were overlapping by 2.5x2.0m. Adjusted room positions:
kz1 length 4->3m, elternbad y 2->3, schlafzimmer y 5->6/length 5->4
- Extend upper hallway to full building depth (y=0..10) for proper
door connectivity to all rooms
- Fix all upper hallway door positions for new layout
- Move eg-esszimmer door from south wall to west wall (correct shared
boundary with hallway)
- Remove kitchen-to-living-room door (rooms not adjacent, 1m gap)
- Fix og-flur-d5 partial misalignment with gaestezimmer
- Add Y positions for wall-mounted furniture (mirror, wall cabinets,
bathroom cabinets) so they render on walls instead of floor
- Adjust furniture positions in resized rooms (kz1, schlafzimmer)
- loadCatalog() and loadDesign() methods on HouseRenderer
- Builds Three.js meshes from catalog part definitions (box/cylinder)
- Places furniture in room-local coordinates with rotation
- Furniture clears and re-renders on floor switch
- index.html loads catalog and design after house data
Covers both floors of the sample house with 71 furniture placements.
Each item has room-local position and rotation, referencing the
furniture catalog IDs. Layouts respect door/window clearances.
renderer.js: HouseRenderer class that loads house JSON and renders
rooms as 3D geometry - walls with door/window cutouts, floors with
material colors, translucent ceilings, orbit camera controls, room
click selection and highlighting.
index.html: Viewer page with sidebar showing floor switcher and
room list with areas. Click rooms in 3D or sidebar to focus camera.
Uses Three.js via CDN importmap (no build step needed).
Einfamilienhaus with 14 rooms across ground floor and upper floor:
- EG: Flur, Wohnzimmer, Küche, Esszimmer, Arbeitszimmer, Gäste-WC, HWR
- OG: Flur, Schlafzimmer, Elternbad, 2x Kinderzimmer, Badezimmer, Gästezimmer
Each room includes position, dimensions, wall types, doors with
connections, and windows with sill heights. ~205sqm total.
Covers all rooms (Wohnzimmer, Kueche, Schlafzimmer, Kinderzimmer,
Badezimmer, Arbeitszimmer, Flur, Gaeste-WC) with realistic metric
dimensions and Three.js-compatible 3D mesh definitions using box
and cylinder primitives.