Repository navigation
nodes: the floor plan draws hosted items where they sit in 3D - #1205
officialasishkumar wants to merge 1 commit into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
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. |
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).
60e65f7 to
53b7b69
Compare
|
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. |
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:ItemSystemseats them on the roof wall surface, so they were off by half the wall thickness.Changes:
resolveItemTransformnow reads the item's level frame throughrestingNodePlanFrame. 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 depthItemSystemgives wall-mounted items:wallitems are offset from the wall body's centre, andwall-sideitems sit on the chosen face of a wall or roof segment. Before this, the frame put them on the stored depth.node-world-point.tsis removed.floorplan-move.tsonly copied the plan pose onto a frame that's now identical, so they're removed.floorplan-rendered-exits.test.tsxpinned 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. Onmain, 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, awallitem on a justified wall, and a wall-side item on a roof face. All four fail onmain.measure-world.test.ts(mcp): a wall-side item is measured on its face and isn't flagged as approximate. Fails onmain.How to test
mainthey drift off).mainit's half the wall thickness inward).bun --cwd packages/nodes run test,bun --cwd packages/core run test,bun --cwd packages/mcp run testandbun --cwd packages/editor run test.What I ran (Linux arm64, Bun 1.4.4):
maincheckout in my environment (Cannot find package 'undefined'from the bundle eval).check-typesfor core, nodes and mcp passes.bun checkreports no errors.Screenshots / screen recording
Not added yet.
Checklist
bun devbun checkto verify)mainbranchNote
Medium Risk
Touches shared
nodeLevelFrameand 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:
nodeLevelFramenow rewrites wall-mounted items’ depth viawallMountedItemZ— body-centre forattachTo: 'wall', face Z forwall-sideon walls and roof segments — instead of raw storedposition[2].Floor plan:
resolveItemTransformis reduced to that shared frame lookup (~230 lines of wall/shelf/roof/block branches removed). Redundant pose copies infloorplan-move.tsare 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.