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

# Door

> Door is a door with a frame, a panel and a plan swing symbol.

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

## Import

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

## Example

```typescript theme={null}
import { Door, 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 Door({
    stationLocal: { alongWall: 2.5 },
    panelDimensions: { width: 0.9, thickness: 0.04 },
    doorHeight: 2.1,
    baseHeight: 0,
    doorQuadrant: 1,
    swingAngleDegrees: 90,
  });
  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(), swingAngleDegrees: 45 });
    console.log(network.resolve().diagnostics);
    wall.commitOpeningCuts();
    console.log(opening.getPhysicalParts(), opening.toDrawing('top'));
  } finally {
    network.dispose();
    opening.dispose();
  }
}
```

## Notes

* Dimensions are in metres. Swing angles are in degrees.
* `doorQuadrant` sets the hinge side and the swing side, relative to the direction of the wall. Values 1 and 3 put the hinge at the near jamb. Values 2 and 4 put it at the far jamb. Change 1 to 3, or 2 to 4, to swing to the other side.
* `baseHeight` is the height above the base of the host wall.
* After you attach or change a door 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.DOOR> implements IShape, PlanVectorExportable`

## Constructor

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

<ParamField path="baseDoorConfig.stationLocal" type="StationLocal" />

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

<ParamField path="baseDoorConfig.frameDimensions" type="{ width: number; thickness: number; }">
  `thickness` is the across-wall depth used only when the door is unhosted; when hosted, the lining
  auto-matches the host wall's thickness.
</ParamField>

<ParamField path="baseDoorConfig.doorType" type="DoorType" />

<ParamField path="baseDoorConfig.doorHeight" type="number" />

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

<ParamField path="baseDoorConfig.panelMaterial" type="DoorMaterialType" />

<ParamField path="baseDoorConfig.doorColor" type="number" />

<ParamField path="baseDoorConfig.doorRotation" type="number" />

<ParamField path="baseDoorConfig.doorQuadrant" type="number">
  Which way the door swings, as a 2x2 of hinge side x swing face.
</ParamField>

<ParamField path="baseDoorConfig.swingAngleDegrees" type="number">
  0 = closed, 90 = fully open. Applied to both 2D and 3D.
</ParamField>

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

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

<ParamField path="baseDoorConfig.type" type="ElementType.DOOR" />

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

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

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

<ParamField path="baseDoorConfig.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="baseDoorConfig.length" type="number" />

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

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

## Properties

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

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

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

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

<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="doorRotation" type="number" />

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

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

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

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

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

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

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

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

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

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

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

<ResponseField name="opening" type="Opening">
  Read-only. At runtime Door IS an Opening; this getter is kept for wall attachers that expect an
  `Opening` handle. After making `Opening` generic over its discriminator, the cast is structural
  and clean.
</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 world-space station handle.

### 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 door is positioned by its station, 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(): DoorOptions;
```

### setOPConfig

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

### dispose

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

### setOPGeometry

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

### getExportRoots

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

Vector-export roots (RFC §7).

### toDrawing

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

Produce the door's plan symbol as standardized primitives: jamb frames and the leaf as regions, and the swing as a true DrawingArc (not a tessellated polyline) — read directly from the authored 2D geometry.

### setOPMaterial

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

## Types

### DoorOptions

```typescript theme={null}
interface DoorOptions extends OpeningOptions<ElementType.DOOR> {
  stationLocal: StationLocal;
  panelDimensions: {
    width: number;
    thickness: number;
  };
  frameDimensions: {
    width: number;
    thickness: number;
  };
  doorType: DoorType;
  doorHeight: number;
  frameColor: number;
  panelMaterial: DoorMaterialType;
  doorColor: number;
  doorRotation: number;
  doorQuadrant: number;
  swingAngleDegrees: number;
}
```

### PhysicalElementPart

Borrowed material body.

```typescript theme={null}
interface PhysicalElementPart {
  readonly role: PhysicalPartRole;
  readonly body: Solid | Sweep;
}
```

### StationLocal

Horizontal position of an opening on its host wall.

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

### AnalyticOpeningCutBounds

```typescript theme={null}
interface AnalyticOpeningCutBounds {
  startAlongWall: number;
  endAlongWall: number;
  bottom: number;
  top: number;
}
```

### DoorType

```typescript theme={null}
enum DoorType {
  GLASS = 'GLASS',
  WOOD = 'WOOD',
  DOUBLEDOOR = 'DOUBLEDOOR',
  SLIDING = 'SLIDING',
  FOLDING = 'FOLDING',
  DOUBLEACTION = 'DOUBLEACTION',
  OTHER = 'OTHER',
}
```

### DoorMaterialType

```typescript theme={null}
enum DoorMaterialType {
  WOOD = 'WOOD',
  GLASS = 'GLASS',
  METAL = 'METAL',
  OTHER = 'OTHER',
}
```

### PhysicalPartRole

Semantic part identity is recorded when physical geometry is constructed.

```typescript theme={null}
type PhysicalPartRole =
  | {
      readonly kind: 'step';
      readonly flightIndex: number;
      readonly stepIndex: number;
    }
  | {
      readonly kind: 'landing';
      readonly landingIndex: number;
    }
  | {
      readonly kind: 'door-frame';
    }
  | {
      readonly kind: 'door-leaf';
      readonly leafIndex: number;
    }
  | {
      readonly kind: 'window-frame';
    }
  | {
      readonly kind: 'glazing';
    }
  | {
      readonly kind: 'rail';
    }
  | {
      readonly kind: 'baluster';
      readonly balusterIndex: number;
    };
```

## Related

* [`Opening`](/floorkit/api/architecture/opening)
* [`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)
* [`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.