Skip to content

editor: add Blender-style custom mesh editing - #638

Open
sudhir9297 wants to merge 47 commits into
pascalorg:mainfrom
sudhir9297:t3code/research-blender-edit-mode
Open

editor: add Blender-style custom mesh editing#638
sudhir9297 wants to merge 47 commits into
pascalorg:mainfrom
sudhir9297:t3code/research-blender-edit-mode

Conversation

@sudhir9297

@sudhir9297 sudhir9297 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

  • Adds a registry-driven Custom Mesh node with 3D placement, floor-plan rendering, paint support, and Blender-style vertex, edge, and face editing.
  • Adds mesh transforms and topology operations including extrude, inset, bevel, loop cut, merge, dissolve, and delete, with an interaction-scoped floating toolbar and keyboard controls.
  • Supports elevated and registry-declared top surfaces for stairs and other floor-placed nodes, including plugin-defined surfaces and Alt force placement without hardcoded node-kind dispatch.
  • Refines the edit/selection menus, removes the obstructive secondary help strip, and documents the interaction-scope and custom-mesh design.

How to test

  1. Run bun dev, open the editor, choose Custom Mesh from the build palette, and place it on the ground and on an elevated top surface; verify the preview follows the pointed surface and commits without an error overlay.
  2. During Custom Mesh placement, hold Alt over an otherwise invalid or overlapping position; verify snapping is bypassed and the mesh can be force-placed.
  3. Select a Custom Mesh, choose Edit mesh, switch between vertex/edge/face selection, and exercise translate, rotate, scale, extrude, inset, bevel, loop cut, merge, dissolve, and delete; verify Tab or the check button exits edit mode.
  4. Place or move a stair over a Custom Mesh/elevated surface and verify a single click commits it at that elevation without the floating helper blocking the pointer.
  5. Run bun run check, bun run check-types, and bun run build.

Screenshots / screen recording

A short screen recording will be added before review. The interactive placement and helper UI were smoke-tested in the local collaborative preview.

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

High Risk
Large cross-cutting changes to spatial support election, placement commit paths, and scene schema; incorrect pinning or face hosting could misplace nodes or lift items after edits.

Overview
Introduces a custom-mesh scene node with validated topology (vertices, edges, face loops), default box primitive helpers, and event-bus wiring (custom-mesh:* plus generic node:click). Items can host on planar mesh faces via customMeshFaceId, with a new placement surface type, face-aware preview/commit paths, oriented snap grid behavior, and selection suppressed while mesh-editing scope is active. The floating action menu gains Edit mesh entry.

Support and construction gain pinSupport, preferred-slab resolution, resolveFrozenFloorPlacementPatch (freeze pointer-hit elevation without live-hosting arbitrary mesh tops), and shared wall/fence construction helpers moved into core. Pointer support now discovers registry-declared surfaces.top kinds (not a fixed wall/item/column list), and getTopSurfaceHeight can read the full node graph for context-aware hosts. Floor/item moves and fence commits thread pinned support through placement and the registry move tool.

Build tab defers registry-driven palette expansion until client mount via useSyncExternalStore to avoid SSR/hydration mismatches. Minor refactors extract floating menu scale and RegistryToolContext for registry tools.

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

sudhir9297 and others added 30 commits May 19, 2026 02:59
Items (e.g. solar panels) can now be placed on sloped roof surfaces.
The placement system computes euler rotation from the roof surface
normal so items sit flush on the slope instead of going inside.

- Add roofStrategy to placement-strategies with enter/move/click/leave
- Wire roof:enter/move/click/leave events in the placement coordinator
- Add calculateRoofRotation in placement-math using surface normals
- Support full 3D cursor rotation for sloped surfaces
- Items on roofs are parented to the level with world-space rotation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment thread packages/nodes/src/custom-mesh/tool.tsx
Comment thread packages/editor/src/components/tools/shared/pointer-support-cap.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 63c131e. Configure here.

[faceId, host, liveTopology],
)

if (!transform) return children

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted faces orphan hosted items

Medium Severity

Face delete/dissolve/merge can remove a face while items still reference it via customMeshFaceId. CustomMeshFaceHostFrame then fails to resolve a frame and renders those children without the face transform, so hosted items jump to incorrect local coordinates instead of being cleaned up or reparented.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 63c131e. Configure here.

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.

1 participant