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

# Window

> Window is a window with a frame, glass and a plan symbol.

Attach it to a wall and the wall gets a real opening.

## Import

```typescript theme={null}
import { Window } from '@opengeometry/floorkit';
```

## Example

```typescript theme={null}
import { Window, Wall, WallNetwork, WallMaterial, Floorkit } from '@opengeometry/floorkit';

async function example(wasmURL: string): Promise<void> {
  await new Floorkit().setupOpenGeometry(wasmURL);
  const network = new WallNetwork();
  const opening = new Window({
    stationLocal: { alongWall: 2.5 },
    windowDimensions: { width: 1.2, thickness: 0.04 },
    windowHeight: 1.2,
    sillHeight: 0.9,
  });
  try {
    const wall = network.add(
      new Wall({
        labelName: 'Partition',
        axis: { kind: 'line', start: [0, 0, 0], end: [5, 0, 0] },
        thickness: 0.2,
        height: 3,
        baseElevation: 0,
        locationLine: 'centre',
        locationOffset: 0,
        material: WallMaterial.CONCRETE,
        color: 0xcccccc,
        priority: 0,
        joins: { start: { allow: true }, end: { allow: true } },
      }),
    );
    network.resolve();
    wall.attachOpening(opening, { offset: 2.5 });
    opening.setOPConfig({ ...opening.getOPConfig(), sillHeight: 1.1 });
    console.log(network.resolve().diagnostics);
    wall.commitOpeningCuts();
    console.log(opening.getPhysicalParts(), opening.toDrawing('top'));
  } finally {
    network.dispose();
    opening.dispose();
  }
}
```

## Notes

* Dimensions are in metres.
* `sillHeight` is the bottom of the glass above the base of the host wall.
* After you attach or change a window on a live wall, call `wall.commitOpeningCuts()`. This call cuts the wall.
* `setOPConfig` needs the full options. Copy `getOPConfig()`, change one field and pass the copy.
* Start the geometry kernel before you create this object. See [`Floorkit`](/floorkit/api/runtime/floorkit).
* This object is live geometry. To save a building, write it in a [building model](/floorkit/concepts/building-model).

**Inheritance:** `extends Opening<ElementType.WINDOW> implements IShape, PlanVectorExportable`

## Constructor

```typescript theme={null}
constructor(baseWindowConfig?: Partial<WindowOptions>);
```

<ParamField path="baseWindowConfig.stationLocal" type="WindowStationLocal">
  Window centre in the host wall's local frame — horizontal only. The vertical is `sillHeight` and
  nothing else.
</ParamField>

<ParamField path="baseWindowConfig.windowDimensions" type="{ width: number; thickness: number; }" />

<ParamField path="baseWindowConfig.frameDimensions" type="{ width: number; thickness: number; }" />

<ParamField path="baseWindowConfig.windowType" type="WindowType" />

<ParamField path="baseWindowConfig.windowHeight" type="number">
  Clear height of the glass opening.
</ParamField>

<ParamField path="baseWindowConfig.sillHeight" type="number">
  Height of the sill — the bottom of the glass opening — above the host wall's base.
</ParamField>

<ParamField path="baseWindowConfig.frameColor" type="number" />

<ParamField path="baseWindowConfig.glassColor" type="number" />

<ParamField path="baseWindowConfig.ogid" type="string" />

<ParamField path="baseWindowConfig.labelName" type="string" />

<ParamField path="baseWindowConfig.type" type="ElementType.WINDOW" />

<ParamField path="baseWindowConfig.hostWallId" type="string" />

<ParamField path="baseWindowConfig.thickness" type="number" />

<ParamField path="baseWindowConfig.height" type="number" />

