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

# Floor

> Floor is a flat floor region at one elevation.

Use it for floor finishes and area plates. For a floor with thickness, use `Slab`.

## Import

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

## Example

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

async function example(wasmURL: string): Promise<void> {
  await new Floorkit().setupOpenGeometry(wasmURL);
  const floor = new Floor({
    labelName: 'Ground floor',
    elevation: 0,
    profile: {
      outerRing: [
        [0, 0],
        [6, 0],
        [6, 4],
        [0, 4],
      ],
      holes: [
        [
          [2, 1],
          [3, 1],
          [3, 2],
          [2, 2],
        ],
      ],
    },
  });
  try {
    floor.setOPConfig({ ...floor.getOPConfig(), elevation: 0.1 });
    console.log(floor.toDrawing('top'));
  } finally {
    floor.dispose();
  }
}
```

## Notes

* Profile points are `[x, z]` in metres. `elevation` is the world height.
* The profile can have holes. A profile that is not valid throws an error.
* A floor shows in the plan only. It has no solid.
* 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 IShape, IPlaceable, PlanVectorExportable`

## Constructor

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

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

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

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

<ParamField path="config.profile" type="PolygonProfile">
  Polygon profile in the world XZ plane. `outerRing` is auto-closed and normalized to CW (the
  convention `opengeometry.Polygon` expects). Holes are auto-closed and normalized to CCW.
</ParamField>

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

<ParamField path="config.material" type="FloorMaterial" />

<ParamField path="config.elevation" type="number">
  Elevation from world center
</ParamField>

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

## 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>">
  Always empty — a massing plate has no 3D geometry. Required by `IShape`, and kept so `dispose()`
  stays uniform with the other elements.
</ResponseField>

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

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

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

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

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

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

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

<ResponseField name="floorMaterial" type="FloorMaterial" />

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

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

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

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

## Methods

### editableSchema

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

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

### 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 floor's plan footprint as a standardized region primitive (outer ring + profile holes), from its authored 2D polygon.

### setOPMaterial

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

### getOPConfig

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

### setOPConfig

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

### dispose

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

## Types

### FloorOptions

```typescript theme={null}
interface FloorOptions extends HasPropertySets {
  ogid?: string;
  labelName: string;
  type: ElementType.FLOOR;
  profile: FloorProfile;
  color: number;
  material: FloorMaterial;
  elevation: number;
}
```

### FloorProfile

Polygon profile for a Floor — alias of PolygonProfile.

```typescript theme={null}
type FloorProfile = PolygonProfile;
```

### FloorMaterial

```typescript theme={null}
enum FloorMaterial {
  HARDWOOD = 'HARDWOOD',
  TILE = 'TILE',
  CARPET = 'CARPET',
  LAMINATE = 'LAMINATE',
  CONCRETE = 'CONCRETE',
  OTHER = 'OTHER',
}
```

## Related

* [`OPElement`](/floorkit/api/architecture/op-element)
* [`DrawingPrimitive`](/floorkit/api/drawings/draw-project-view#drawingprimitive)
* [`ElementType`](/floorkit/api/architecture/op-element#elementtype)
* [`HasPropertySets`](/floorkit/api/architecture/op-element#haspropertysets)
* [`IPlaceable`](/floorkit/api/architecture/op-element#iplaceable)
* [`IShape`](/floorkit/api/shapes/cuboid-shape#ishape)
* [`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)
* [`Vec3`](/floorkit/api/architecture/wall#vec3)


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