Current slice position in world (transformed) space
Per-dimension tolerance in world space
Composed world nD transform for this node
Per-dimension metadata (length = ndim). name is matched
against ndTransform keys; discrete/step/range drive the
no-preimage rule.
Indices of displayed dimensions (to skip)
The node's extend_to_all dimension NAMES. Authoritative
exemption list: the tolerance sentinel is absent on every Lines path, so it
cannot be inferred from tolerance alone.
New slicePosition (snapped to the resolved local grid point where a
preimage exists) and tolerance in local (raw) space, plus noPreimage when
the world slice has no local counterpart at all
Inverse-transform slicePosition and tolerance from world space to local space.
For affine (effective = scale * raw + offset): local_pos = (world_pos - offset) / scale local_tol = world_tol / |scale|
For permutation: compute inverse permutation and remap the slice index. Tolerance is unchanged (categorical dims use integer matching).
This allows querying the spatial index in local (stored) coordinates without transforming any point data — O(1) per dimension.
The no-preimage rule
A DISCRETE dimension's values live on the
range[0] + k · stepgrid — that is the format's discrete contract, and the whole slicing stack leans on it: the navigation UI snaps slice targets to that grid, and the per-element MEMBERSHIP gates therefore use a half-step window (|value − target| ≤ 0.5 × step; seetolerance-computer.tsandeffective-radius-calculator.ts), which selects exactly one category for an on-grid target.A non-unit affine
nd_transformbreaks that premise: an on-grid WORLD target inverts to an OFF-grid LOCAL target.scale: 2at world T = 7 gives local 3.5, and the half-step window then admits local 3 AND local 4 — two neighbouring categories drawn at once, neither of which belongs to the requested world slice. Atscale: 3, world T = 7 (local 2.333) silently admits local 2.The question is therefore not "is the inverse on the grid?" but the spec's own forward rule for discrete ordinals,
effective = round(scale · original + offset)(docs/guides/specs/ND_TRANSFORMS_SPEC.md§4.1): does any local grid point map to the queried world value? Those two predicates coincide only for integerscale/offset. Testing inverse-on-grid instead would blank every slice of a node with, say,offset: 0.4— for whichround(k + 0.4) = kgives every world value a preimage — and §11.3 explicitly blesses fractional scale on discrete dims ("valid but lossy"), as does the Python validator.So resolveDiscretePreimage walks the local grid candidates bracketing the exact inverse and keeps the first whose forward image rounds to the queried world value. On success the local slice position is snapped to that candidate, which additionally makes the query exactly on-grid — so the downstream half-step window selects that one category and can no longer admit a neighbour at an exact midpoint. On failure the world value is the image of no local value and must display nothing; "nothing" cannot be encoded as a slice position, so it is reported out of band as
noPreimageand the per-geometry range queries turn it into an empty range list, which every loader already renders as "cleared".Exempt:
extend_to_alldimensions (named inextendDims— the dimension is not being sliced at all) and categorical permutations (a bijection always has exactly one preimage).KNOWN LIMITATION: the local grid is taken to be the dimension's declared
range[0]anchor andstep, which are WORLD-space quantities. For a unit-converting transform the local data may sit on a different grid, and there is no metadata describing it. This matches what the downstream membership window already assumes (it applies the samestepas a LOCAL half-width), so the two stay consistent.