Skip to content

feat(nodes): support slanted (tilted) walls - #1006

Open
ovurrsl wants to merge 8 commits into
pascalorg:mainfrom
ovurrsl:feat/slanted-walls
Open

ovurrsl wants to merge 8 commits into
pascalorg:mainfrom
ovurrsl:feat/slanted-walls

Conversation

@ovurrsl

@ovurrsl ovurrsl commented Oct 6, 2026 •

Copy link
Copy Markdown

What does this PR do?

This PR brings a highly requested architectural capability to the wall generation system: Slanted (Leaning) Walls.

  1. Schema Update: Adds tilt (in radians) to the WallNode schema, defaulting to 0 for standard vertical walls.
  2. True Shear Transform: Instead of merely rotating the extrusion (which would lift the wall off the ground or distort its footprint), this PR injects a pure Shear Matrix directly into the wallWorldMatrix and the wall's Mesh transform. This allows the wall to lean off the vertical Y-axis while keeping its base perfectly planted on the slabElevation.
  3. Seamless CSG & Openings: Because the shear is applied globally to the wall's Mesh, any child nodes (doors, windows, wall-mounted items) naturally inherit the sheared transform. The generateExtrudedWall lifecycle leverages this inverse transform, meaning boolean cutouts perfectly follow the wall's new leaning angle without requiring manual math corrections on every window cutout!
  4. Editor Integration: Added an Angle slider under the Dimensions property panel for walls, allowing precise leaning between -45° and +45°.

How to test

  1. Draw a wall in the editor.
  2. Select it, and in the right properties panel under "Dimensions", find the new "Tilt (EÄŸim)" slider.
  3. Slide it back and forth. The wall will dynamically lean forward and backward.
  4. Place a Door or Window on the slanted wall. It will automatically tilt itself and cut a perfect hole matching the leaned angle.

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

Co-Authored-By: AI


Note

Medium Risk
Changes wall geometry rebuild, collision meshes, and CSG cutout transforms; incorrect shear math would misalign openings, but scope is isolated behind tilt with tests for the shear helper.

Overview
Adds slanted (tilted) walls via a new optional tilt field on WallNode (radians; positive leans the top toward local +Z across thickness).

Walls are still extruded and CSG-cut upright, then leaned with a shared wallTiltShear shear (base on the wall line unchanged). That shear is applied to render and collision geometry in WallSystem, and hosted React content (doors/windows, trims, finish scripts) is wrapped in the same matrix in the wall renderer. Opening/item cutouts use the inverse shear so boolean cuts stay aligned with the leaned mesh.

The wall Dimensions panel gets a Tilt → Angle slider (±45°) with live preview. wallTiltShear is exported from the viewer and covered by unit tests.

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

…facing)

- fix: node id prefixes split at the wrong underscore, breaking plugin duplicate
- fix: surface upload failures, survive insecure contexts, stop mid-drag GPU disposal
@pascal

pascal Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Here's an orientation pass on #1006.

The PR adds a tilt field to WallNode and makes the wall system apply a shear matrix so a wall can lean off vertical while its base stays on the slab, with a degree slider (-45 to +45) in the wall panel's Dimensions section. Everywhere a draft or default wall is constructed now passes tilt: 0. Beyond the title, the branch also carries three things the description doesn't mention: a tilt (tiltX/tiltZ) and i-beam cross-section for columns, an unrelated set of fixes to the drag bounding box and guide-image error handling, and a group of files that look accidentally committed (three .patch files plus portfolio-assets/ and profile-showcase/, which are personal portfolio content in Turkish). GitHub currently reports the branch as conflicting with main.

