Skip to content

fence: add spline runs, patterns, gates, and openings - #915

Merged
wass08 merged 16 commits into
pascalorg:mainfrom
sudhir9297:t3code/understand-fence-code
Oct 6, 2026
Merged

wass08 merged 16 commits into
pascalorg:mainfrom
sudhir9297:t3code/understand-fence-code

Conversation

@sudhir9297

@sudhir9297 sudhir9297 commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

  • Fence drawing and styling
    • Issue: Fence paths lacked spline editing, freehand drawing, and controls for spans, surfaces, and patterns.
    • Fixed: Adds editable spline and freehand paths with span, surface, and pattern controls.
  • Gates and openings
    • Issue: Gates and open passages could not be placed and edited as independent fence features.
    • Fixed: Adds independently editable gates and openings, including exported gate leaf opening animations.
  • Surface support
    • Issue: Fence paths and other supported nodes did not consistently follow shaped support surfaces.
    • Fixed: Resolves support height from node footprints, including slab holes.

How to test

  1. Run bun dev and draw a freehand fence and a spline fence; verify each follows the path.
  2. Change fence span, surface, and pattern settings; verify the geometry updates.
  3. Place and edit a gate and open passage, then save and reload; verify the gate animation clips are exported.
  4. Run bun run check, bun run skills:validate, bun run check-types, bun run test, and bun run build.

Screenshots / screen recording

Not added yet.

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
Touches core fence schema, scene graph hosting, geometry/surface sampling, and editor placement flows across 2D and 3D; new node kinds add breadth but changes are localized to fence systems with added tests.

Overview
Adds gates and open passages as child nodes (fence-gate, fence-opening) with placement tools, overlap rules, 2D/3D affordances, inspector controls, scene-tree nesting, and Build/XR sidebar sections when a fence is selected or the fence tool is active.

Extends the fence model and drawing: picket style and pattern/surface/transition fields, per-span straight vs curve (spanModes), freehand continuation, draft snap via registry extension, and spline sampling reparameterized by arc length. Fences can follow shaped support (supportSurfaceNodeId, supportHeightAt / surfaceHeightAt) with updated base elevation and construction support resolution.

Rendering and UX split centerline strokes at features, show gate symbols in plan, support path-aligned resize handles (dragAxis), gate open/close with live overrides plus export animation clips, and refresh defaults (picket, white slots, schema v3, cascade delete of feature children).

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

@pascal

pascal Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

I hit an error while handling your request (Model unavailable on AI Gateway free tier: Free tier users do not have access to this model. Upgrade to paid credits at https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%3Fmodal%3Dtop-up for unrestricted…).

Please try again, rephrase, or reach out if it keeps failing.

Error id: 84181af7-f372-4f31-8449-cdc45980889c

@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.

Stale Bugbot comment from a previous run.

Comment thread packages/nodes/src/fence/drafting.ts
Comment thread packages/core/src/systems/fence/fence-features.ts
Comment thread packages/core/src/systems/fence/fence-features.ts

@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.

Stale Bugbot comment from a previous run.

Comment thread packages/nodes/src/fence/features.ts
- Add configurable picket geometry, placement, and inspector controls
- Improve spline spacing, snapping, and drafting previews
- Model fence gates and passages as selectable child nodes
- Add placement, editing, and floorplan workflows for fence features
- Expand fence and host parameter ranges for large values
- Generalize draft measurements for wall and rectangle previews
- Rebuild geometry when live node overrides change
- Register fence snapping and move tools with the node package
- Update lifecycle fixtures and host-child schema coverage
- Add registry support-height callbacks for data-defined top surfaces
- Use slab footprints and holes when sampling scene support
- Document support-height behavior for node authors
@sudhir9297
sudhir9297 force-pushed the t3code/understand-fence-code branch from 3491259 to 594dff3 Compare October 5, 2026 16:58

@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.

Stale Bugbot comment from a previous run.

