Skip to main content

Overview

The WindowNode represents a configurable parametric window that can be placed on walls. It supports various window configurations including multi-pane divisions, frame customization, and optional sills. Key features:
  • Wall-mounted placement with configurable side
  • Flexible pane division with column and row ratios
  • Configurable frame and dividers
  • Optional window sill

Type Signature

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

const WindowNode = BaseNode.extend({
  id: objectId('window'),
  type: nodeType('window'),
  position: z.tuple([z.number(), z.number(), z.number()]).default([0, 0, 0]),
  rotation: z.tuple([z.number(), z.number(), z.number()]).default([0, 0, 0]),
  side: z.enum(['front', 'back']).optional(),
  wallId: z.string().optional(),
  width: z.number().default(1.5),
  height: z.number().default(1.5),
  frameThickness: z.number().default(0.05),
  frameDepth: z.number().default(0.07),
  columnRatios: z.array(z.number()).default([1]),
  rowRatios: z.array(z.number()).default([1]),
  columnDividerThickness: z.number().default(0.03),
  rowDividerThickness: z.number().default(0.03),
  sill: z.boolean().default(true),
  sillDepth: z.number().default(0.08),
  sillThickness: z.number().default(0.03),
})

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

Fields

Inherited from BaseNode

id
string
required
Unique window identifier.Format: window_{randomString}Example: "window_a1b2c3d4e5f6g7h8"
type
string
required
Always set to "window".Default: "window"
name
string
Optional name for the window.Example: "Living Room Window", "Bay Window"
parentId
string | null
required
Reference to the parent level’s ID.Example: "level_abc123"Default: null
visible
boolean
Controls window visibility.Default: true
camera
CameraSchema
Optional camera viewpoint for the window.
metadata
any
Custom metadata for the window.Default: {}

Window-Specific Fields

position
[number, number, number]
required
Center position of the window in wall-local coordinate system.Format: [x, y, z] in metersDefault: [0, 0, 0]Example: [2.5, 1.5, 0] (2.5m along wall, 1.5m high)
rotation
[number, number, number]
required
Rotation of the window in radians.Format: [rx, ry, rz] in radiansDefault: [0, 0, 0]
side
'front' | 'back'
Which side of the wall the window is placed on.Values:
  • "front" - Front side of the wall
  • "back" - Back side of the wall
wallId
string
Reference to the wall node ID this window is attached to.Example: "wall_abc123"
width
number
required
Overall width of the window in meters.Default: 1.5Example: 1.5 (standard window), 2.0 (wide window)
height
number
required
Overall height of the window in meters.Default: 1.5Example: 1.5 (standard window), 2.0 (tall window)
frameThickness
number
required
Thickness of the window frame members in meters.Default: 0.05Example: 0.05 (5cm frame)
frameDepth
number
required
Depth of the frame within the wall in meters.Default: 0.07Example: 0.07 (7cm deep frame)
columnRatios
Array<number>
required
Horizontal pane division ratios.Default: [1] (single pane)Examples:
  • [1] - Single pane, no vertical division
  • [0.5, 0.5] - Two equal panes
  • [0.6, 0.4] - One larger pane (60%), one smaller (40%)
Values represent proportions and must sum to 1.0.
rowRatios
Array<number>
required
Vertical pane division ratios.Default: [1] (single pane)Examples:
  • [1] - Single pane, no horizontal division
  • [0.5, 0.5] - Two equal panes (top and bottom)
  • [0.3, 0.7] - Smaller top pane (30%), larger bottom pane (70%)
Values represent proportions and must sum to 1.0.
columnDividerThickness
number
required
Thickness of vertical dividers between columns in meters.Default: 0.03Example: 0.03 (3cm divider)
rowDividerThickness
number
required
Thickness of horizontal dividers between rows in meters.Default: 0.03Example: 0.03 (3cm divider)
sill
boolean
required
Whether to show a window sill.Default: true
sillDepth
number
required
Depth (projection) of the window sill in meters.Default: 0.08Example: 0.08 (8cm sill projection)
sillThickness
number
required
Thickness (height) of the window sill in meters.Default: 0.03Example: 0.03 (3cm thick sill)

Example

import { WindowNode } from '@pascal/core/schema/nodes/window'

