# `Shape`

> Contract 2.0.0 · package sha256 `a857eca95b35921109faf997094bb4192f12527d9d0fcd4be7e97f06425bad6e` · generated from `configurator-runtime.d.ts` by `services/onsite-scripter/scripts/build-contract-docs.mjs`; edit the source, not this file.

Type · `import type { Shape } from '@holostep-configurators/runtime-client/contract';` · stable · since 2.0.0 · section 7. Collections and shapes

Built shapes. Generated tessellation, vertex order and UV layout are not contract; bounds,
surface and metre UVs are. All lengths are metres.

Inherited from [`ShapeRef`](ShapeRef.md): [`kind`](ShapeRef.kind.md), [`id`](ShapeRef.id.md), [`sha256`](ShapeRef.sha256.md), [`vertices`](ShapeRef.vertices.md), [`triangles`](ShapeRef.triangles.md).

## Declaration

```ts
export type Shape = ({
  kind: 'box';
  size: Point3;
  cornerRadius?: number;
} | {
  kind: 'cylinder';
  radius: number;
  height: number;
  segments?: number;
} | {
  kind: 'sphere';
  radius: number;
} | {
  kind: 'plane';
  size: Point2;
} | {
  kind: 'polygon';
  outline: Outline2D;
  holes?: readonly Outline2D[];
} | {
  kind: 'extrude';
  outline: Outline2D;
  holes?: readonly Outline2D[];
  depth: number;
  bevel?: number;
} | {
  kind: 'mesh';
  position: Float32Array;
  index?: Uint32Array;
  normal?: Float32Array;
  uvs?: ReadonlyArray<Float32Array | undefined>;
} | ShapeRef) & {
  pivot?: PoseInput;
  transform?: readonly number[];
  uv?: 'normalized' | 'metres';
};
```

## Generic-API test (spec 3.1)

| Rule | Result |
| --- | --- |
| 1. Neutral name | pass: `Shape` names no product |
| 2. A precedent | pass: [Babylon.js MeshBuilder.CreatePolygon (XZ plane)](https://github.com/BabylonJS/Babylon.js/blob/master/packages/dev/core/src/Meshes/Builders/polygonBuilder.ts) (row `G15`); [Babylon.js MeshBuilder.ExtrudeShape](https://github.com/BabylonJS/Babylon.js/blob/master/packages/dev/core/src/Meshes/Builders/shapeBuilder.ts) (row `G44`); [Unity Mesh.SetVertices](https://docs.unity3d.com/ScriptReference/Mesh.SetVertices.html) (row `G63`); [glTF KHR_texture_transform](https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_texture_transform) (row `K15`); [glTF 2.0 samplers](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#samplers) (row `K15`); [Babylon.js MeshBuilder.CreateLathe](https://github.com/BabylonJS/Babylon.js/blob/master/packages/dev/core/src/Meshes/Builders/latheBuilder.ts) (row `K2`); and 7 more in coverage.json |
| 3. Two apps, or labs | pass: 19 apps (ledger: app-04c2774145, app-0c773a4ee3, app-378d190f1b, app-4762caacdc, app-4f16d2f6da, app-510d750508, app-59c5b5751e, app-b362a81c85 and 11 more) |
| 4. The cheaper fix first | decided per need in Appendix B: rows `G15`, `G44`, `G63`, `K15`, `K2`, `K3`, `K4`, `K5` at tier app, stable (a member only where no rule, data, asset or app code serves the need) |