<ParamField path="baseWindowConfig.baseHeight" type="number">
  THE vertical authority: the bottom of the rough opening, measured above the host wall's base.
  Never a world Y — the host frame's origin supplies the storey elevation, so `world.y =
      frame.origin.y + baseHeight`. Without a host or free placement, the identity frame makes
  `baseHeight` world Y.
</ParamField>

<ParamField path="baseWindowConfig.length" type="number" />

<ParamField path="baseWindowConfig.points" type="[number, number][]" />

<ParamField path="baseWindowConfig.propertySets" type="PropertySets" />

## Properties

<ResponseField name="propertySet" type="WindowOptions" />

<ResponseField name="outline" type="boolean" />

<ResponseField name="hostObject" type="string | null" />

<ResponseField name="station" type="WindowStationLocal" />

<ResponseField name="baseHeight" type="number">
  Bottom of the ROUGH OPENING above the wall base — the unified vertical every opening exposes. A
  window is authored by its sill, and the opening it needs starts one frame-width lower to seat the
  lining, so the two differ by exactly `frameDimensions.width`. That relationship is stated here and
  nowhere else.
</ResponseField>

<ResponseField name="alongWall" type="number">
  Read-only. Station-based: the authored position along the host wall.
</ResponseField>

<ResponseField name="labelName" type="string" />

<ResponseField name="hostWallId" type="string | undefined" />

<ResponseField name="windowWidth" type="number" />

<ResponseField name="windowThickness" type="number" />

<ResponseField name="windowHeight" type="number" />

<ResponseField name="sillHeight" type="number" />

<ResponseField name="frameThickness" type="number" />

<ResponseField name="frameWidth" type="number" />

<ResponseField name="glassColor" type="number" />

<ResponseField name="frameColor" type="number" />

<ResponseField name="profileView" type="boolean" />

<ResponseField name="modelView" type="boolean" />

<ResponseField name="opening" type="Opening">
  Read-only. Window IS the opening — return self. Kept for compatibility with wall attachers.
</ResponseField>

<ResponseField name="holeLoop2D" type="Vector3[]">
  Read-only. Plan-view hole loop (Vector3\[] at Y=0). The 1 µm across-wall inset (HOLE\_2D\_TOLERANCE)
  keeps hole edges strictly inside the outer polygon so the WASM triangulator handles them
  correctly.
</ResponseField>

## Methods

### editableSchema

```typescript theme={null}
static editableSchema(): OPEditableSchema;
```

### getPhysicalParts

```typescript theme={null}
getPhysicalParts(): readonly PhysicalElementPart[];
```

Borrow actual material parts; descriptors contain no seeds, cutters or symbols.

### anchorSpace

```typescript theme={null}
anchorSpace(): "local" | "world";
```

A single draggable handle that slides the window along its host wall.

### getEditAnchors

```typescript theme={null}
getEditAnchors(): EditAnchor[];
```

### applyEditAnchor

```typescript theme={null}
applyEditAnchor(id: string, position: [
    number,
    number,
    number
], snapRadius?: number): void;
```

### move

```typescript theme={null}
move(delta: Vec3): void;
```

A window is positioned by its station and sill, not by a centreline, so the base `Opening.move` (which walks `points`) does not apply.

### getAnalyticCutBounds

```typescript theme={null}
getAnalyticCutBounds(): AnalyticOpeningCutBounds;
```

Exact station/elevation rectangle used by analytic wall subtraction.

### getOPConfig

```typescript theme={null}
getOPConfig(): WindowOptions;
```

### setOPConfig

```typescript theme={null}
setOPConfig(config: WindowOptions): void;
```

### getExportRoots

```typescript theme={null}
getExportRoots(view: PlanExportView): THREE.Object3D[];
```

### toDrawing

```typescript theme={null}
toDrawing(view: PlanExportView): DrawingPrimitive[];
```

Produce the window's plan symbol as standardized region primitives: the two jamb linings and the two glazing slits, from its authored 2D geometry.

### dispose

```typescript theme={null}
dispose(): void;
```

### setOPGeometry

```typescript theme={null}
setOPGeometry(): void;
```

### setOPMaterial

```typescript theme={null}
setOPMaterial(): void;
```

## Types

### WindowOptions

```typescript theme={null}
interface WindowOptions extends OpeningOptions<ElementType.WINDOW> {
  stationLocal: WindowStationLocal;
  windowDimensions: {
    width: number;
    thickness: number;
  };
  frameDimensions: {
    width: number;
    thickness: number;
  };
  windowType: WindowType;
  windowHeight: number;
  sillHeight: number;
  frameColor: number;
  glassColor: number;
}
```

### WindowStationLocal

```typescript theme={null}
interface WindowStationLocal {
  alongWall: number;
}
```

<ResponseField name="alongWall" type="number" required>
  Distance along the wall from its start point.
</ResponseField>

### WindowType

```typescript theme={null}
enum WindowType {
  GLASS = 'GLASS',
  WOOD = 'WOOD',
  SLIDING = 'SLIDING',
  CASEMENT = 'CASEMENT',
  AWNING = 'AWNING',
  FIXED = 'FIXED',
  OTHER = 'OTHER',
}
```

## Related

* [`Opening`](/floorkit/api/architecture/opening)
* [`AnalyticOpeningCutBounds`](/floorkit/api/architecture/door#analyticopeningcutbounds)
* [`DrawingPrimitive`](/floorkit/api/drawings/draw-project-view#drawingprimitive)
* [`EditAnchor`](/floorkit/api/architecture/op-element#editanchor)
* [`ElementType`](/floorkit/api/architecture/op-element#elementtype)
* [`IShape`](/floorkit/api/shapes/cuboid-shape#ishape)
* [`OPEditableSchema`](/floorkit/api/architecture/op-element#opeditableschema)
* [`OpeningOptions`](/floorkit/api/architecture/opening#openingoptions)
* [`PhysicalElementPart`](/floorkit/api/architecture/door#physicalelementpart)
* [`PlanExportView`](/floorkit/api/shapes/cylinder-shape#planexportview)
* [`PlanVectorExportable`](/floorkit/api/shapes/cylinder-shape#planvectorexportable)
* [`Vec3`](/floorkit/api/architecture/wall#vec3)


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