Skip to content

nodes: the floor plan draws hosted items where they sit in 3D - #1205

Open
officialasishkumar wants to merge 1 commit into
pascalorg:mainfrom
officialasishkumar:fix/item-plan-mounted-pose
Open

officialasishkumar wants to merge 1 commit into
pascalorg:mainfrom
officialasishkumar:fix/item-plan-mounted-pose

Conversation

@officialasishkumar

@officialasishkumar officialasishkumar commented Nov 3, 2026 •

Copy link
Copy Markdown

What does this PR do?

Part of #992: the floor-plan half. The catalog drop on a standalone cabinet module is a separate problem and isn't changed here.

The item floor plan built each host's frame by hand in 2D (wall, item, shelf, roof face, block face). Core's nodeLevelFrame, which the viewer, MCP and cabinet hosting use, builds the same frames separately, and the two had drifted apart. I restored the 480-case grid from the deleted differential, but checked it against the committed 3D pose instead of the frozen copy. It fails on exactly the 76 combinations listed in the issue:

  • Block faces. Shelves and items nested under a block-face item, and any item not at the face host's upright rotation, were composed from yaw alone. With a tilted face frame they landed up to ~0.6 m off.
  • Shelf on a wall. An item chain under a transformed wall shelf went through the shelf's level-local pose instead of the wall's, and ended up several metres away.
  • Roof faces. Wall-side items used their stored face depth, but ItemSystem seats them on the roof wall surface, so they were off by half the wall thickness.

Changes:

  • resolveItemTransform now reads the item's level frame through restingNodePlanFrame. The plan uses the pose the viewer mounts, for every host chain, and about 230 lines of per-host 2D composition are gone.
  • nodeLevelFrame (core) now applies the depth ItemSystem gives wall-mounted items: wall items are offset from the wall body's centre, and wall-side items sit on the chosen face of a wall or roof segment. Before this, the frame put them on the stored depth.
    • Side effect: MCP world points for wall-side items are now exact, so the "on the wall centreline" approximation note in node-world-point.ts is removed.
  • Two floor-plan move overrides in floorplan-move.ts only copied the plan pose onto a frame that's now identical, so they're removed.
  • The roof case in floorplan-rendered-exits.test.tsx pinned the stored face depth ("Production plan rendering uses stored roof-face Z…"). It now asserts the rendered pose, like the wall and ceiling cases do.

New tests:

  • column-audit3.test.tsx: block-top, block-bottom, roof-face, shelf-on-wall and wall-back chains, three items deep. Each item's plan pose has to equal its mounted pose. On main, the first four fail and wall-back passes; wall-back guards the new core path.
  • level-frame-wall-mount.test.ts (core): wall-side front/back faces, a wall item on a justified wall, and a wall-side item on a roof face. All four fail on main.
  • measure-world.test.ts (mcp): a wall-side item is measured on its face and isn't flagged as approximate. Fails on main.

