Skip to content

feat(editor): precise item dimensions — static bounding boxes, grid-aligned placement#290

Merged
wass08 merged 1 commit intomainfrom
feat/precise-dimensions-sync
May 4, 2026
Merged

feat(editor): precise item dimensions — static bounding boxes, grid-aligned placement#290
wass08 merged 1 commit intomainfrom
feat/precise-dimensions-sync

Conversation

@Aymericr
Copy link
Copy Markdown
Contributor

@Aymericr Aymericr commented May 4, 2026

What this does

  • Replaces runtime mesh-based bounding-box computation with static dimension-based polygons for item footprints in the 2D floorplan. Previously, a per-frame convex-hull + minimum-area-rect pass over loaded mesh vertices produced the footprint — expensive and inconsistent with the 3D side where dimensions are the source of truth.

  • Grid-aligned placement wireframe: adds snapUpToGridStep() and getGridAlignedDimensions() so the green/red placement box always snaps to a full grid cell, making small items visually reserve the space they actually occupy.

  • expandBoundsToGrid() in the placement coordinator expands the wireframe consistently across floor/ceiling/wall placements.

  • Preserves world rotation across surface transitions: adds currentCursorRotationY to PlacementContext so items don't jump orientation when dragged from floor onto a rotated surface item.

  • Fixes item detach from surface: uses building-local world conversion instead of surface-local event.localPosition to prevent the wireframe teleporting on detach.

  • Floorplan overlay refresh: subscribes to useLiveTransforms during item placement so R/T keyboard rotation updates the 2D underlay immediately without requiring a mouse move.

  • Fixes FloorplanItemImage rotation by +180° to account for top-down camera capture orientation.

  • Removes the item-mesh-metadata system (compute-item-mesh-metadata, item-mesh-metadata-system, sync-request) — no longer needed since footprints use dimensions directly.

…ent-math, remove item-mesh-metadata system

- Replace runtime mesh-based bounding-box computation with static dimension-based polygons for item footprints
- Add snapUpToGridStep() and getGridAlignedDimensions() to placement-math for grid-cell-aligned placement wireframes
- Add expandBoundsToGrid() to use-placement-coordinator for consistent wireframe snapping
- Add currentCursorRotationY to PlacementContext; preserve world orientation across item-surface transitions
- Fix item detach from surface: use worldToBuildingLocal() instead of event.localPosition to avoid coordinate-space jump
- Subscribe to useLiveTransforms in FloorplanPanel during placement so R/T keyboard rotation refreshes the 2D overlay immediately
- Fix FloorplanItemImage rotation (+180° to account for top-down camera capture orientation)
- Simplify spatial-grid-manager: single dimension-based getItemLocalBounds(), removes runtime mesh-metadata path
- Remove item-mesh-metadata system (compute-item-mesh-metadata, item-mesh-metadata-system, sync-request)
@mintlify
Copy link
Copy Markdown

mintlify Bot commented May 4, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
pascal 🔴 Failed May 4, 2026, 7:36 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@wass08 wass08 merged commit fe34126 into main May 4, 2026
2 checks passed
@wass08 wass08 deleted the feat/precise-dimensions-sync branch May 4, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants