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

# Wall

> Wall is one straight or curved wall.

It has an axis, a thickness, a height and a base elevation. To join walls at corners, add them to a `WallNetwork`.

## Import

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

## Example

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

async function example(wasmURL: string): Promise<void> {
  await new Floorkit().setupOpenGeometry(wasmURL);
  const wall = 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 } },
  });
  try {
    wall.setOPConfig({ height: 3.2 });
    console.log(wall.getOPConfig(), wall.toDrawing('top'));
  } finally {
    wall.dispose();
  }
}
```

## Notes

* Values are in metres and the Y axis points up. The angles of a circular axis are in radians.
* The constructor needs all `WallOptions`. `setOPConfig` accepts some of them.
* `locationLine` sets which line of the wall follows the axis: the centre or one face.
* To add a door or a window, call `attachDoor` or `attachWindow`, then `commitOpeningCuts()`.
* `dispose()` detaches the openings. Dispose the door and window objects separately.
* 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 OPElement implements PlanVectorExportable, IPlaceable`

## Constructor

```typescript theme={null}
constructor(options: WallOptions);
```

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

<ParamField path="options.labelName" type="string" required />

<ParamField path="options.axis" type="WallAxis" required />

<ParamField path="options.thickness" type="number" required />

<ParamField path="options.height" type="number" required />

<ParamField path="options.baseElevation" type="number" required />

<ParamField path="options.locationLine" type="LocationLine" required />

<ParamField path="options.locationOffset" type="number" required />

<ParamField path="options.material" type="string" required />

<ParamField path="options.color" type="number" required />

<ParamField path="options.priority" type="number" required />

<ParamField path="options.joins" type="{ start: WallEndJoin; end: WallEndJoin; }" required />

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

## Properties

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

<ResponseField name="ogType" type="ElementType" />

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

<ResponseField name="propertySet" type="Record<string, unknown>" />

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

<ResponseField name="footprint" type="WallFootprint">
  Read-only.
</ResponseField>

<ResponseField name="profileTopology" type="&#x22;open&#x22; | &#x22;closed&#x22;">
  Read-only.
</ResponseField>

<ResponseField name="profile" type="Profile" />

<ResponseField name="body" type="AnalyticSolid | undefined">
  Read-only.
</ResponseField>

<ResponseField name="bodies" type="readonly AnalyticSolid[]">
  Read-only.
</ResponseField>

## Methods

### editableSchema

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

### refreshOutline

```typescript theme={null}
refreshOutline(solids?: readonly AnalyticSolid[]): void;
```

### anchorSpace

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

### getEditAnchors

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

### applyEditAnchor

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

### beginOpeningGesture

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

### beginWallDragPreview

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

Show moving opening outlines while an edited wall has an uncut preview body.

### endWallDragPreview

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

### commitOpeningCuts

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

### prepareOpeningCuts

```typescript theme={null}
prepareOpeningCuts(): {
    commit: () => void;
    rollback: () => void;
};
```

### abortOpeningGesture

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

### getHostedOpenings

```typescript theme={null}
getHostedOpenings(): HostedOpening[];
```

### attachDoor

```typescript theme={null}
attachDoor(opening: Door, placement?: WallHostPlacement): void;
```

### attachWindow

```typescript theme={null}
attachWindow(opening: Window, placement?: WallHostPlacement): void;
```

### attachWallOpening

```typescript theme={null}
attachWallOpening(opening: WallOpening, placement?: WallHostPlacement): void;
```

### openingFit

```typescript theme={null}
openingFit(input: WallOpeningFitInput): WallOpeningFit;
```

The one fit rule of a hosted opening: its whole cut in a net run of this resolved wall.

### attachOpening

```typescript theme={null}
attachOpening(opening: HostedOpening, placement?: WallHostPlacement): void;
```

### detachOpening

```typescript theme={null}
detachOpening(openingOrId: HostedOpening | string): void;
```

### moveOpening

```typescript theme={null}
moveOpening(openingOrId: HostedOpening | string, placement: WallHostPlacement): void;
```

### getOPConfig

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

### getNetworkConfig

```typescript theme={null}
getNetworkConfig(): Readonly<WallOptions>;
```

### restoreConfig

```typescript theme={null}
restoreConfig(config: WallOptions): void;
```

### beginEdit

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

