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 touch on wall height resolution, opening placement, and room/level bounds; behavior is consistent via shared t-aware resolvers but regressions on flat walls or opening tools are possible.

Overview
Adds 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 & rendering: resolveWallTop / effective height now take an optional param t along the wall chord; the extruder tilts top vertices via applyWallEndHeightSlope. Room auto-ceiling and level max height consider both ends of sloped boundaries.

Spatial & sync: Wall-on-wall placement uses the minimum effective height across the opening’s along-wall span; the spatial manager resolves wall data from the scene and invalidates when height, offset, or support fields change.

Editor UX: Measurement guides, move handles, elevation guides, and wall-top snap highlights sample height at the correct t instead of a single constant.

Openings: Doors and windows clamp and resize against position-dependent ceiling height (readHostWallCeiling / readHostWallCeilingMaxWidth); placement and commit require fits so openings cannot poke through a sloped top unless Alt force-place.

Reviewed by Cursor Bugbot for commit a51d552. 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
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

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

Comment thread packages/viewer/src/systems/wall/wall-system.tsx
@vducasse
vducasse force-pushed the feat/wall-end-height branch from a51d552 to 621b349 Compare August 17, 2026 15:25
- **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 interpolate vertices
    at top extrusion plane while preserving foundation fill-downs.
  - Update getWallBandSplitPlanes to split horizontal face bands across
    the full sloped wall envelope.
  - Add applyTrimSlope in treatments to slope crown molding trims.

- **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 elevation guides, side move handles, snap beacons, and
    wall measurement labels for sloped walls.
@vducasse
vducasse force-pushed the feat/wall-end-height branch from 621b349 to 8cedc3a Compare August 17, 2026 15:29
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