feat(wall): add endHeightOffset for sloped top edge - #640
Conversation
Fixes a bug where negative offset values caused wall geometry to self-intersect and drop below the base. The value is now strictly clamped to 0 at the Zod schema, UI, and geometry generation layers.
| const rawOffset = wallNode.endHeightOffset | ||
| console.log('[applyWallEndHeightSlope] called', { rawOffset, wallLength, topY, height: wallNode.height }) | ||
| if (!rawOffset || wallLength < 1e-9) { | ||
| console.log('[applyWallEndHeightSlope] early return', { rawOffset, wallLength }) |
There was a problem hiding this comment.
Debug logs in slope helper
Medium Severity
applyWallEndHeightSlope still contains temporary console.log calls, including on the early-return path. generateExtrudedWall runs this for every wall rebuild (render and collision), so the console fills with debug output even when endHeightOffset is unset.
Reviewed by Cursor Bugbot for commit f9213c2. Configure here.
# Conflicts: # packages/nodes/src/wall/panel.tsx
There was a problem hiding this comment.
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).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 402111e. Configure here.
| for (let i = 0; i < position.count; i++) { | ||
| if (Math.abs(position.getY(i) - topY) > 1e-4) continue | ||
| const t = THREE.MathUtils.clamp(position.getX(i) / wallLength, 0, 1) | ||
| position.setY(i, topY + endHeightOffset * t) |
There was a problem hiding this comment.
Curved walls warp sloped top
Medium Severity
applyWallEndHeightSlope drives the top height from chord-local X / wallLength, while curved footprints offset the two faces along arc normals. Those opposite-edge vertices get different local X values at the same station, so front and back tops rise by different amounts and the top surface warps whenever curveOffset and endHeightOffset are both set.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 402111e. Configure here.
| if (Math.abs(position.getY(i) - topY) > 1e-4) continue | ||
| const t = THREE.MathUtils.clamp(position.getX(i) / wallLength, 0, 1) | ||
| position.setY(i, topY + endHeightOffset * t) | ||
| } |
There was a problem hiding this comment.
Placement height ignores end offset
Medium Severity
Geometry can extend above the flat wall top by endHeightOffset, but height helpers used for wall placement and overlays still resolve only the unsloped top. Near the taller end, wall-mounted items can be snapped or rejected as if the wall stopped at the original height even though the mesh continues higher.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 402111e. Configure here.


What does this PR do?
Adds an
endHeightOffsetproperty to theWallNodeschema 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
End height offsetslider.Screenshots / screen recording
Checklist
bun devbun checkto verify)mainbranchNote
Medium Risk
Touches core wall schema persistence and the main extrusion/CSG path; sloped tops may interact with face-band height logic and material assignment that still assume a flat effective height. Debug logging in the viewer path would spam the console on every rebuild until removed.
Overview
Adds optional
endHeightOffseton walls so the top edge ramps from the start (unchanged) to a taller end—useful for knee walls along a single-pitch roof—without reshaping the plan footprint.The wall schema documents and validates the field (non-negative, meters). The wall properties panel gets an End height offset slider (0–3 m, unit-aware) under the top dimensions. Extruded wall mesh generation applies
applyWallEndHeightSlopeafter the standard extrude: vertices on the flat top attopYare raised along local X by a linear blend from 0 at start toendHeightOffsetat end, before normals, material groups, and opening CSG.Note: the new geometry helper still includes
console.logdebug output that should be removed before merge.Reviewed by Cursor Bugbot for commit 402111e. Bugbot is set up for automated code reviews on this repo. Configure here.