### endEdit

```typescript theme={null}
endEdit(): {
    undo: () => void;
    redo: () => void;
} | undefined;
```

### deleteFromNetwork

```typescript theme={null}
deleteFromNetwork(): {
    undo: () => void;
    redo: () => void;
} | undefined;
```

### setOPConfig

```typescript theme={null}
setOPConfig(update: Partial<WallOptions>): void;
```

### bind

```typescript theme={null}
bind(network: WallNetwork | undefined): void;
```

### assignAxis

```typescript theme={null}
assignAxis(axis: WallOptions["axis"]): void;
```

### setResolvedFootprint

```typescript theme={null}
setResolvedFootprint(footprint: WallFootprint): boolean;
```

### toDrawing

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

Produce standardized drawing primitives for a view directly from the element's parametric data (the 0.3.0 contract).

### getExportRoots

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

### getOpeningDiagnostics

```typescript theme={null}
getOpeningDiagnostics(junctions?: readonly Junction[], reportPendingCuts?: boolean): JunctionDiagnostic[];
```

Opening diagnostics of this wall; `junctions` are the junctions of this wall when given.

### move

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

Translate this element by `delta` (world-space, meters).

### rotate

```typescript theme={null}
rotate(angleDeg: number, axis?: Vec3, anchor?: Vec3): void;
```

Rotate this element by `angleDeg` around `axis` (default Y-up), pivoted at `anchor` (default the element's own centroid).

### dispose

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

## Types

### WallOptions

```typescript theme={null}
interface WallOptions extends HasPropertySets {
  ogid?: string;
  labelName: string;
  axis: WallAxis;
  thickness: number;
  height: number;
  baseElevation: number;
  locationLine: LocationLine;
  locationOffset: number;
  material: WallMaterial | string;
  color: number;
  priority: number;
  joins: {
    start: WallEndJoin;
    end: WallEndJoin;
  };
}
```

### WallFootprint

```typescript theme={null}
interface WallFootprint {
  rings: FootprintRing[];
}
```

### HostedOpening

The package does not export this type by name.

```typescript theme={null}
type HostedOpening = Door | Window | WallOpening;
```

### WallHostPlacement

Where to place an opening on its host wall.

The package does not export this type by name.

```typescript theme={null}
interface WallHostPlacement {
  offset?: number;
  baseHeight?: number;
}
```

<ResponseField name="offset" type="number">
  Arc length from the host wall's start point.
</ResponseField>

<ResponseField name="baseHeight" type="number">
  Bottom of the rough opening above the wall's base. Never a world Y.
</ResponseField>

### WallOpeningFitInput

A full-width cut asked at one centre station of a wall, in metres from the wall base.

```typescript theme={null}
interface WallOpeningFitInput {
  station: number;
  width: number;
  bottom: number;
  top: number;
  openingId: string;
  avoidTSeams?: boolean;
}
```

<ResponseField name="station" type="number" required />

<ResponseField name="width" type="number" required />

<ResponseField name="bottom" type="number" required />

<ResponseField name="top" type="number" required />

<ResponseField name="openingId" type="string" required />

<ResponseField name="avoidTSeams" type="boolean">
  Count the seam of a T stem against the fit, as an added opening does: an opening over a seam does
  not fit, and the nearest station and fit range keep clear of the seams.
</ResponseField>

### WallOpeningFit

Where a hosted opening fits on one wall: stations are centre distances along its axis.

```typescript theme={null}
interface WallOpeningFit {
  fits: boolean;
  reasons: WallOpeningFitReason[];
  nearestStation: number | null;
  fitRange: {
    start: number;
    end: number;
  } | null;
}
```

<ResponseField name="fits" type="boolean" required>
  The whole cut lies in a net run of the wall, inside its height: the wall cuts it here.
</ResponseField>

<ResponseField name="reasons" type="WallOpeningFitReason[]" required>
  Why it does not fit; `t-junction` when the cut lies over the seam of a T stem.
</ResponseField>

<ResponseField name="nearestStation" type="number | null" required>
  The fitting centre station nearest to the asked one, or null when it fits nowhere.
</ResponseField>

<ResponseField
  name="fitRange"
  type="{
start: number;
end: number;
} | null"
  required
>
  The range of fitting centre stations that holds `nearestStation`, or null.
