Repository navigation
Conversation
Aymericr
left a comment
There was a problem hiding this comment.
[Maintainer] Thanks @kruschdev. Planar slab slope (direction and pitch) is a real step towards #260 and the screenshots help. This is a large change (50 files, +2.9k / -296) that touches support election for walls and items, so I want to be careful. Status at 7ead760:
- Merge conflicts. The branch is
dirtyagainstmain; please rebase. - Bugbot findings (Medium) across the series that I would like confirmed fixed at the head, since each one is a wrong-height bug: walls ignoring the sloped slab height and the wall clamp using the full-slab rise (
slab-support.ts); the probe ignoring sloped sibling high edges (slab-support.ts); support sampled from the plane outside the slab and the pointer cap rejecting a sloped host slab (item-slab-support.ts); level-mode fence handles ignoring slope flattening (definition.render.ts). Please reply to each (fixed in / not applicable because ...), with a test where it is a behavior fix. - Overlap to coordinate. #1288 (AxiomeCG, terrain for discussion) introduces a draped slab (
slab.terrainMode) that also changes slab support election, and #1321 adds planar terrain slope. These three should agree on one meaning of "slab elevation on a slope" before any of them lands; a short note in the PR on how you see them interacting would help.
CI: GitHub Actions have not run on this head (fork workflows are waiting for maintainer approval).
7ead760 to
de48a7c
Compare
|
Thanks @Aymericr! I rebased onto Here is the commit-by-commit status for each Bugbot finding at HEAD (
Interaction with #1288 (and #1321): I closed #1321 so there is no terrain overlap there. Between #1318 and #1288's draped slab ( Verified locally after rebase: |
|
Fixed both new Bugbot findings in
Verified locally: |
|
Review at
This changes visible UI, so please attach before/after screenshots or a short clip. P0/P1: 2. Those need fixing before this can land. CI hasn't run on this fork PR yet because it needs a maintainer to approve the workflow run; it merges once that's green. |
2078f6d to
1fa6738
Compare
|
Thanks for the detailed review. I rebased onto
Note on screenshots: the PR description already includes before/after 3D, 2D floorplan, and flipped split-view captures. Added 8 regression tests covering each fix and verified green with |
|
I rebased
|
1fa6738 to
3e935cf
Compare
|
I pushed In While checking adjacent wall, stair, slab, and fence paths, I also kept |
| ...supports.map(({ slab, sampleAt }) => | ||
| slab ? getSlabElevationAtPoint(slab, sampleAt[0], sampleAt[2]) : ground, | ||
| ), | ||
| ) |
There was a problem hiding this comment.
Drag frame ignores capped ramp
High Severity
floorLift still takes each footprint's own uncapped support and never reapplies a sloped host that another footprint already accepted under the pointer cap. getFloorPlacedElevation does that re-sample, so during a downhill grab a multi-footprint cabinet renders on the overhead deck in itemFrame and then drops onto the ramp when the capped elevation commits.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit f36900d. Configure here.
There was a problem hiding this comment.
Live 3D drags compute mesh elevation through FloorElevationSystem and getFloorPlacedElevation (floor-placed-elevation.ts) using liveTransform.supportElevationCap, whereas itemFrame (floorLift in node-frames.ts) resolves static headless poses from persisted node state without pointer context. In e97e9ca0 and c6a55fc1, I also updated support-host-patch.ts to persist supportSlabId whenever a candidate slab is sloped or capped out (hasSlopedCandidate || cappedOut), aligned floorLift with floorFinishTopAt, and kept selected-surface sloped slabs on point-sampled fence elevation when slabRenderDefinition is registered, rebased onto main.
… align floorLift finish height - Skip capabilities.surfaces.top.height for slab hosts in resolveFenceLiftElevation so fences targeting a sloped slab via supportSurfaceNodeId resolve getSlabElevationAtPoint when slabRenderDefinition is registered in nodeRegistry (fixing the CI failure in lift.test.ts) without double-applying floorConstructionLift. - Pin supportSlabId in resolveSupportSlabPatch whenever any candidate slab is sloped or capped out by maxElevation, even if candidate centers sample to the same height. - Align floorLift in node-frames.ts with getFloorPlacedElevation on scripted floor finishes via floorFinishTopAt.
f36900d to
c6a55fc
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
There are 2 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 81882d6. Configure here.
| const plane = getSlabSlopePlane(slopedHostSlab) | ||
| return (x: number, z: number) => sampleSlabSlopePlane(plane, x, z) | ||
| })() | ||
| : followsTerrain && !node.supportSlabId && ctx?.supportHeightAt |
There was a problem hiding this comment.
Selected surface loses to sloped slab
Medium Severity
In selected mode, fence geometry treats any non-slab supportSurfaceNodeId as a failed slab lookup and falls back to supportSlabId. A valid roof, stair, or other surface is then ignored whenever that slab is sloped, so the railing and its gates follow the ramp. resolveFenceLiftElevation still returns the selected surface height, so handles and the mesh disagree.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 81882d6. Configure here.


What does this PR do?
Adds planar sloped slab support for manual solid slabs (ramps, driveways, sloped terraces, and flat-roof drainage falls), following the design suggested in #260 (Relates to #260; leaves roof-driven wall tops open in #260).
@pascal-app/core): Adds optionalslope: { direction, pitch }(pitchin0..45degrees,directionuphill azimuth in degrees where0 = +Xand90 = +Z) toSlabNode, keeping legacy flat scenes unchanged (E-003).packages/core/src/systems/slab/slab-slope.tsanchorsslab.elevationat the low-edge projection (minProj) of the stored polygon so adding slope or extending the high edge never sinks a ramp below the floor plane, and keeps recessed slabs and reconciler-owned floor plates flat.@pascal-app/core): UpdatesselectSlabSupportForItem,SpatialGridManager(getSlabElevationAt,getSlabSupportForItem,getPointedSupportSurfaceexact analytical ray-plane intersection,getSupportCandidatesForFootprint,getHostSlabElevationForFootprint),floor-placed-elevation,usage-field(floorUnderandapproxregion tagging),layout-clearance,procedural-items/query,clampSlabElevationForWalls, andspatial-grid-syncdirty triggers so floor-placed items and cursor picks follow the inclined surface live.@pascal-app/viewer,@pascal-app/nodes): Extrudes coplanar sloped top/bottom caps, sloped outer/hole side walls, and per-vertex slopedfillToTerrainskirts (buildTerrainPerimeterFillGeometry). Keeps top vs. side face splitting clean up to 45 degrees (cos(45°) > 0.5).@pascal-app/nodes,i18n): Draws an uphill direction arrow on sloped slabs in 2D floor plans, places 3D thickness/base handles on the sloped surface, clearsslopewhen toggling a slab torecessed, and adds a Slope section toSlabPanel(Pitch, Direction, Rotate 90°, Flip 180°, live Grade % and total rise readout, and Flat / Drainage 2% / Ramp 1:12 / Driveway 12% presets) with extracted and compiled Lingui catalogs.@pascal-app/ifc-converter,@pascal-app/mcp,skills/pascal-3d): Exports sloped slabs as inclinedIFCSLABmesh geometry rather than flatSweptSolid, evaluatesnode-world-pointon the sloped surface centroid, accepts optionalslopeinauthor_sceneusing sharedmeasurement('angle', 'deg')notation, and documents the field inskills/pascal-3d/SKILL.md.How to test
Ramp 1:12orDriveway (12%)) or drag Pitch and Direction: the slab top and underside tilt from the low edge atelevation, Grade updates with the percentage and rise, and Rotate 90° / Flip 180° reorient the uphill direction.bun run checkbun run check-typesbun run i18n:checkbun run skills:validatebun run check:render-bundlebun run --cwd packages/core test(7,692 pass, 3 skip, 0 fail)bun run --cwd packages/viewer test(1,769 pass, 0 fail)bun run --cwd packages/editor test(2,792 pass, 0 fail)bun run --cwd packages/mcp test(1,576 pass, 0 fail)bun test packages/nodes/src/slab packages/nodes/src/index.test.ts packages/ifc-converter/tests scripts/i18n.test.ts scripts/i18n-provider.test.ts scripts/i18n-literals.test.ts apps/editor/proxy.test.tsbun run --cwd apps/editor build && bun run --cwd apps/editor smoke(8/8 pass)Screenshots / screen recording
Verified live in Chrome (WebGPU) against the Next.js 16 production build (
node next start) with zero console or page errors across 3D, 2D, and Split views:3D view showing a 12° entry ramp with
fillToTerrainskirt meeting a flat upper landing, three columns stepping up the sloped surface, a hosted balustrade railing climbing the ramp, and a 15° sloped terrace with a rectangular cutout:2D floor plan and Slab inspector Slope controls (
Pitch,Direction,Rotate 90°,Flip 180°, liveGradeand rise readout, and presets), with uphill arrows anchored cleanly inside the solid slab regions (avoiding the terrace cutout):Split 2D + 3D view immediately after clicking
Flip 180°(both the 2D uphill arrow and 3D ramp/railing/columns reorient live to180°):Checklist
bun devbun checkto verify)mainbranchNote
Medium Risk
Broad changes to core floor-support election and elevation math (items, stairs, walls, drag caps); regressions could show as clipping or wrong hosts, though coverage is extensive.
Overview
Introduces optional
slope: { direction, pitch }on manual slabs (SlabNode, agentauthor_scene, persisted inauthorScene), withslab-slopeplane math soelevationstays the low-edge walking surface.Support and placement no longer use flat
slab.elevation:getSlabSupportElevationForFootprint/getSlabMinElevationForFootprint,selectSlabSupportForItem,SpatialGridManager(point queries, footprint election, ray-plane hits, candidate filtering for adjacent ramp “crown” nicks),getFloorPlacedElevation, layout clearance, stairs (base + deck rise sampling), fences, and usage-field boxes all sample height at XZ and use max contact elevation for multi-footprint and overhanging footprints.support-host-patchand pointer-cap logic are updated for sloped hosts.Authoring and editing:
slab_over_walluses max overlap top on sloped slabs; sloped slabs skip flat surface scripts, count as floating for polygon rules, and sync dirties dependents when slope changes.PolygonEditorgainssurfaceHeightAtso handles and borders follow the ramp surface.Large
sloped-slab-support/slab-slopetest coverage; slab panel i18n strings for slope UI (in provided diff).Reviewed by Cursor Bugbot for commit 81882d6. Bugbot is set up for automated code reviews on this repo. Configure here.