Skip to main content

BaseSingleWindow

The BaseSingleWindow class represents a single-panel window element. It extends the Opening class and provides functionality for creating customizable windows with frames and glass panels.

Constructor

new BaseSingleWindow(baseWindowConfig?: OPSingleWindow)
baseWindowConfig
OPSingleWindow
Optional configuration object for the window. If not provided, default values will be used.

Properties

ogType
string
The element type identifier. Always set to ElementType.WINDOW.
propertySet
OPSingleWindow
The current configuration of the window including dimensions, colors, and other properties.
subElements
Map<SubElementType, THREE.Object3D>
Map containing sub-elements of the window (frame, panel, opening, finish).

Getters & Setters

labelName
string
The display name of the window element.
windowPosition
[number, number, number]
The 3D position of the window in the scene as [x, y, z].
windowLength
number
The width of the window opening.
windowThickness
number
The thickness of the window glass.
frameThickness
number
The thickness of the window frame.

Methods

setOPConfig

setOPConfig(config: OPSingleWindow): void
Updates the window configuration and rebuilds the geometry.

getOPConfig

getOPConfig(): OPSingleWindow
Returns the current window configuration.

setOPGeometry

setOPGeometry(): void
Rebuilds the window geometry based on the current configuration.

showProfileView

showProfileView(status: boolean): void
Toggles the profile view mode for technical drawings.

BaseDoubleWindow

The BaseDoubleWindow class represents a double-panel window element with a central mullion divider. It supports independent rotation of left and right panels.

Constructor

new BaseDoubleWindow(baseWindowConfig?: OPDoubleWindow)
baseWindowConfig
OPDoubleWindow
Optional configuration object for the double window.

Getters & Setters

leftWindowRotation
number
The rotation value for the left window panel (between 1 and 2).
rightWindowRotation
number
The rotation value for the right window panel (between 1 and 2).
windowQuadrant
number
The quadrant in which the windows open (1-4).

OPSingleWindow

The configuration interface for single window elements.

Properties

ogid
string
Unique identifier for the window element.
labelName
string
required
Display name for the window.
type
ElementType.WINDOW
required
Element type identifier.
dimensions
object
required
Dimensions configuration for the window.
windowPosition
[number, number, number]
required
3D position of the window as [x, y, z].
windowType
WindowType
required
Type of window (CASEMENT, SLIDING, AWNING, FIXED, GLASS, WOOD, OTHER).
windowHeight
number
required
Height of the window panel in meters.
windowThickness
number
required
Thickness of the window glass in meters.
frameThickness
number
required
Thickness of the window frame in meters.
frameColor
number
required
Hexadecimal color value for the window frame (e.g., 0x000000).
windowColor
number
required
Hexadecimal color value for the window glass (e.g., 0x87CEEB).
sillHeight
number
required
Height from floor to window bottom in meters.
coordinates
Array<[number, number, number]>
required
Array of 3D coordinate points defining the window geometry.

OPDoubleWindow

Extends OPSingleWindow with additional properties for double windows.

Additional Properties

leftWindowRotation
number
required
Rotation value for the left window panel (1-2).
rightWindowRotation
number
required
Rotation value for the right window panel (1-2).
windowQuadrant
number
required
Quadrant in which the windows open (1-4).
mullionWidth
number
required
Width of the center divider between the two window panels in meters.

WindowType

Enum defining available window types:
  • CASEMENT - Casement window (hinged)
  • SLIDING - Sliding window
  • AWNING - Awning window
  • FIXED - Fixed window (non-opening)
  • GLASS - Glass window
  • WOOD - Wooden window
  • OTHER - Other window types

Examples

Single Window

import { BaseSingleWindow, WindowType, ElementType } from 'openplans';

// Create a single window
const window = new BaseSingleWindow({
  labelName: 'Living Room Window',
  type: ElementType.WINDOW,
  dimensions: {
    start: { x: -0.6, y: 0, z: 0 },
    end: { x: 0.6, y: 0, z: 0 },
    length: 1.2,
  },
  windowPosition: [3, 0, 0],
  windowType: WindowType.CASEMENT,
  windowHeight: 1.5,
  windowThickness: 0.05,
  frameThickness: 0.15,
  windowColor: 0x87CEEB,
  frameColor: 0x000000,
  sillHeight: 0.9,
  coordinates: [],
});

// Update window properties
window.windowHeight = 1.8;
window.frameThickness = 0.2;

Double Window

import { BaseDoubleWindow, WindowType, ElementType } from 'openplans';

// Create a double window
const doubleWindow = new BaseDoubleWindow({
  labelName: 'Master Bedroom Window',
  type: ElementType.WINDOW,
  dimensions: {
    start: { x: -1, y: 0, z: 0 },
    end: { x: 1, y: 0, z: 0 },
    length: 2,
  },
  windowPosition: [0, 0, 5],
  windowType: WindowType.CASEMENT,
  windowHeight: 1.5,
  windowThickness: 0.05,
  frameThickness: 0.15,
  windowColor: 0x87CEEB,
  frameColor: 0x000000,
  leftWindowRotation: 1.5,
  rightWindowRotation: 1.5,
  windowQuadrant: 1,
  sillHeight: 0.9,
  mullionWidth: 0.05,
  coordinates: [],
});

// Control individual panels
doubleWindow.leftWindowRotation = 1.2;
doubleWindow.rightWindowRotation = 1.8;
doubleWindow.windowQuadrant = 2;
Last modified on March 7, 2026