</ResponseField>

### Junction

```typescript theme={null}
interface Junction {
  key: string;
  kind: JunctionKind;
  point: XZ;
  members: Array<{
    wallId: string;
    at: WallEnd | 'path';
    station?: number;
  }>;
  order: string[];
  type: JoinType;
  caps: Record<string, FootprintEdge[]>;
  diagnostics: JunctionDiagnostic[];
}
```

### JunctionDiagnostic

```typescript theme={null}
type JunctionDiagnostic =
  | {
      code: 'beveled' | 'unresolvable' | 'absorbed' | 'disconnected' | 'detached' | 'clamped';
      junctionKey: string;
      wallIds: string[];
    }
  | {
      code: 'clash-overlap' | 'self-loop';
      wallIds: string[];
    }
  | {
      code: 'opening-over-junction' | 'opening-boolean-unavailable';
      wallId: string;
      openingId: string;
    }
  | {
      code: 'opening-outside-net-run' | 'opening-rejected-at-crossing';
      wallId: string;
      openingId: string;
      fit: WallOpeningFit;
    };
```

### Vec3

Strict 3-tuple of numbers.

```typescript theme={null}
type Vec3 = [number, number, number];
```

### LocationLine

```typescript theme={null}
type LocationLine = 'centre' | 'left' | 'right';
```

### WallMaterial

```typescript theme={null}
enum WallMaterial {
  CONCRETE = 'CONCRETE',
  BRICK = 'BRICK',
  WOOD = 'WOOD',
  GLASS = 'GLASS',
  OTHER = 'OTHER',
}
```

### WallEndJoin

```typescript theme={null}
interface WallEndJoin {
  allow: boolean;
  type?: JoinType;
}
```

### FootprintRing

```typescript theme={null}
interface FootprintRing {
  edges: FootprintEdge[];
  holes?: FootprintEdge[][];
}
```

### WallOpeningFitReason

Why a hosted opening does not fit at a station; `t-junction` alone still fits (it is cut).

```typescript theme={null}
type WallOpeningFitReason =
  | 'too-wide'
  | 'x-crossing'
  | 'outside-net-run'
  | 'outside-height'
  | 't-junction';
```

### JunctionKind

```typescript theme={null}
type JunctionKind = 'L' | 'continuation' | 'T' | 'X' | 'Y' | 'multi' | 'free';
```

### FootprintEdge

```typescript theme={null}
type FootprintEdge =
  | {
      kind: 'line';
      from: XZ;
      to: XZ;
      role: EdgeRole;
    }
  | {
      kind: 'arc';
      center: XZ;
      radius: number;
      from: number;
      to: number;
      ccw: boolean;
      role: EdgeRole;
    };
```

### EdgeRole

```typescript theme={null}
type EdgeRole = 'face' | 'cap' | 'seam';
```

## Related

* [`Door`](/floorkit/api/architecture/door)
* [`OPElement`](/floorkit/api/architecture/op-element)
* [`WallNetwork`](/floorkit/api/architecture/wall-network)
* [`WallOpening`](/floorkit/api/architecture/wall-opening)
* [`Window`](/floorkit/api/architecture/window)
* [`DrawingPrimitive`](/floorkit/api/drawings/draw-project-view#drawingprimitive)
* [`EditAnchor`](/floorkit/api/architecture/op-element#editanchor)
* [`ElementType`](/floorkit/api/architecture/op-element#elementtype)
* [`HasPropertySets`](/floorkit/api/architecture/op-element#haspropertysets)
* [`IPlaceable`](/floorkit/api/architecture/op-element#iplaceable)
* [`JoinType`](/floorkit/api/architecture/wall-network#jointype)
* [`OPEditableSchema`](/floorkit/api/architecture/op-element#opeditableschema)
* [`PlanExportView`](/floorkit/api/shapes/cylinder-shape#planexportview)
* [`PlanVectorExportable`](/floorkit/api/shapes/cylinder-shape#planvectorexportable)
* [`Profile`](/floorkit/api/primitives/line-primitive#profile)
* [`WallAxis`](/floorkit/api/architecture/wall-network#wallaxis)
* [`WallEnd`](/floorkit/api/architecture/wall-network#wallend)
* [`XZ`](/floorkit/api/architecture/wall-network#xz)


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