Comment thread packages/nodes/src/fence/drafting.ts
Comment thread packages/nodes/src/fence/parametrics.ts
Comment thread packages/nodes/src/fence-feature/definition.ts
wass08 and others added 2 commits October 6, 2026 08:20
- Remove the inline `fence.features` → child migration: fences never
  persisted `features` on main, so it only converted unreleased data.
- Keep the frozen-corpus check strict for fences by listing the new
  defaults instead of downgrading to toMatchObject.
- Import fenceDefinition from source in lift.test.ts so it does not
  depend on a fresh nodes dist build.
- Reduce the gate/opening post-height and picket matrices to
  representative cases that still cover every style, base, cap and top.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XtJ2VTnBhSp9CoeS8DSMAm
…n menu

- Gate and opening tiles reuse BuildToolTile, so they carry labels and the
  active tile is no longer clipped by a nested scroll container.
- A selected gate gets the door's Open/Close button (E) in the action menu.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XtJ2VTnBhSp9CoeS8DSMAm

@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.

Stale Bugbot comment from a previous run.

Comment thread packages/nodes/src/fence/tool.tsx
Comment thread packages/nodes/src/fence/tool.tsx
Comment thread packages/nodes/src/fence/geometry.ts
path: 'supportSurfaceNodeId',
...policy('node', 'host', 'drop', 'strip'),
remaps: ['clone-scene-graph'],
}),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surface host skip missing on delete

Medium Severity

The new supportSurfaceNodeId inventory row remaps only clone-scene-graph. Unlike supportSlabId, it does not include delete-nodes, so deleting the chosen surface can leave a stale host id on the fence.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f1a0b62. Configure here.

Comment thread packages/core/src/systems/fence/fence-features.ts
Resolve fence import conflicts after fence slots moved to core.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XtJ2VTnBhSp9CoeS8DSMAm

@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 2 potential issues.

There are 3 total unresolved issues (including 1 from previous review).

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 9b34d62. Configure here.

createNode(fence, currentLevelId)
sfxEmitter.emit('sfx:structure-build')
sceneApi.upsert(fence, currentLevelId)
triggerSFX('sfx:structure-build')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curved two-point fences commit straight

High Severity

createSplineFenceOnCurrentLevel now stores path with tangents left undefined and no spanModes. A two-point curved draft therefore hits the default straight span rule, so the common start-end curve commits as a straight run. Freehand paths with three or more points get the opposite default and become smoothed curves instead of the drawn polyline.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9b34d62. Configure here.

]
: []),
...(pipe
? [

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

XR gate tiles never show active

Low Severity

Wand secondary items for Add Gate and Add Open Passage hardcode active: false. The desktop build tab lights the tile from placingFenceFeature, so the XR panel never shows which placement tool is armed.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9b34d62. Configure here.

@wass08
wass08 merged commit 44285b5 into pascalorg:main Oct 6, 2026
5 checks passed
AxiomeCG added a commit to AxiomeCG/editor that referenced this pull request Oct 6, 2026
…ir winders) into the shared tools foundation

Where main and this branch did the same thing, main's version stands:
- measure_stair and fit_stair (pascalorg#1000) are shared tools next to create_stair:
  one stairs contract module and both operations registered.
- verify_scene keeps main's informational issues (hasIssues ignores
  severity 'info') with this branch's authored objects and checks.
- create_stair_between_levels stays replaced by create_stair; main's
  sizing of a new flight from the design targets (planStairCreation)
  is carried into create_stair in the next commit.
- The tool lists (annotations, README, the skill) gain main's two tools.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AxiomeCG added a commit to AxiomeCG/editor that referenced this pull request Oct 6, 2026
…irs, pascalorg#996 hosted service contracts) into the doors fix

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AxiomeCG added a commit to AxiomeCG/editor that referenced this pull request Oct 6, 2026
…irs, pascalorg#996 hosted service contracts) into the embed mode

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants