# `ShapeRef`

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

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

How reads return a `mesh` shape: JSON, as an [`ImageRef`](ImageRef.md) is for an image, so [`state()`](Writer.state.md), the feed's
`patch` and `inverse`, undo steps and event payloads carry no vertex arrays. Writing it back
reuses that geometry while it is live in this session, as an [`ImageRef`](ImageRef.md) is: the same holders,
an undo or redo step included, keep its arrays, and a ref that is not live rejects 'unknown-id'
(send the arrays again). Equality (spec section 6.1, O15),
[`Collection.set`](Collection.set.md)'s reconcile and `sceneHash` compare mesh shapes by [`sha256`](ShapeRef.sha256.md), computed once when
the arrays are copied at the call. A mesh re-sent to an item whose newest sent arrays (a queued or
staged `set()`'s, else the live ones) it equals byte for byte keeps that item's `ShapeRef` and is
not hashed again, so re-sending an unchanged mesh costs one compare; a new mesh is hashed once.
The arrays compared are the arrays as sent: nothing the runtime builds on an item's geometry
(picking, drag, collision) reorders or rewrites them, and an item holds one copy of them.

## Members

| Member | Kind | Summary |
| --- | --- | --- |
| <a id="kind"></a>[`kind`](ShapeRef.kind.md) | property | Marks the read form of a `mesh` shape. |
| <a id="id"></a>[`id`](ShapeRef.id.md) | property | The geometry's id in this session, derived from `sha256`, so equal geometry has one id in [`state()`](Writer.state.md), the feed and undo steps. |
| <a id="sha256"></a>[`sha256`](ShapeRef.sha256.md) | property | sha256 of the copied arrays (positions, indices, normals and UVs) and each one's length. |
| <a id="vertices"></a>[`vertices`](ShapeRef.vertices.md) | property | The vertex count. |
| <a id="triangles"></a>[`triangles`](ShapeRef.triangles.md) | property | The triangle count. |

## Declaration

```ts
export interface ShapeRef {
  readonly kind: 'mesh-ref';
  readonly id: string;
  readonly sha256: string;
  readonly vertices: number;
  readonly triangles: number;
}
```

## Generic-API test (spec 3.1)

| Rule | Result |
| --- | --- |
| 1. Neutral name | pass: `ShapeRef` names no product |
| 2. A precedent | not recorded: no ledger row (coverage.json) names this member or its owner |
| 3. Two apps, or labs | not recorded: no ledger row names this member or its owner |
| 4. The cheaper fix first | not recorded per member (Appendix B decides it per need) |
