Repository navigation
[Maintainer] wall: add endHeightOffset for a sloped top edge - #1248
Conversation
- **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.
…mits, and required t
Non-trivial resolutions: - wall-top: kept main's storey/railing semantics; `t` is required after `electedBase`, before main's optional `authoredStoreyHeight`. getWallTop takes `t`; new getWallTopOver gives the lowest top across a span. - Opening clamps moved to core/building/wall-openings with main's refactor: clampDoorToWall/clampWindowToWall return `fits` from the sloped ceiling over the opening's span (new wallOpeningCeilingOver); nodes door/window math stay re-exports. Door/window tools, move tools and floorplan moves gate on `fits`, including main's corner-snap path. - Face bands were removed on main: dropped the PR's band-plane and band slider changes. Trims now slope crowns through main's per-run slope and cut casings with the same slope-aware overlap. - Viewer: slope applied in main's extrusion; opening cut tops clamp to the sloped top on straight and curved (band) cuts. - scene-query.ts deleted on main; its height read lives in level-reads (t=0). - Main's new call sites: span minimum for opening fit, max of both ends for envelopes (roof bearing, usage field, IFC, clash checks), 0.5 for handles and overlays, 0 for reported/seeded heights. - Compact wall panel (panel-model) gets the end-height-offset row, mirroring the full panel's slider.
… a sloped top Plugins pinned to the public API (bath-space, landscape, webxr) call it without `t`, which failed the app typecheck after the merge. Omitting `t` now answers the height the whole wall clears.
fr/es/ja/zh-CN entries are fuzzy drafts awaiting human review. Co-authored-by: vducasse <[email protected]>
`t` moves after main's optional `authoredStoreyHeight` and defaults to the start, so an existing four-argument call keeps its meaning instead of reading the storey height as a position.
…ach station Openings are placed by arc length but the top slopes along the chord. New getWallChordFractionAt / getWallStationAtChordFraction map between the two; getWallTopOver, the opening fit range, the build-json opening check, the whole-wall ceiling and the side-handle width cap use them.
A flat wall keeps main's behaviour: an opening taller or wider than the wall clamps and stays placeable, matching what the agent path checks.
Each piece starts at the original top where it begins and carries its share of the end offset; pieces after a storey-bound start take explicit heights.
…one line Reversing a wall turns its slope around. A merge or delete heal needs the tops to meet at the joint with the same rise per metre, and the merged wall carries the summed end offset; flat walls compare as before.
Each wall prism rises to the higher end and an inclined half-space through both end tops cuts it down, so the IFC body matches the drawn wall and openings still void it.
Offsets get no static bounds; the floor that keeps the lower end standing stays.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4a951beb8a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4a951be. Configure here.
…s top Placing or moving a door or window through the agent plans now honours the wall clamps' fit, as the editor does, with wall_too_low. Flat walls always fit, so they place exactly as before. Co-authored-by: vducasse <[email protected]>
Brings in #1249 (typed wall length/angle, shared usePlacementTyping store, floorplan typing keys/HUD, typed cabinet coordinates). No source file was changed on both sides; the textual conflicts were limited to generated catalogs. Resolutions: - packages/editor/src/i18n/locales/{en,en-XA}/messages.ts: compiled catalogs conflicted; took main's copy and regenerated with `bun run i18n:extract`, which re-adds this branch's end height offset strings alongside #1249's typing strings. The PO catalogs auto-merged and extraction left them unchanged; `bun run i18n:check` passes. Co-authored-by: vducasse <[email protected]>
The sloped top was evaluated as `height + slope * x` at every top vertex, including miter vertices outside [0, L]. The offset clamp only guarantees the centreline endpoints stay MIN_WALL_END_HEIGHT high, so a steep fall at an end miter (or a steep rise at a start miter) put top vertices below the wall base and inverted the body. `wallTopYAt` floors the sampled top at MIN_WALL_END_HEIGHT and is shared by the top tilt, the band cutter and the opening cutter tops. Co-authored-by: vducasse <[email protected]>
add_door and move_node checked the door's height against the wall top at the requested position before clampDoorToWall could slide it. A door asked for near the low end of a wall rising toward its other end was refused with wall_too_low, although the editor (and the clamp's centresUnderCeiling interval) moves it to a stretch where it fits. Both plans now clamp first, refuse through the clamp's `fits` when no stretch takes the door, and run the height check at the clamped centre, so a flat wall that is too low still refuses as before. Co-authored-by: vducasse <[email protected]>
A wall with a nonzero endHeightOffset is modelled as a prism standing to its taller end over the whole footprint, which claims solid volume above the lower stretch of the top, yet it was labelled `shape: 'exact'`, so clash and clearance findings near the low end read as exact collisions. Wall body pieces of a sloped wall, and its crown trim (seated under the taller top), are now `approx` with a `why`, as the module labels other conservative shapes; flat walls and other trims stay exact. Co-authored-by: vducasse <[email protected]>
…ments
Conflicts:
- packages/editor/src/i18n/locales/{en,en-XA}/messages.ts: compiled
catalogs conflicted on both branches' new messages; regenerated with
`bun run i18n:extract` rather than hand-merged. `bun run i18n:check`
passes.
Everything else auto-merged; `bun run ci` covers the files both sides
touched (core/index.ts, floating-action-menu.tsx, en/messages.po).
Co-authored-by: sudhir <[email protected]>