const window: WindowNode = {
  object: 'node',
  id: 'window_abc123',
  type: 'window',
  name: 'Living Room Window',
  parentId: 'level_xyz789',
  visible: true,
  position: [4, 1.5, 0],
  rotation: [0, 0, 0],
  side: 'front',
  wallId: 'wall_main',
  width: 2.0,
  height: 1.5,
  frameThickness: 0.05,
  frameDepth: 0.07,
  columnRatios: [0.5, 0.5],
  rowRatios: [1],
  columnDividerThickness: 0.03,
  rowDividerThickness: 0.03,
  sill: true,
  sillDepth: 0.1,
  sillThickness: 0.03,
  metadata: {
    material: 'vinyl',
    glazing: 'double',
  },
}

Usage

Creating a Simple Single-Pane Window

import { WindowNode } from '@pascal/core/schema/nodes/window'

const singlePane = WindowNode.parse({
  name: 'Simple Window',
  wallId: 'wall_bedroom',
  position: [3, 1.5, 0],
  width: 1.2,
  height: 1.5,
  columnRatios: [1], // Single pane
  rowRatios: [1],    // Single pane
})

Creating a Double-Hung Window (Two Vertical Panes)

const doubleHung = WindowNode.parse({
  name: 'Double-Hung Window',
  wallId: 'wall_living',
  width: 1.5,
  height: 1.8,
  columnRatios: [1],         // No vertical division
  rowRatios: [0.5, 0.5],     // Two equal horizontal panes
  sill: true,
  sillDepth: 0.1,
})

Creating a Multi-Pane Window (Grid Pattern)

const gridWindow = WindowNode.parse({
  name: 'Grid Window',
  wallId: 'wall_dining',
  width: 2.0,
  height: 1.5,
  columnRatios: [0.33, 0.33, 0.34],  // Three columns
  rowRatios: [0.5, 0.5],              // Two rows
  columnDividerThickness: 0.03,
  rowDividerThickness: 0.03,
})
// Creates a 3x2 grid of 6 panes

Creating a Bay Window (Wide with Multiple Sections)

const bayWindow = WindowNode.parse({
  name: 'Bay Window',
  wallId: 'wall_front',
  width: 3.0,
  height: 2.0,
  columnRatios: [0.3, 0.4, 0.3],  // Three sections, center wider
  rowRatios: [1],                   // Single height
  frameThickness: 0.06,
  sill: true,
  sillDepth: 0.15, // Deeper sill for bay window
})

Creating a Picture Window (No Dividers)

const pictureWindow = WindowNode.parse({
  name: 'Picture Window',
  wallId: 'wall_view',
  width: 3.5,
  height: 2.5,
  columnRatios: [1],
  rowRatios: [1],
  frameThickness: 0.04, // Thinner frame for modern look
  sill: false,           // No sill
})

Creating a Clerestory Window (High Window)

const clerestory = WindowNode.parse({
  name: 'Clerestory Window',
  wallId: 'wall_great_room',
  position: [5, 2.8, 0], // Higher position
  width: 4.0,
  height: 0.6, // Narrow horizontal window
  columnRatios: [0.25, 0.25, 0.25, 0.25],
  rowRatios: [1],
  sill: false,
})

Creating a Window Without Sill

const noSillWindow = WindowNode.parse({
  name: 'Modern Window',
  wallId: 'wall_modern',
  width: 1.8,
  height: 2.0,
  sill: false, // No sill for flush appearance
})

Window Configuration

Windows support flexible configuration:
  • Dimensions: Width and height
  • Frame: Thickness and depth
  • Panes: Column and row divisions with custom ratios
  • Dividers: Configurable thickness for mullions
  • Sill: Optional with depth and thickness control

Pane Division Examples

// Single pane (no divisions)
columnRatios: [1]
rowRatios: [1]
// Result: 1 pane

// Two vertical panes (side by side)
columnRatios: [0.5, 0.5]
rowRatios: [1]
// Result: 2 panes horizontal

// Two horizontal panes (stacked)
columnRatios: [1]
rowRatios: [0.5, 0.5]
// Result: 2 panes vertical

// Four equal panes (2x2 grid)
columnRatios: [0.5, 0.5]
rowRatios: [0.5, 0.5]
// Result: 4 panes in grid

// Six panes (3x2 grid)
columnRatios: [0.33, 0.33, 0.34]
rowRatios: [0.5, 0.5]
// Result: 6 panes in grid

Coordinate System

Windows use wall-local coordinates:
  • Position is relative to the wall’s coordinate system
  • Y coordinate represents vertical center of the window
  • Side parameter determines which face of the wall

Build docs developers (and LLMs) love