Skip to main content

Module location

Module location 

Source
Expand description

Placement as a chain of transforms.

docs/DATA_MODEL.md §2. A Location is a sequence of (datum, power) pairs, not a 4×4 matrix, and that is load-bearing rather than stylistic:

  • Composition is concatenation. No matrix product, and no drift from composing the same placement a thousand times down an assembly tree.
  • Identity is structural. Two shapes are at the same place when their chains match, decided by comparing a handful of integers rather than sixteen floats against a tolerance. That is what lets ten thousand identical fasteners share one piece of geometry and be recognisable as instances of it.
  • Inverses are exact. Negate the powers; no matrix inversion, no rounding.

The composed Transform is derived on demand. It is deliberately not cached inside the location: a location is used as a hash key, and a value with interior mutability has no business being one, the hazard being that a key’s hash can change while it sits in a map. Composing a chain is a few transform products, and chains are short; a caller that finds it hot can memoize outside.

Structs§

DatumStore
The store of transforms that Location chains refer into.
Location
A placement: a chain of (datum, power) pairs.

Type Aliases§

Datum
A rigid or similarity transform that placements are built from.
DatumId
A handle to a shared Datum.