Skip to main content

Overview

The WallNode represents a wall element within a level. Walls are defined by start and end points in 2D space, with thickness and height properties. Walls can have items attached to them (doors, windows, etc.). Key features:
  • Linear wall defined by start/end points
  • Configurable thickness and height
  • Can host wall-mounted items (doors, windows, fixtures)
  • Space detection for interior/exterior classification

Type Signature

import { z } from 'zod'
import { BaseNode, nodeType, objectId } from '../base'
import { ItemNode } from './item'

const WallNode = BaseNode.extend({
  id: objectId('wall'),
  type: nodeType('wall'),
  children: z.array(ItemNode.shape.id).default([]),
  thickness: z.number().optional(),
  height: z.number().optional(),
  start: z.tuple([z.number(), z.number()]),
  end: z.tuple([z.number(), z.number()]),
  frontSide: z.enum(['interior', 'exterior', 'unknown']).default('unknown'),
  backSide: z.enum(['interior', 'exterior', 'unknown']).default('unknown'),
})

type WallNode = z.infer<typeof WallNode>
Source: /home/daytona/workspace/source/packages/core/src/schema/nodes/wall.ts

Fields

Inherited from BaseNode

id
string
required
Unique wall identifier.Format: wall_{randomString}Example: "wall_a1b2c3d4e5f6g7h8"
type
string
required
Always set to "wall".Default: "wall"
name
string
Optional name for the wall.Example: "North Wall", "Exterior Wall A"
parentId
string | null
required
Reference to the parent level’s ID.Example: "level_abc123"Default: null
visible
boolean
Controls wall visibility.Default: true
camera
CameraSchema
Optional camera viewpoint for the wall.
metadata
any
Custom metadata for the wall.Default: {}

Wall-Specific Fields

start
[number, number]
required
Start point of the wall in the level coordinate system.Format: [x, z] in meters (2D coordinates)Example: [0, 0]The Y coordinate is implied by the level’s elevation.
end
[number, number]
required
End point of the wall in the level coordinate system.Format: [x, z] in meters (2D coordinates)Example: [5, 0] (5-meter horizontal wall)The wall extends linearly from the start point to the end point.
thickness
number
Thickness of the wall in meters.Example: 0.2 (20cm wall), 0.3 (30cm wall)If not specified, a default thickness may be applied by the renderer.
height
number
Height of the wall in meters.Example: 2.8 (2.8m ceiling height), 3.0 (3m ceiling height)If not specified, a default height may be applied by the renderer.
frontSide
'interior' | 'exterior' | 'unknown'
Classification of the space on the front side of the wall.Default: "unknown"Values:
  • "interior" - Front side faces an interior space
  • "exterior" - Front side faces the outside
  • "unknown" - Not yet determined
Used for cutaway rendering and visualization modes.
backSide
'interior' | 'exterior' | 'unknown'
Classification of the space on the back side of the wall.Default: "unknown"Values:
  • "interior" - Back side faces an interior space
  • "exterior" - Back side faces the outside
  • "unknown" - Not yet determined
Used for cutaway rendering and visualization modes.
children
Array<string>
required
Array of item node IDs attached to this wall (doors, windows, fixtures).Default: []Example: ["item_door_001", "item_window_001"]Wall-mounted items reference the wall and their position along it using the wallId and wallT fields.

Example

import { WallNode } from '@pascal/core/schema/nodes/wall'

const wall: WallNode = {
  object: 'node',
  id: 'wall_abc123',
  type: 'wall',
  name: 'South Wall',
  parentId: 'level_xyz789',
  visible: true,
  start: [0, 0],
  end: [8, 0],
  thickness: 0.2,
  height: 2.8,
  frontSide: 'interior',
  backSide: 'exterior',
  children: [
    'item_door_main',
    'item_window_001',
  ],
  metadata: {
    material: 'brick',
    insulated: true,
  },
}

Usage

Creating a Simple Wall

import { WallNode } from '@pascal/core/schema/nodes/wall'

const wall = WallNode.parse({
  start: [0, 0],
  end: [5, 0],
  thickness: 0.2,
  height: 2.8,
})

Creating Connected Walls

// Rectangle room with 4 walls
const walls = [
  WallNode.parse({
    name: 'North Wall',
    start: [0, 0],
    end: [8, 0],
    thickness: 0.2,
    height: 2.8,
  }),
  WallNode.parse({
    name: 'East Wall',
    start: [8, 0],
    end: [8, 6],
    thickness: 0.2,
    height: 2.8,
  }),
  WallNode.parse({
    name: 'South Wall',
    start: [8, 6],
    end: [0, 6],
    thickness: 0.2,
    height: 2.8,
  }),
  WallNode.parse({
    name: 'West Wall',
    start: [0, 6],
    end: [0, 0],
    thickness: 0.2,
    height: 2.8,
  }),
]

Wall with Space Detection

const exteriorWall = WallNode.parse({
  name: 'Exterior Wall',
  start: [0, 0],
  end: [10, 0],
  thickness: 0.3, // Thicker exterior wall
  height: 3.0,
  frontSide: 'interior',
  backSide: 'exterior',
})

const interiorWall = WallNode.parse({
  name: 'Interior Partition',
  start: [5, 0],
  end: [5, 8],
  thickness: 0.15, // Thinner interior wall
  height: 2.8,
  frontSide: 'interior',
  backSide: 'interior',
})

Adding Wall-Mounted Items

import { ItemNode } from '@pascal/core/schema/nodes/item'

// Create wall
const wall = WallNode.parse({
  start: [0, 0],
  end: [8, 0],
  thickness: 0.2,
  height: 2.8,
})

// Create door attached to wall
const door = ItemNode.parse({
  wallId: wall.id,
  wallT: 0.5, // Center of wall (0-1 parametric position)
  asset: {
    id: 'door-001',
    category: 'doors',
    name: 'Standard Door',
    src: '/models/door.glb',
    dimensions: [0.9, 2.1, 0.1],
    attachTo: 'wall',
  },
})

// Update wall's children
wall.children = [door.id]

Wall Geometry

The wall is rendered as a 3D rectangular volume:
  • Length: Distance from start to end point
  • Width: Thickness
  • Height: Height property
        ┌─────────────────┐
        │                 │  ← height
        │                 │
        └─────────────────┘
        ↑                 ↑
      start              end
        ←─────────────────→
             length
        
        thickness →│  │

Coordinate System

Walls use 2D coordinates in the level’s XZ plane:
  • X axis: horizontal (left-right)
  • Z axis: horizontal (front-back)
  • Y axis: vertical (implied by level elevation and wall height)

Build docs developers (and LLMs) love