Skip to content

feat(wall): add endHeightOffset for sloped top edge - #640

Open
vducasse wants to merge 1 commit into
pascalorg:mainfrom
vducasse:feat/wall-end-height
Open

feat(wall): add endHeightOffset for sloped top edge#640
vducasse wants to merge 1 commit into
pascalorg:mainfrom
vducasse:feat/wall-end-height

Conversation

@vducasse

@vducasse vducasse commented Aug 12, 2026

Copy link
Copy Markdown

What does this PR do?

Adds an endHeightOffset property to the WallNode schema to allow wall extremities to have different heights (e.g., for creating a knee wall following a single-pitch roof slope). This adds an "End height offset" slider to the wall properties panel and updates the geometry generation to apply the slope along the top edge of the wall.

How to test

  1. Open a scene in the editor and draw a standard wall.
  2. Select the wall to open the properties panel.
  3. Under the dimensions/properties, look for the new End height offset slider.
  4. Adjust the slider and verify that the top edge of the wall tilts smoothly between the start and end points.

Screenshots / screen recording

image image image image

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
Wide changes to wall height resolution, mesh generation, and door/window placement constraints; regressions could affect opening fit, trims, and spatial collision on sloped walls, but scope is modeling/editor logic rather than security or persistence.

Overview
Introduces endHeightOffset on walls so the top edge can slope from start to end (knee walls / single-pitch roofs), with an End height offset control in the wall panel.

Core behavior: resolveWallTop / effective height now accept an optional parametric t along the wall; the viewer tilts extruded wall tops and adjusts crown trim, face bands, and band splits for the taller end. Room/level height and space-detection ceilings consider both ends of sloped boundary walls.

Openings & placement: Doors and windows sample the host wall ceiling at multiple t values (span corners and center), tighten resize limits (readHostWallCeilingMaxWidth), and extend clampToWall with a fits flag that slides along the wall when the sloped ceiling would clip the opening; move/place/commit paths reject invalid fits unless Alt force-place. Opening guides and wall-item placement use the minimum height over the item’s along-wall span.

Editor & sync: Measurement guides, side handles, elevation guides, and wall-top snap highlights follow per-t heights; spatial grid sync refreshes on height/slope/support field changes and wall placement checks use sampled heights at the item’s t range.

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

Comment thread packages/nodes/src/wall/panel.tsx
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/viewer/src/systems/wall/wall-system.tsx
Comment thread packages/viewer/src/systems/wall/wall-system.tsx Outdated
Comment thread packages/core/src/hooks/spatial-grid/spatial-grid-manager.ts Outdated
Comment thread packages/nodes/src/door/floorplan-move.ts
Comment thread packages/nodes/src/window/floorplan-move.ts Outdated
Comment thread packages/core/src/hooks/spatial-grid/spatial-grid-manager.ts Outdated
Comment thread packages/viewer/src/systems/wall/wall-system.tsx Outdated
Comment thread packages/core/src/hooks/spatial-grid/spatial-grid-manager.ts Outdated
Comment thread packages/core/src/systems/wall/wall-top.ts
Comment thread packages/core/src/hooks/spatial-grid/spatial-grid-manager.ts Outdated
Comment thread packages/core/src/systems/wall/wall-top.ts
Comment thread packages/core/src/hooks/spatial-grid/spatial-grid-manager.ts Outdated
@vducasse
vducasse force-pushed the feat/wall-end-height branch from cf8f12c to 7200ea6 Compare August 17, 2026 10:33
Comment thread packages/editor/src/components/editor/wall-measurement-label.tsx Outdated
@vducasse
vducasse force-pushed the feat/wall-end-height branch from 7200ea6 to 8910206 Compare August 17, 2026 11:07
Comment thread packages/viewer/src/systems/wall/wall-system.tsx Outdated
@vducasse
vducasse force-pushed the feat/wall-end-height branch from 8910206 to 6a53abd Compare August 17, 2026 11:29
Comment thread packages/nodes/src/shared/wall-opening-ceiling.ts
Comment thread packages/nodes/src/wall/paint.ts Outdated
Comment thread packages/editor/src/components/editor/wall-snap-beacon-layer.tsx Outdated
@vducasse
vducasse force-pushed the feat/wall-end-height branch from 6a53abd to f250e10 Compare August 17, 2026 11:43
Comment thread packages/nodes/src/door/door-math.ts
@vducasse
vducasse force-pushed the feat/wall-end-height branch from f250e10 to d2b2045 Compare August 17, 2026 12:15
Comment thread packages/editor/src/components/editor/wall-measurement-label.tsx
@vducasse
vducasse force-pushed the feat/wall-end-height branch from d2b2045 to a51d552 Compare August 17, 2026 12:48
Comment thread packages/viewer/src/systems/wall/wall-system.tsx
@vducasse
vducasse force-pushed the feat/wall-end-height branch 3 times, most recently from 8cedc3a to bda880e Compare August 18, 2026 08:31
Comment thread packages/nodes/src/wall/panel.tsx Outdated
@vducasse
vducasse force-pushed the feat/wall-end-height branch from bda880e to 4eb816b Compare August 18, 2026 08:46
Comment thread packages/editor/src/components/editor/wall-measurement-label.tsx
Comment thread packages/nodes/src/wall/treatments.tsx
@vducasse
vducasse force-pushed the feat/wall-end-height branch from 4eb816b to ad47f23 Compare August 18, 2026 09:18
Comment thread packages/nodes/src/wall/treatments.tsx
@vducasse
vducasse force-pushed the feat/wall-end-height branch from ad47f23 to 54271c8 Compare August 18, 2026 09:41
Comment thread packages/nodes/src/shared/opening-guides-runtime.ts Outdated
@vducasse
vducasse force-pushed the feat/wall-end-height branch from 54271c8 to b595d2c Compare August 18, 2026 09:59
Comment thread packages/nodes/src/wall/measurement.ts
@vducasse
vducasse force-pushed the feat/wall-end-height branch from b595d2c to b95898c Compare August 18, 2026 10:37
Comment thread packages/viewer/src/systems/wall/wall-system.tsx
@vducasse
vducasse force-pushed the feat/wall-end-height branch from b95898c to 0819b93 Compare August 18, 2026 11:06
Comment thread packages/nodes/src/wall/treatments.tsx
@vducasse
vducasse force-pushed the feat/wall-end-height branch from 0819b93 to 4a67a86 Compare August 18, 2026 11:27
Comment thread packages/nodes/src/window/window-math.ts
@vducasse
vducasse force-pushed the feat/wall-end-height branch from 4a67a86 to 81790a5 Compare August 18, 2026 12:04
Comment thread packages/nodes/src/door/definition.ts Outdated
@vducasse
vducasse force-pushed the feat/wall-end-height branch from 81790a5 to e48a086 Compare August 18, 2026 12:21
Comment thread packages/nodes/src/door/door-math.ts
@vducasse
vducasse force-pushed the feat/wall-end-height branch from e48a086 to e7b4a53 Compare August 18, 2026 12:36

@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 e7b4a53. Configure here.

Comment thread packages/nodes/src/door/door-math.ts Outdated
- **Schema & Core Systems**:
  - Add endHeightOffset property to WallNode schema with default 0.
  - Update resolveWallTop and resolveWallOpeningCeiling to support
    parametric height sampling along sloped top edges.
  - Update getWallFaceBandConfig and getWallFaceBandForHeight to
    scale with maximum sloped wall height.
  - Update spatial grid synchronization, space detection, and level
    height calculations for sloped walls.

- **3D Geometry & Viewer Systems**:
  - Add applyWallEndHeightSlope in wall-system to evaluate planar slope
    continuously across miter extensions without creases.
  - Update getWallBandSplitPlanes to split horizontal face bands across
    the full sloped wall envelope.
  - Update treatments to clamp slope offsets against minimum height,
    omit trims on low walls, and make cutouts slope-aware.

- **Openings & Floorplan Tools**:
  - Update door and window ceiling clearance math, floorplan move
    handlers, and 3D move tools to respect sloped wall height.
  - Fix resolveWallRole in paint to resolve face bands by elevation Y,
    ensuring 1:1 parity with 3D mesh horizontal band splits.
  - Update 3D opening head clearance guides to sample minimum ceiling
    across the opening width.
  - Update elevation guides, measurement features with chord-projected
    t for curved walls, side move handles, and snap beacons.
@vducasse
vducasse force-pushed the feat/wall-end-height branch from e7b4a53 to 16d9557 Compare August 18, 2026 13:42
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