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

# CuboidShape

> A solid box.

## Import

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

**Inheritance:** `extends Polygon implements IShape`

## Constructor

```typescript theme={null}
constructor(config?: CuboidOptions);
```

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

<ParamField path="config.center" type="number[]" required />

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

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

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

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

<ParamField path="config.isParametric" type="boolean" />

<ParamField path="config.profile" type="Profile" />

<ParamField path="config.placement" type="Placement" required />

## Properties

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

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

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

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

<ResponseField name="subElements2D" type="Map<string, THREE.Object3D<THREE.Object3DEventMap>>" />

<ResponseField name="subElements3D" type="Map<string, THREE.Object3D<THREE.Object3DEventMap>>" />

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

<ResponseField name="width" type="number | undefined" />

<ResponseField name="depth" type="number | undefined" />

<ResponseField name="extrudeHeight" type="number">
  Extrusion distance along +Y. Re-extrudes only; the footprint is untouched.
</ResponseField>

<ResponseField name="enableEdit" type="boolean">
  Convert the parametric box into an explicit, editable footprint. One-way to match
  `RectanglePrimitive`: once freeform, width/depth no longer drive the ring, so flipping back would
  silently discard edits.
</ResponseField>

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

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

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

## Methods

### setOPConfig

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

### getOPConfig

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

### setOPGeometry

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

### setOPPlacement

```typescript theme={null}
setOPPlacement(placement: Placement): void;
```

Apply native placement to both the profile and its current extrusion.

### setOPMaterial

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

## Types

### IShape

The package does not export this type by name.

```typescript theme={null}
interface IShape {
  ogType: string;
  subElements2D: Map<string, THREE.Object3D>;
  subElements3D: Map<string, THREE.Object3D>;
  selected: boolean;
  edit: boolean;
  locked: boolean;
  propertySet: Record<string, any>;
  setOPConfig(config: Record<string, any>): void;
  getOPConfig(): Record<string, any>;
  setOPGeometry(): void;
  setOPMaterial(): void;
}
```

### CuboidOptions

A cuboid authored as a **2D rectangular profile extruded to a height**, rather than a fixed kernel box primitive.

```typescript theme={null}
interface CuboidOptions {
  ogid?: string;
  center: Array<number>;
  width?: number;
  depth?: number;
  extrudeHeight?: number;
  color?: number;
  isParametric?: boolean;
  profile?: Profile;
  placement: Placement;
}
```

### Placement

Local-frame transform from an asset/instance's definition coordinates to world coordinates.

```typescript theme={null}
interface Placement {
  anchor?: Vec3;
  position: Vec3;
  rotation: Vec3;
  scale: Vec3;
}
```

<ResponseField name="anchor" type="Vec3">
  Local-frame anchor for rotation and scale. Defaults to \[0, 0, 0].
</ResponseField>

<ResponseField name="position" type="Vec3" required>
  Translation (world-space, meters), applied AFTER rotation and scale.
</ResponseField>

<ResponseField name="rotation" type="Vec3" required>
  Euler angles (degrees), in THREE.js default XYZ order.
</ResponseField>

<ResponseField name="scale" type="Vec3" required>
  Per-axis scale factors.
</ResponseField>

## Related

* [`Profile`](/floorkit/api/primitives/line-primitive#profile)
* [`Vec3`](/floorkit/api/architecture/wall#vec3)


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