Overview
Nodes are the data primitives that describe the 3D scene in Pascal Editor. All nodes extendBaseNode and are stored in a flat dictionary structure with parent-child relationships defined via parentId.
BaseNode Structure
All nodes in the scene extend theBaseNode schema defined with Zod:
packages/core/src/schema/base.ts:21-30
Core Properties
string
required
Auto-generated unique identifier with type prefix (e.g.,
wall_abc123, item_xyz789)string
required
Node type discriminator used for type-safe handling (
'site', 'building', 'level', 'wall', etc.)string | null
default:"null"
Reference to parent node ID. Null for root nodes (typically Site nodes).
boolean
default:"true"
Controls whether the node is rendered in the 3D scene.
Camera
Optional saved camera position for this node (used for viewpoint navigation).
JSON
default:"{}"
Arbitrary metadata object. Use
{ isTransient: true } to prevent persistence to IndexedDB.Node Hierarchy
Nodes form a tree structure representing the building hierarchy:While nodes form a logical tree, they are stored in a flat dictionary (
Record<id, Node>), not a nested structure. Parent-child relationships are defined via parentId and children arrays.Node Types
The SDK provides type-safe node schemas using Zod’s discriminated union:packages/core/src/schema/types.ts:16-35
Structural Nodes
SiteNode
Represents a site/property. Root node of the scene hierarchy.packages/core/src/schema/nodes/site.ts:21-39
BuildingNode
Represents a building within a site.packages/core/src/schema/nodes/building.ts:6-12
LevelNode
Represents a floor level in a building.packages/core/src/schema/nodes/level.ts:12-18
Building Elements
WallNode
Represents a wall defined by start and end points.[number, number]
required
Start point in level coordinate system (2D: x, z)
[number, number]
required
End point in level coordinate system (2D: x, z)
number
default:"0.1"
Wall thickness in meters
number
default:"2.5"
Wall height in meters
packages/core/src/schema/nodes/wall.ts:9-22
SlabNode
Represents a floor slab defined by a polygon.Array<[number, number]>
required
Array of [x, z] points defining the slab boundary
Array<Array<[number, number]>>
default:"[]"
Array of hole polygons (for openings in the slab)
number
default:"0.05"
Elevation in meters (thickness of the slab)
packages/core/src/schema/nodes/slab.ts:5-13
ItemNode
Represents furniture, fixtures, or other 3D assets.Asset
required
Asset data including model source, dimensions, attachment behavior, and corrective transforms
string
Wall ID when asset is attached to a wall
number
Parametric position (0-1) along the wall when attached
[number, number, number]
default:"[1, 1, 1]"
Scale factor for the asset (applied to asset.dimensions)
packages/core/src/schema/nodes/item.ts:28-42
Flat Dictionary Storage
Nodes are stored in a flat dictionary rather than a nested tree:packages/core/src/store/use-scene.ts:14-23
Benefits of Flat Storage
Fast Lookups
Direct access to any node by ID without tree traversal:
nodes[id]Easy Updates
Update nodes without cloning entire tree structure
Simple Serialization
Easy to persist to IndexedDB or serialize to JSON
Flexible Relationships
Supports multiple parent-child patterns (walls, surfaces, attachments)
ID Generation
Node IDs are auto-generated with type prefixes using nanoid:site_a1b2c3d4e5f6g7h8wall_x9y8z7w6v5u4t3s2item_p0o9i8u7y6t5r4e3
packages/core/src/schema/base.ts:5-13