Skip to content

InstancedLoopColumns

Defined in: core/backend.ts:286

SoA for a batch of instanced self-link loops (#505, #542, core/loop-drop.ts): one loop per instance, a teardrop on its node drawn as ONE shape. A loop leaves its node’s rim at its start, runs straight out, bends round on a cubic and comes back straight to the rim at its end, where it ends as InstancedLoopHead.head says. With r the distance from the centre to the rim ends and u0 / u1 the unit directions to them, the straight pieces run from the centre to E_k = centre + (r + h)·u_k (drawn from the rim out) and the cubic is E0, E0 + ℓ·u0, E1 + ℓ·u1, E1 with ℓ = legLength·r; h = max(2·arrowSize, 10·∛width) in every variant (see InstancedLoopHead), so the path is the same with or without a head. Plain draws only: no index, so every column is per loop.

centers: Float32Array

Defined in: core/backend.ts:290

[x, y] world centre of each loop’s node, length 2 * count. Uploaded whole every update, as line positions are, unless offsetsChanged is given while this is the array the layer holds: then only those ranges (none for an empty array).


colors: Uint8Array

Defined in: core/backend.ts:307

RGBA bytes per loop, length 4 * count.


count: number

Defined in: core/backend.ts:320


endOffsets: Float32Array

Defined in: core/backend.ts:299

Where each loop comes back to its node (the head’s tip, on the rim), as startOffsets. The two ends sit spread apart round the centre: the loop’s centre is recovered from them. Length 2 * count.


optional groups?: Float32Array<ArrayBufferLike>

Defined in: core/backend.ts:317

Per-loop highlight group (#162): the loop’s node id. Length count.


optional legLength?: number

Defined in: core/backend.ts:310

The length of the loops’ cubic arms ℓ, in multiples of each loop’s radius r (the centre-to-rim distance). One value per layer (a uniform). Absent ⇒ 1 (LOOP_LEG).


optional offsetsChanged?: Uint32Array<ArrayBufferLike>

Defined in: core/backend.ts:303

The loops whose centers / startOffsets / endOffsets were rewritten in place since the last emit (#509), as flat [start, end) ranges, uploaded alone while the arrays are the ones the layer holds (see InstancedCirclesData.offsetsChanged).


optional samples?: number

Defined in: core/backend.ts:315

Path samples (M) along the cubic; a draw setting, not per-instance. Default 2.


optional selected?: Uint8Array<ArrayBufferLike>

Defined in: core/backend.ts:319

Per-loop selected flag (0/1) for shader-driven dim/recolour (#162). Length count.


optional spread?: number

Defined in: core/backend.ts:313

The angle between each loop’s two straight pieces at the centre, in radians: the angle between its rim ends. One value per layer (a uniform). Absent ⇒ 25° (LOOP_SPREAD).


startOffsets: Float32Array

Defined in: core/backend.ts:296

Where each loop leaves its node: the rim point as an offset from its centre (#509), in the layer’s size units — drawn at project(centre) + offset px in screen mode and at centre + offset in world mode. Length 2 * count. Uploaded only when the array is a new object, or by offsetsChanged.


widths: Float32Array

Defined in: core/backend.ts:305

Line width per loop, in the layer’s size units; length count.