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

# ZoningEnvelope

> ZoningEnvelope shows the volume in which you can build on a site.

It draws the result of `buildableEnvelope()` as translucent solids.

## Import

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

## Example

```typescript theme={null}
import {
  buildableEnvelope,
  ZoningEnvelope,
  type Site,
  type ZoningRuleSet,
} from '@opengeometry/floorkit';

export function displayEnvelope(site: Site, rules: ZoningRuleSet) {
  const envelope = buildableEnvelope(site.getOPConfig(), rules);
  return new ZoningEnvelope({ envelope, opacity: 0.18 });
}
```

## Notes

* Values are in metres. `opacity` is between 0 and 1.
* The envelope does not recalculate. After a change of the site or the rules, call `buildableEnvelope()` again and then `setEnvelope()`.
* Without a height-cap rule, give `maxHeight` to `buildableEnvelope()`.
* The envelope is a design aid. It is not a legal approval.
* Start the geometry kernel before you create this object. See [`Floorkit`](/floorkit/api/runtime/floorkit).

**Inheritance:** `extends OPElement implements PlanVectorExportable`

## Constructor

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

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

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

<ParamField path="config.type" type="ElementType.ZONING_ENVELOPE" />

<ParamField path="config.envelope" type="BuildableEnvelope" />

<ParamField path="config.color" type="number" />

<ParamField path="config.opacity" type="number">
  0–1.
</ParamField>

## Properties

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

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

<ResponseField name="subElements2D" type="Map<string, OPGeometry>" />

<ResponseField name="subElements3D" type="Map<string, OPGeometry>" />

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

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

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

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

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

<ResponseField name="envelope" type="BuildableEnvelope">
  Read-only.
</ResponseField>

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

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

## Methods

### editableSchema

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

### setEnvelope

```typescript theme={null}
setEnvelope(envelope: BuildableEnvelope): void;
```

### getOPConfig

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

### setOPConfig

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

### setOPGeometry

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

### setOPMaterial

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

### getExportRoots

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

### toDrawing

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

The grade plate region(s), styled `ZONING_ENVELOPE` (phantom dash on paper).

### dispose

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

## Types

### ZoningEnvelopeOptions

```typescript theme={null}
interface ZoningEnvelopeOptions {
  ogid?: string;
  labelName: string;
  type: ElementType.ZONING_ENVELOPE;
  envelope: BuildableEnvelope;
  color: number;
  opacity: number;
}
```

### BuildableEnvelope

```typescript theme={null}
interface BuildableEnvelope {
  heightCap?: number;
  plates: EnvelopePlate[];
}
```

<ResponseField name="heightCap" type="number">
  Metres above grade, when a `height-cap` rule exists.
</ResponseField>

<ResponseField name="plates" type="EnvelopePlate[]" required />

### EnvelopePlate

```typescript theme={null}
interface EnvelopePlate {
  elevation: number;
  height: number;
  footprints: PolygonProfile[];
}
```

<ResponseField name="elevation" type="number" required>
  World Y of the plate's floor.
</ResponseField>

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

<ResponseField name="footprints" type="PolygonProfile[]" required>
  Zero or more disjoint regions (a deep inset can split a waisted lot).
</ResponseField>

## Related

* [`OPElement`](/floorkit/api/architecture/op-element)
* [`DrawingPrimitive`](/floorkit/api/drawings/draw-project-view#drawingprimitive)
* [`ElementType`](/floorkit/api/architecture/op-element#elementtype)
* [`OPEditableSchema`](/floorkit/api/architecture/op-element#opeditableschema)
* [`OPGeometry`](/floorkit/api/architecture/opening#opgeometry)
* [`PlanExportView`](/floorkit/api/shapes/cylinder-shape#planexportview)
* [`PlanVectorExportable`](/floorkit/api/shapes/cylinder-shape#planvectorexportable)
* [`PolygonProfile`](/floorkit/api/primitives/polygon-maths#polygonprofile)


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