What does this PR do?
Maintainer port of #640 by @vducasse, merged with current
main, with review fixes on top. Vincent's commits keep their authorship.From #640: a wall gets an optional
endHeightOffset, and its top slopes linearly fromheightat the start toheight + endHeightOffsetat the end. This covers knee walls, lean-to and attic partitions.unsupported_wall_print_slope.Maintainer changes:
main: opening clamps moved tocore/building/wall-openingswith afitsresult, and main's removed face bands dropped from the PR. New call sites on main choose a sample point along the wall:reverseWallDirectionflips the slope.main. The newfitsgate applies only to sloped walls.tparameter is the last argument ofresolveWallTopandresolveWallEffectiveHeight, with a default, so existing four-argument calls keep their meaning.add_door,add_windowandmove_noderefuse withwall_too_lowan opening that fits nowhere under a sloped wall's top (bcace739).bc3b712a).449d83e5).509b34f7).mainagain after [Maintainer] Typed wall length and angle, and typed cabinet coordinates #1249 (fefd5cab). Only the compiled en and en-XA catalogs conflicted; they were regenerated withi18n:extract.How to test
bun dev, select a wall, and set "End height offset" to −1.5 m: the top slopes down toward the wall's end.main.bun test packages/core/src/systems/wall packages/core/src/building packages/core/src/spatial/usage-field packages/viewer/src/systems/wall packages/ifc-converter.Screenshots / screen recording
Sloped walls in a demo scene from this branch: the east walls rise from 1 m to 4 m and the west walls fall from 4 m to 1 m.
Sloped walls
The inspector field and the original captures are in #640.
Checklist
bun devbun checkto verify)mainbranchLocal
bun run cipassed on509b34f7(exit 0). An earlierqualityfailure on4a951beb, in the ifc-converter test "scaling > grows linearly with the number of rooms", was a timing flake:main's CI with ratios of 6.3–11.5.P3 follow-ups from the earlier review:
reverseWallDirectiononly flips the offset on storey-bound walls.Supersedes #640. Credit: @vducasse.
Co-authored-by: vducasse [email protected]
To show artifacts inline, enable in settings.
Note
Medium Risk
Touches core wall-top resolution, opening placement, and merge/split topology across core, editor, and IFC; mitigated by broad tests and an optional backward-compatible field.
Reviewed by Cursor Bugbot for commit 509b34f. Bugbot is set up for automated code reviews on this repo. Configure here.