How to test

  1. In 2D, put an item on a block's top face, add a shelf on it, and put another item on that shelf. Rotate the block. The nested footprints stay under the items shown in 3D (on main they drift off).
  2. Put a wall-side item on a roof segment's wall face. Its plan footprint starts on the roof wall's outer surface, where 3D draws it (on main it's half the wall thickness inward).
  3. Put a shelf on a rotated wall, then an item, another shelf and another item on it. The whole chain lines up between 2D and 3D.
  4. Run bun --cwd packages/nodes run test, bun --cwd packages/core run test, bun --cwd packages/mcp run test and bun --cwd packages/editor run test.

What I ran (Linux arm64, Bun 1.4.4):

  • Test suites: nodes 5190 pass / 0 fail, editor 2829 / 0, mcp 1383 / 0, and core 6514 pass / 4 fail. The 4 core failures are the clean-bundle and scene-migrations bundle tests. They fail the same way on an unmodified main checkout in my environment (Cannot find package 'undefined' from the bundle eval).
  • check-types for core, nodes and mcp passes.
  • bun check reports no errors.

Screenshots / screen recording

Not added yet.

Checklist

  • I've tested this locally with bun dev
  • My code follows the existing code style (run bun check to verify)
  • I've updated relevant documentation (if applicable)
  • This PR targets the main branch

Note

Medium Risk
Touches shared nodeLevelFrame and floor-plan geometry used across 2D editing and MCP measurement; broad test coverage limits regression risk but any host-chain edge case could still misplace footprints.

Overview
Aligns 2D floor-plan item placement with 3D mounting by dropping per-host hand-rolled transforms and using the same level-frame path as the viewer (restingNodePlanFrame / nodeLevelFrame).

Core: nodeLevelFrame now rewrites wall-mounted items’ depth via wallMountedItemZ — body-centre for attachTo: 'wall', face Z for wall-side on walls and roof segments — instead of raw stored position[2].

Floor plan: resolveItemTransform is reduced to that shared frame lookup (~230 lines of wall/shelf/roof/block branches removed). Redundant pose copies in floorplan-move.ts are removed; roof-mounted exit tests assert rendered pose like other hosts.

MCP: Wall-side world points land on the face; the “centreline approximation” note for items is removed. New coverage in core, MCP, and nodes (nested host chains #992).

Reviewed by Cursor Bugbot for commit 53b7b69. Bugbot is set up for automated code reviews on this repo. Configure here.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T10:07:41.021912Z 60e65f7 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copy link
Copy Markdown
Member

Thanks @officialasishkumar. Drawing hosted items where they actually sit in 3D fixes a real floor-plan mismatch (related: #992), and the Codex review on 60e65f7 came back clean. main has moved about 80 commits since then, and the branch now conflicts in several floor-plan/nodes files. Could you rebase onto current main? Please also add a before/after floor-plan screenshot of a wall-hosted item and a shelf/ceiling-hosted one, since this changes what's drawn. CI for this fork will need maintainer approval once it's updated.

The item floor plan rebuilt each host's frame by hand in 2D (wall, item,
shelf, roof face, block face), separately from core's nodeLevelFrame that
the viewer, MCP and cabinet hosting already use. The two drifted apart:
76 of the 480 host/mount combinations listed in pascalorg#992 drew a footprint
away from the item's committed 3D pose.

- Block faces: nested shelves and items, and any item not placed at the
  face host's upright rotation, were composed from yaw alone, so a tilted
  face frame put them up to 0.6 m off.
- Shelf on a wall: an item chain under a transformed wall shelf was
  composed through the shelf's level-local pose instead of the wall's,
  landing several metres away.
- Roof faces: wall-side items used their stored face depth, while
  ItemSystem seats them on the roof wall surface.

resolveItemTransform now reads the item's level frame through
restingNodePlanFrame, so the plan uses the same pose the viewer mounts,
for every host chain. To make that frame complete, nodeLevelFrame now
applies the depth ItemSystem gives wall-mounted items: wall items sit
relative to the wall body's centre and wall-side items on the chosen
face of a wall or roof segment. This also corrects MCP world points for
wall-side items, so their "on the wall centreline" approximation note
goes, and drops two floor-plan move overrides that only copied the plan
pose onto an identical frame.

The roof case in floorplan-rendered-exits pinned the stored face depth;
it now asserts the rendered pose like the wall and ceiling cases. New
tests cover the failing chains against the mounted scene, the frame's
wall-mount depth in core, and MCP measurement of wall-side items.

Part of pascalorg#992 (the floor-plan half; the catalog drop on a standalone
cabinet module is separate).
@officialasishkumar
officialasishkumar force-pushed the fix/item-plan-mounted-pose branch from 60e65f7 to 53b7b69 Compare November 23, 2026 00:04
@officialasishkumar

Copy link
Copy Markdown
Author

Rebased onto current main and resolved the conflict in the item floorplan imports. Item, nodes and MCP tests and tsc pass locally. I haven't attached the before/after floor-plan screenshots yet.

This branch has not been deployed

No deployments
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.

2 participants