> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/pascalorg/editor/llms.txt
> Use this file to discover all available pages before exploring further.

# WallNode

> Node representing a wall element with start/end points, thickness, and height

## 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

```typescript theme={null}
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

<ParamField path="id" type="string" required>
  Unique wall identifier.

  **Format**: `wall_{randomString}`

  **Example**: `"wall_a1b2c3d4e5f6g7h8"`
</ParamField>

<ParamField path="type" type="string" required>
  Always set to `"wall"`.

  **Default**: `"wall"`
</ParamField>

<ParamField path="name" type="string">
  Optional name for the wall.

  **Example**: `"North Wall"`, `"Exterior Wall A"`
</ParamField>

<ParamField path="parentId" type="string | null" required>
  Reference to the parent level's ID.

  **Example**: `"level_abc123"`

  **Default**: `null`
</ParamField>

<ParamField path="visible" type="boolean">
  Controls wall visibility.

  **Default**: `true`
</ParamField>

<ParamField path="camera" type="CameraSchema">
  Optional camera viewpoint for the wall.
</ParamField>

<ParamField path="metadata" type="any">
  Custom metadata for the wall.

  **Default**: `{}`
</ParamField>

### Wall-Specific Fields

<ParamField path="start" type="[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.
</ParamField>

<ParamField path="end" type="[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.
</ParamField>

<ParamField path="thickness" type="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.
</ParamField>

<ParamField path="height" type="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.
</ParamField>

<ParamField path="frontSide" type="'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.
</ParamField>

<ParamField path="backSide" type="'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.
</ParamField>

<ParamField path="children" type="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.
</ParamField>

## Example

```typescript theme={null}
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

```typescript theme={null}
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

```typescript theme={null}
// 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

```typescript theme={null}
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

```typescript theme={null}
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)

## Related

* [BaseNode](/api/nodes/base) - Inherited base fields
* [LevelNode](/api/nodes/level) - Parent node containing walls
* [ItemNode](/api/nodes/item) - Items attached to walls


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.