sync: update core and viewer from monorepo (#143)

Major changes:
- Roof system rewrite with roof-segment support
- Scene store refactor
- Spatial grid improvements
- Item light system
- Post-processing and selection manager updates
- Perf monitor component

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Aymeric Rabot
2026-03-20 23:18:30 -04:00
committed by GitHub
co-authored by Claude Opus 4.6
parent bafc5973a3
commit 1d28e4208f
32 changed files with 1921 additions and 619 deletions
+1
View File
@@ -23,6 +23,7 @@ export type {
export { getScaledDimensions, ItemNode } from './nodes/item'
export { LevelNode } from './nodes/level'
export { RoofNode } from './nodes/roof'
export { RoofSegmentNode, RoofType } from './nodes/roof-segment'
export { ScanNode } from './nodes/scan'
// Nodes
export { SiteNode } from './nodes/site'
@@ -0,0 +1,44 @@
import dedent from 'dedent'
import { z } from 'zod'
import { BaseNode, nodeType, objectId } from '../base'
export const RoofType = z.enum(['hip', 'gable', 'shed', 'gambrel', 'dutch', 'mansard', 'flat'])
export type RoofType = z.infer<typeof RoofType>
export const RoofSegmentNode = BaseNode.extend({
id: objectId('rseg'),
type: nodeType('roof-segment'),
// Position relative to parent roof group
position: z.tuple([z.number(), z.number(), z.number()]).default([0, 0, 0]),
// Rotation around Y axis in radians
rotation: z.number().default(0),
// Roof shape type
roofType: RoofType.default('gable'),
// Footprint dimensions
width: z.number().default(8),
depth: z.number().default(6),
// Vertical dimensions
wallHeight: z.number().default(0.5),
roofHeight: z.number().default(2.5),
// Structure thicknesses
wallThickness: z.number().default(0.1),
deckThickness: z.number().default(0.1),
overhang: z.number().default(0.3),
shingleThickness: z.number().default(0.05),
}).describe(
dedent`
Roof segment node - an individual roof module within a roof group.
Each segment generates a complete architectural volume (walls + roof).
Multiple segments can be combined to form complex roof shapes.
- roofType: hip, gable, shed, gambrel, dutch, mansard, flat
- width/depth: footprint dimensions
- wallHeight: height of walls below the roof
- roofHeight: height of the roof peak above the walls
- wallThickness/deckThickness: structural thicknesses
- overhang: eave overhang distance
- shingleThickness: outer shingle layer thickness
`,
)
export type RoofSegmentNode = z.infer<typeof RoofSegmentNode>
+9 -16
View File
@@ -1,32 +1,25 @@
import dedent from 'dedent'
import { z } from 'zod'
import { BaseNode, nodeType, objectId } from '../base'
import { RoofSegmentNode } from './roof-segment'
export const RoofNode = BaseNode.extend({
id: objectId('roof'),
type: nodeType('roof'),
// Position of the roof center (Y should typically be 0)
// Position of the roof group center
position: z.tuple([z.number(), z.number(), z.number()]).default([0, 0, 0]),
// Rotation around Y axis in radians
rotation: z.number().default(0),
// Length of the roof along the ridge direction (in meters)
length: z.number().default(4),
// Height of the roof peak from the base
height: z.number().default(1.5),
// Width of the left slope (in meters, measured horizontally from ridge)
leftWidth: z.number().default(1.5),
// Width of the right slope (in meters, measured horizontally from ridge)
rightWidth: z.number().default(1.5),
// Child roof segment IDs
children: z.array(RoofSegmentNode.shape.id).default([]),
}).describe(
dedent`
Roof node - used to represent a gable roof in the building
- position: center position of the roof (Y typically 0)
Roof node - a container for roof segments.
Acts as a group that holds one or more RoofSegmentNodes.
When not being edited, segments are visually combined into a single solid.
- position: center position of the roof group
- rotation: rotation around Y axis
- length: length of the roof along the ridge
- height: height of the roof peak
- leftWidth: horizontal width of the left slope (from ridge to eave)
- rightWidth: horizontal width of the right slope (from ridge to eave)
Total width = leftWidth + rightWidth
- children: array of RoofSegmentNode IDs
`,
)
+2
View File
@@ -6,6 +6,7 @@ import { GuideNode } from './nodes/guide'
import { ItemNode } from './nodes/item'
import { LevelNode } from './nodes/level'
import { RoofNode } from './nodes/roof'
import { RoofSegmentNode } from './nodes/roof-segment'
import { ScanNode } from './nodes/scan'
import { SiteNode } from './nodes/site'
import { SlabNode } from './nodes/slab'
@@ -23,6 +24,7 @@ export const AnyNode = z.discriminatedUnion('type', [
SlabNode,
CeilingNode,
RoofNode,
RoofSegmentNode,
ScanNode,
GuideNode,
WindowNode,