feat(fence): add horizontal-board fence style with capped posts

Adds a `horizontal` fence style that builds composite-cladding panels —
horizontal boards stacked between square intermediate posts — instead of
the vertical pickets that slat/rail/privacy all produce today.

- New `style: 'horizontal'` (core schema + inspector Style control).
- Posts march along the whole span at `postSpacing`, each with a cap.
- New `postCap` control (none/flat/pyramid, default pyramid); pyramid
  caps render as a 4-sided cone fence part.
- New `slatGap` control for the board reveal — 0 collapses to one flush
  panel so the stacked-board seams don't read as lines.
- `postCap` + `slatGap` are horizontal-only (visibleIf); postCap uses a
  labelled dropdown so its options aren't a context-free switch.
- Lower the `postSpacing` inspector minimum from 0.2 to 0.05 m.
- 2D floor plan reuses the solid-panel marker for horizontal.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Wassim SAMAD
2026-06-19 12:57:24 -04:00
co-authored by Claude Opus 4.8
parent ee4d6de206
commit 346b5d8cbe
5 changed files with 157 additions and 7 deletions
+2
View File
@@ -154,6 +154,8 @@ export const fenceDefinition: NodeDefinition<typeof FenceNode> = {
topRailHeight: 0.04,
groundClearance: 0,
edgeInset: 0.015,
slatGap: 0.01,
postCap: 'pyramid',
baseStyle: 'grounded',
showInfill: true,
color: '#ffffff',
+2 -2
View File
@@ -20,7 +20,7 @@ import type { FenceNode } from './schema'
* b. White underlay — the visual "fence body" base layer.
* c. Dark accent — the actual fence outline.
* 2. Style-aware markers at computed positions along the centerline:
* - `privacy`: rotated rectangle (vertical slat).
* - `privacy` / `horizontal`: rotated rectangle (solid panel).
* - `rail`: concentric circle stack (post + ring + tiny center).
* - default `slat`: white X mark with a coloured X on top.
* 3. Markers thinned when `showInfill === false` — only first + last
@@ -89,7 +89,7 @@ function buildMarker(
): FloorplanGeometry {
const markerStrokeWidth = isActive ? 1.65 : 1.35
if (fence.style === 'privacy') {
if (fence.style === 'privacy' || fence.style === 'horizontal') {
const w = clamp(fence.postSize * 0.58, 0.038, 0.068)
const h = clamp(Math.max(fence.baseHeight * 0.5, fence.postSize * 1.4), 0.1, 0.17)
// Surface plate underneath + accent rectangle on top — gives a clean
+21 -3
View File
@@ -9,7 +9,7 @@ import type { FenceNode } from './schema'
* - **Dimensions**: Length (derived from start/end), Curve (sagitta
* with dynamic bounds), Height, Thickness.
* - **Structure**: Base Height, Top Rail, Post Spacing, Post Size,
* Ground Clear, Edge Inset.
* Post Cap + Slat Gap (horizontal-only), Ground Clear, Edge Inset.
*
* Length + Curve use the `custom` field kind because they don't map
* to single number fields with static bounds — see `inspector-editors.tsx`.
@@ -22,7 +22,7 @@ export const fenceParametrics: ParametricDescriptor<FenceNode> = {
{
key: 'style',
kind: 'enum',
options: ['slat', 'rail', 'privacy'],
options: ['slat', 'rail', 'privacy', 'horizontal'],
display: 'segmented',
},
{
@@ -48,8 +48,26 @@ export const fenceParametrics: ParametricDescriptor<FenceNode> = {
fields: [
{ key: 'baseHeight', kind: 'number', unit: 'm', min: 0.04, max: 1, step: 0.01 },
{ key: 'topRailHeight', kind: 'number', unit: 'm', min: 0.01, max: 0.25, step: 0.005 },
{ key: 'postSpacing', kind: 'number', unit: 'm', min: 0.2, max: 5, step: 0.05 },
{ key: 'postSpacing', kind: 'number', unit: 'm', min: 0.05, max: 5, step: 0.01 },
{ key: 'postSize', kind: 'number', unit: 'm', min: 0.01, max: 0.4, step: 0.005 },
{
// Dropdown (not segmented) so the inspector renders its "Post Cap"
// label — a bare segmented `None / Flat / Pyramid` switch reads
// contextless.
key: 'postCap',
kind: 'enum',
options: ['none', 'flat', 'pyramid'],
visibleIf: (n) => n.style === 'horizontal',
},
{
key: 'slatGap',
kind: 'number',
unit: 'm',
min: 0,
max: 0.1,
step: 0.002,
visibleIf: (n) => n.style === 'horizontal',
},
{ key: 'groundClearance', kind: 'number', unit: 'm', min: 0, max: 0.6, step: 0.005 },
{ key: 'edgeInset', kind: 'number', unit: 'm', min: 0.005, max: 0.25, step: 0.005 },
],