File Change What it does
packages/core/src/schema/nodes/wall.ts modified Adds tilt: z.number().default(0) to WallNode
packages/viewer/src/systems/wall/wall-system.tsx modified Multiplies a makeShear(…, tan(tilt)) into wallWorldMatrix and the mesh matrix; switches the mesh to manual matrix updates when tilted
packages/nodes/src/wall/panel.tsx modified New "Tilt (Eğim)" section with an Angle slider in degrees, converted to radians on change
packages/nodes/src/wall/definition.ts, packages/nodes/src/wall/tool.tsx, packages/nodes/src/fence/tool.tsx, packages/editor/src/components/editor/floorplan-panel.tsx, packages/editor/src/lib/wall-polygon-draft.ts modified Each wall-construction site now sets tilt: 0 (one line apiece)
packages/editor/src/components/tools/shared/pointer-support-cap.test.ts modified Test fixtures updated with tilt: 0
packages/core/src/schema/nodes/column.ts modified Adds tiltX/tiltZ to ColumnNode and i-beam to ColumnCrossSection
packages/nodes/src/column/renderer.tsx modified New IBeamBlock (two flanges plus a web) and column tilt applied to the group rotation
packages/nodes/src/column/panel.tsx modified I-beam option in the cross-section grid (now 4 columns, "Rectangular" shortened to "Rect.") and Tilt X/Tilt Z sliders in radians
packages/nodes/src/column/floorplan.ts modified I-beam uses the rectangular plan footprint
packages/editor/src/components/tools/shared/drag-bounding-box.tsx modified Replaces per-dimension geometry and materials with module-level unit geometry plus a colour-keyed material cache, dropping the dispose-on-cleanup effect
packages/editor/src/components/ui/action-menu/view-toggles.tsx, packages/editor/src/components/ui/sidebar/panels/site-panel/index.tsx modified Guide-image catch {} blocks now log the error and include its message in the user-facing text
fix.patch, fixes.patch, upload.patch added Raw patch files (two empty, fixes.patch is a 222-line commit dump of the drag-box and guide-image fixes)
5 more files under portfolio-assets/ and profile-showcase/ added Personal portfolio README files, an SVG banner (twice), and a CSS art page

Best place to start: packages/viewer/src/systems/wall/wall-system.tsx, where the shear is applied to both the UV world matrix and the mesh transform, since that is where the feature's correctness lives (openings, UVs, and the manual matrix path). Then packages/nodes/src/wall/panel.tsx for the units round-trip.

@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.

Stale Bugbot comment from a previous run.

Comment thread packages/viewer/src/systems/wall/wall-system.tsx Outdated
Comment thread packages/nodes/src/column/renderer.tsx Outdated
Comment thread profile-showcase/README.md Outdated
@ovurrsl
ovurrsl force-pushed the feat/slanted-walls branch from b0a78dd to a983af0 Compare October 7, 2026 08:59

@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.

Stale Bugbot comment from a previous run.

Comment thread packages/viewer/src/systems/wall/wall-system.tsx Outdated
Comment thread packages/viewer/src/systems/wall/wall-system.tsx Outdated
@ovurrsl
ovurrsl force-pushed the feat/slanted-walls branch from a983af0 to 7754101 Compare October 7, 2026 09:43

@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.

Stale Bugbot comment from a previous run.

Comment thread packages/viewer/src/systems/wall/wall-system.tsx Outdated
Comment thread packages/nodes/src/column/renderer.tsx Outdated
Comment thread packages/nodes/src/wall/renderer.tsx
Comment thread packages/nodes/src/wall/renderer.tsx Outdated
@ovurrsl
ovurrsl force-pushed the feat/slanted-walls branch from 7754101 to 767aa97 Compare October 7, 2026 09:55

@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.

Stale Bugbot comment from a previous run.

Comment thread packages/viewer/src/systems/wall/wall-system.tsx Outdated
Comment thread .agents/ORIGINAL_REQUEST.md Outdated
@ovurrsl
ovurrsl force-pushed the feat/slanted-walls branch from 767aa97 to b0ff2f2 Compare October 7, 2026 10:53

@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.

Stale Bugbot comment from a previous run.

Comment thread packages/viewer/src/systems/wall/wall-system.tsx Outdated
Comment thread packages/viewer/src/systems/wall/wall-system.tsx Outdated
Comment thread packages/nodes/src/wall/renderer.tsx Outdated
@ovurrsl
ovurrsl force-pushed the feat/slanted-walls branch from b0ff2f2 to 1a908b0 Compare October 7, 2026 11:38
@ovurrsl
ovurrsl force-pushed the feat/slanted-walls branch from 1a908b0 to 4c07809 Compare October 7, 2026 11:39
# Conflicts:
#	packages/nodes/src/column/panel.tsx
#	packages/nodes/src/column/renderer.tsx
#	packages/viewer/src/systems/wall/wall-system.tsx

@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.

Stale Bugbot comment from a previous run.

Comment thread packages/nodes/src/wall/renderer.tsx
Comment thread packages/nodes/src/wall/renderer.tsx Outdated
Comment thread packages/nodes/src/column/renderer.tsx Outdated
position={liveTransform?.position ?? node.position}
ref={ref}
rotation={[0, liveTransform?.rotation ?? node.rotation, 0]}
rotation={[node.tiltX ?? 0, liveTransform?.rotation ?? node.rotation, node.tiltZ ?? 0]}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Scripted columns batch before load

High Severity

ColumnRenderer no longer writes userData.scriptedColumn. columnBatchable.settled treats a missing flag as already settled, so scripted columns can enter the static batch before ScriptedOpeningModel sets itemModelSettled on the registered group.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c3cdc86. Configure here.

Comment thread packages/nodes/src/column/panel.tsx Outdated

Copy link
Copy Markdown
Member

Hi @ovurrsl, checking in on this one. Bugbot still lists unresolved findings on the latest push (4 new, 5 open in total). Could you fix them or reply in the threads? Tilted walls are a very visible change, so please also add a few screenshots or a short screen recording. If we don't hear back in a couple of weeks we'll close it for now, and you're welcome to reopen anytime.

ovurrsl and others added 3 commits October 24, 2026 15:15
Conflicts in packages/nodes/src/column/panel.tsx and
packages/nodes/src/wall/renderer.tsx are resolved to main's version; the
wall renderer's tilt handling is re-applied in the following commit and
the column changes leave this PR (they belong to pascalorg#1005).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FX8vGAP5g43AHR1jixUeXr
Drop changes that are not part of slanted walls: tilted columns and the
i-beam section (pascalorg#1005), the drag bounding box and guide-image error work
(pascalorg#1003), and a .gitignore that had been re-encoded. WallNode.tilt becomes
optional, so walls built in code no longer have to spell out tilt: 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FX8vGAP5g43AHR1jixUeXr
The tilt only sheared a group around the wall's children, so the wall
mesh and its collision mesh stayed vertical, and makeShear filled the
zy slot, which moved y by z instead of z by y.

wallTiltShear (viewer) builds the shear once: z += y * tan(tilt). The
wall system builds the wall upright, cuts it, then shears the render and
collision geometry; cutouts of hosted children are taken back through the
inverse shear first. The renderer leans what the wall hosts (treatments,
face scripts, doors and windows) with the same matrix. The panel label
reads plain "Tilt".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FX8vGAP5g43AHR1jixUeXr

@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 2 potential issues.

There are 3 total unresolved issues (including 1 from previous review).

Fix All in Cursor

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

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ba28559. Configure here.

geometryAdapter?.buildGeometry?.(node, builtGeo, prepared.renderChildren) ?? builtGeo
// A tilted wall is built upright (cutouts included) and leaned afterwards.
const tiltShear = wallTiltShear(node.tilt)
if (tiltShear) renderedGeo.applyMatrix4(tiltShear)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Tilted wall UVs pick the wrong plane

Medium Severity

Shear is baked into wall vertices before applyWorldPlanarWallUVs, so side-face normals gain a Y component. At 45° tilt every wall, and at about 35° on diagonal walls, the dominant-axis test treats those faces as horizontal and projects textures from above.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ba28559. Configure here.

terrainBottomAt,
slabSupport.faceDatum,
)
if (tiltShear) collisionGeo.applyMatrix4(tiltShear)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Terrain fill leans off the ground

Medium Severity

fillToTerrain samples ground under the upright footprint, then the same Y→Z shear is applied to that below-base mesh. Points with negative Y move opposite the lean, so the underpinning no longer meets the terrain it was built to reach.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ba28559. Configure here.

@Aymericr Aymericr added enhancement New feature or request bot:maintainer labels Oct 24, 2026 — with Cursor

Copy link
Copy Markdown
Member

Thanks for the update @ovurrsl, the branch is much cleaner now (the stray patch and portfolio files are gone and it merges with main again). Bugbot's run on the latest push still flags two new issues in wall-system.tsx: texture UVs on steeply tilted walls get projected from above, and the terrain fill under the wall leans away from the ground. There's also one older finding still open. Could you fix those or reply in the threads? We still need a few screenshots or a short screen recording of a tilted wall with a door or window in it before we can merge.

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

bot:maintainer enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants