rig-parts 2.62.0 → 2.63.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cli.ts CHANGED
@@ -55,7 +55,7 @@ import { RETUNE_FILE, RETUNE_SPEC, retuneStage } from './src/retune.ts';
55
55
  import { checkPainting, DEFAULT_PAINTING_FORM, isPaintingForm, PAINTING_FORMS, paintingFormOf } from './src/paintcheck.ts';
56
56
  import { decodePngBytes, readPng, writePng } from './src/raster/png.ts';
57
57
  import { REQUIREMENTS_SENTENCE } from './src/requirements.ts';
58
- import { composeStage, IMAGE_SEP, PLATE, PROVENANCES, SCENE_REPORT_FILE, SCENE_REPORT_SPEC, SCENE_SPEC } from './src/scene.ts';
58
+ import { composeStage, IMAGE_SEP, PLATE, PROVENANCES, SCENE_CAMERA_REPORT_SPEC, SCENE_REPORT_FILE, SCENE_REPORT_SPEC, SCENE_SPEC } from './src/scene.ts';
59
59
  import { buildSheet, defaultCaption, type Tile, tilesFrom } from './src/sheet.ts';
60
60
  import { loadComparison, requiredProblems, structureLines } from './src/structure.ts';
61
61
  import { type ArgvTable, assembleOutputFiles, BUILD_RUN_FILE, CHECK_RUN_FILE, clearComposeRun, clearRunRecord, clearRunStamp, readPackageIdentity, recordArgv, rigOutputFiles, RUN_STAMP_FILE, RUN_STAMP_SPEC, writeRunRecord, writeRunStamp } from './src/runstamp.ts';
@@ -1082,10 +1082,11 @@ usage:
1082
1082
  rig or motion compose does not know. The result is gated through
1083
1083
  rig-c as rig gates its own (build --profile rig-play --pack, the
1084
1084
  compile and the packed pages on disk); --out receives rig/ (rig.json,
1085
- motion.json, images/) and ${SCENE_REPORT_FILE} (spec "${SCENE_REPORT_SPEC}":
1085
+ motion.json, images/) and ${SCENE_REPORT_FILE} (spec "${SCENE_REPORT_SPEC}"
1086
+ without a camera, "${SCENE_CAMERA_REPORT_SPEC}" with a camera):
1086
1087
  every setting, each character's offset, scale, bounds and shift (and what it
1087
1088
  moved),
1088
- the plate's provenance, the declared and the composed order) only when
1089
+ the plate's provenance, the declared and the composed order, only when
1089
1090
  it is green; then check runs over rig/ into check/, as on a rig it did
1090
1091
  not build (no parts.json: the seam, BREATH_VISIBLE, BLINK_NO_HOLE,
1091
1092
  TIP_OVER_ROOT, STILL_REGIONS_DARK and RECOMPOSITE_HOLES say SKIP and
package/docs/AUTHORING.md CHANGED
@@ -7008,7 +7008,7 @@ outside the consumed inputs.
7008
7008
  | Below-floor cloth travel (unmeasured) | a link's larger unrounded carrier-frame root/tip travel is below the unchanged 0.5 rig px floor, after the zero guard. The diagnostic gives actual root and tip travel in rig px, the 0.5 rig px floor, and `measured_driver`: the nearest world-moving bone (including the carrier), `"none"` when measured still, or `"unavailable"` for missing or unusable geometry. This observes movement, not causal key attribution. The reading stays UNMEASURED under the existing SKIP policy; a separately declared requirement for measurable movement is not satisfied | drive the carrier so the cloth has measurable motion, or remove the requirement for this cloth to move on idle if that motion is not required |
7009
7009
  | <a id="CHECK_TIP_OVER_ROOT"></a>`CHECK_TIP_OVER_ROOT` | a `handwear`/`bottomwear` part's art in the lower half of its box travels less than 1.4725 times as far as in the upper half, measured from the idle's posed geometry against the bone the part hangs from (issue #987; rig px quoted, the world reading beside it) | the chain track's `amps` (grow toward the tip), or the mesh's `segments` (the chain must be among them), or its mode: on `scarf`'s short skirt the proposal's lattice read 1.207 and the same part in `contour` mode 1.738 with the same segments and idle (issue #118) — both carried the `chest` segment #262 removed, after which the lattice reads 3.487. When the detail says `the root travels with the breath (x px of y px): it is carried by \`<bone>\`` (issue #262) the chain is not the cause: a bone an idle `translate` track moves (the breath) moves the root more than the tip, and with that translate held still (the part posed again without it, in proportion to each vertex's weight on the bone and those under it) the ratio passes — the row adds `carried_by`, `breath_rig_px`, `root_without_breath_rig_px` and `tip_without_breath_rig_px`; take that bone's segment off the mesh, or bind the root to the bone the part hangs from, which the detail names. Since issue #987 only a breath keyed under that bone is read: one at or above it is in the frame the halves are read in and carries nothing. When the bone named is a link of the chain the part hangs on, its segment stays, and the detail says to key the translate on the bone the part hangs from or above it. `nothing in it moves against \`<bone>\`` is a part that rides the bone it hangs from whole — a rigid sleeve, whose world ratio is 1. Since issue #995 a lone swing counts as a link too — a rotate-keyed bone with no child bone, or whose only child is its control twin (a one-link chain's control) — so a skirt bound to the one bone that swings it is read against the bone above, where its swing shows. A rotate-keyed body segment other bones hang under (a pelvis carrying the legs) is not one: a part bound whole to it reads `nothing in it moves against` that bone and fails, its world ratio passing only through the lever arm. Hang swinging cloth on its own bone under the body segment; a fitted garment the rig holds rigid on purpose (shorts on the pelvis) is declared in the scene file's `not_swinging` (§7), and the line then reads it SKIP with the reason. A part the scene file declares `rests` (issue #245) is held the other way, its tip half's travel at most its root half's (ratio ≤ 1); the detail then reads `the scene file's rests declares its tip at rest, so a ratio <= 1 is required`, and for it the fix is the chain's `amps` (shrinking toward the tip) or the mesh's tip weighted to a bone the idle does not swing |
7010
7010
  | <a id="CHECK_STILL_REGIONS_DARK"></a>`CHECK_STILL_REGIONS_DARK` | a slot of the face's still set (the `face` slots and every slot drawn over the face that the head bone alone carries) moves relative to the bone the face's slot rides, or a `footwear` slot moves on the screen, by more than the arithmetic's own rounding — measured from the idle's posed geometry (the slot, its largest displacement in rig px, the idle frame and the tolerance quoted) | on the face: a face mesh with a weight on a bone other than the head (`segments`), or one deformed by another bone; on the feet: a mesh weighted to a swinging bone, or a region on the wrong bone. A bang swinging over the face is not this line's failure: its depth is reported (`crossing`), with no bar |
7011
- | <a id="CHECK_TEXTURE_STRETCH"></a>`CHECK_TEXTURE_STRETCH` | a mesh triangle's edge, in some idle frame, is more than 1.926544 times its rest length or less than 1/1.926544 of it (the mesh, triangle, its three vertices, the edge and the frame are named, and — issue #314 — the bones the edge's two vertices hang on: each vertex's two largest weights from `rig.json`, `vertex <i> is weighted to "<bone>" <w>, …`, then `on the idle's chains, the chain from "<first link>" carries "<bone>", …` — each chain `CHAIN_LAG` reads named once, by its first link — with a bone on no chain said, or `none of these bones hangs on a chain of the idle`); or a rest edge has length 0 A differing bone set on the failing edge or triangle names the bone and both shares. Cut attribution requires a matching config replay; otherwise the influence-cut remedy is conditional ("The weight cut"). | the chain tracks' `amps` on the bones that mesh is weighted to (the stretch grows with them), or the mesh's `segments` — a vertex blending two bones that swing against each other. Two chains named, with opposed amplitudes: give both one sign, or drop one — `propose --from-config` measures the pair before a build (§3, *Two chains on one lattice*). An edge whose two ends disagree on whether a bone's small share survives the 0.03 cut (one vertex keeps the bone at a few hundredths, the next drops it — read the two vertices' weights the line quotes): declare `influences: {floor: "continuous"}` on that mesh first, `rule: "heat"` second; the weight `exponent` moves the figure without removing the cut (issue #115, `reference-demo` `hair_back` as contour at tolerance 1, rig-c 2.47.1: 2.535 as drafted; continuous floor 1.422, heat 1.816, both PASS; exponent 1.5 / 3 / 4 / 6 read 2.564 / 1.902 / 2.119 / 4.816, the one pass on the same cut at another edge) |
7011
+ | <a id="CHECK_TEXTURE_STRETCH"></a>`CHECK_TEXTURE_STRETCH` | a mesh triangle's edge, in some idle frame, is more than 1.926544 times its rest length or less than 1/1.926544 of it (the mesh, triangle, its three vertices, the edge and the frame are named, and — issue #314 — the bones the edge's two vertices hang on: each vertex's two largest weights from `rig.json`, `vertex <i> is weighted to "<bone>" <w>, …`, then `on the idle's chains, the chain from "<first link>" carries "<bone>", …` — each chain `CHAIN_LAG` reads named once, by its first link — with a bone on no chain said, or `none of these bones hangs on a chain of the idle`); or a rest edge has length 0 A differing bone set on the failing edge or triangle names the bone and both shares. Cut attribution requires a matching config replay; otherwise the influence-cut remedy is conditional ("The weight cut"). When a vertex of the failing edge lies inside a declared contour band or at its cutoff, the detail also names the governing contour band — its region, its target bone, its declared width (`band`), and each vertex's band position and share — and says that the band's falloff governs the edge (issue #1598). The clause needs the config: on `build`, the one it ran with; on a standalone `check --rig`, the one `<rig>/run.json` (`rig-run/1`, from `rig`) names, used only when the stamp's `rig.json` and config SHA-256 both match the files on disk. Without a verified config, or when an edge vertex does not rebuild onto the contour grid, the clause is left out and the rest of the line is unchanged. | the chain tracks' `amps` on the bones that mesh is weighted to (the stretch grows with them), or the mesh's `segments` — a vertex blending two bones that swing against each other. Two chains named, with opposed amplitudes: give both one sign, or drop one — `propose --from-config` measures the pair before a build (§3, *Two chains on one lattice*). An edge whose two ends disagree on whether a bone's small share survives the 0.03 cut (one vertex keeps the bone at a few hundredths, the next drops it — read the two vertices' weights the line quotes): declare `influences: {floor: "continuous"}` on that mesh first, `rule: "heat"` second; the weight `exponent` moves the figure without removing the cut (issue #115, `reference-demo` `hair_back` as contour at tolerance 1, rig-c 2.47.1: 2.535 as drafted; continuous floor 1.422, heat 1.816, both PASS; exponent 1.5 / 3 / 4 / 6 read 2.564 / 1.902 / 2.119 / 4.816, the one pass on the same cut at another edge). When the detail names a governing contour band (an edge with a vertex inside a declared contour band or at its cutoff), go to that band's width (`meshes.<part>.contour.regions[].band`, or `meshes.<part>.contour.bust` for a derived bust band), not `meshes.<part>.influences` or mesh density: the reach is not monotonic in the band's width, so sweep it on your own rig and read both yaw directions |
7012
7012
  | <a id="CHECK_ANIMATIONS_DO_NOT_FOLD"></a>`CHECK_ANIMATIONS_DO_NOT_FOLD` | an animation, the idle included, turns a mesh triangle over against the setup pose on some frame, read by `rigc render --folds` over the build with its physics on — and with its physics constraints left out beside it when the rig declares any, so each row reports `physics_on` and `physics_off` side by side (issues #320, #333, #363); the object names the animation and the mesh, the detail quotes rigc's line — the frames, the worst frame, which triangles, their world box and setup-pose area — and when the fold appears only with physics on, names the physics constraint(s) on the mesh's bones and the worst frame. After rigc's line it names what the worst frame's folded triangles hang on (issue #567), in `TEXTURE_STRETCH`'s words: each vertex's dominant bone is its largest weight in `rig.json`, the triangles whose vertices share one set of dominant bones are one group (the set in `rig.json`'s bone order), and each group lists its first 6 triangles (`triangles 63, 78, 79 dominated by "knee_r", "knee_l"`, past 6 `… and N more`) and spells out its first triangle's vertices — the largest two weights of each, and the idle chains those bones hang on; 3 groups are written and the rest counted (`; … and N more group(s), M triangle(s)`). An attachment the skin does not hold, or a triangle its table does not reach, is said, not guessed. Or a `may_fold` entry of the `--requirements` file names a slot and animation that does not fold: an exception that excepts nothing A differing bone set on the failing edge or triangle names the bone and both shares. Cut attribution requires a matching config replay; otherwise the influence-cut remedy is conditional ("The weight cut"). | the physics constraint(s) the line names (lower `inertia`, raise `strength`, or lower `damping`), the clip's keys on the bones the line names (a bend past what the weights carry, two bones turned toward each other until the rows between them pass, a translate that carries one row of vertices past the next), or the mesh's `segments`; to look, `rigc inspect --candidate <out>/check/build --show art,folds,mesh --animation <name> --at <the worst frame's time> --zoom folds`. A fold the art means (a sleeve behind the body) is declared, `"may_fold": [{ "slot": …, "animation": …, "why": … }]` (§7, *Declared requirements*); a stale entry is taken out |
7013
7013
  | <a id="CHECK_FEET_STAY_LEVEL"></a>`CHECK_FEET_STAY_LEVEL` | a `footwear` part riding a bone that hangs from another turns more than ±10 degrees from its setup pose on a frame where a bone above that bone is turned (issue #348) — the bar is HQ's line (rig-c/parts#347 ruling 4), not a figure measured here; the object names the part, its bone and the bone it hangs from, the detail the animation, frame and time, the turned bone and its turn, the drawing's turn, and every bone the turn came through with its `inherit` | config.bones' `inherit` on the foot's bone (§3, `bones`): a mode that does not take the parent's rotation (`noRotationOrReflection`, `onlyTranslation`) keeps the drawing at its setup angle; which mode is the author's. Or the clip's keys on the foot's own bone, which turn the shoe whatever its mode |
7014
7014
  | <a id="CHECK_STRESS_OFF_CHAIN"></a>`CHECK_STRESS_OFF_CHAIN` | a mesh from a See-through `handwear` layer that rides one chain of the idle does not turn rigidly with it: with the chain's first link turned 90°, −90° or 180° on a throwaway copy (physics left out, posed by rigc, issue #347), its worst edge reads above 1.0000 as max(ratio, 1/ratio) against the setup pose. The object names the mesh, the link and the turn; the detail quotes the edge and names each bone the mesh is weighted to off the chain, with how many vertices carry it and the largest weight. Or the turned render shows no mesh on the slot: not read is not a pass | the mesh's `segments`: drop the segment on the bone the line names (a 16 px `chest` stub at the shoulder, as `propose` drafted until issue #347), so the sleeve rides its chain alone. Measured (rigc 2.47.1): `demo`'s sleeves read 2.46 to 254.7 with the stub and 1.0000 without it, and the setup-pose seam does not move (mean 0.147, 0 px over 40, both ways) |
@@ -7222,6 +7222,11 @@ and stay absent).
7222
7222
  | <a id="SCENE_DIAL_KEY_DECLARED"></a>`SCENE_DIAL_KEY_DECLARED` | a scene key uses `derive` on a slider's input property, including one that also carries a raw `v`; derived slider inputs are not a supported scene dial dialect | declare an explicit numeric `v` for the named dial, within the named slider's own range; group member values are checked separately |
7223
7223
  | <a id="SCENE_ANIMATION_LOOP_CLOSES"></a>`SCENE_ANIMATION_LOOP_CLOSES` | the gated posed values at 0 and the scene clip's declared duration differ with physics omitted, for a new clip or an idle extension (physics-on frames are not measured by this check) | close the posed bone, slot, geometry, alpha, clip and draw-order values with physics omitted; comparison never wraps the endpoint to zero, and physics-on frame closure is not measured here |
7224
7224
  | <a id="SCENE_ANIMATION_POSE_READABLE"></a>`SCENE_ANIMATION_POSE_READABLE` | Core cannot read or pose the compiled scene clip for its endpoint comparison | correct the construct named by Core; unreadable poses never count as closed and no scene is emitted |
7225
+ | <a id="SCENE_CAMERA_TRACK"></a>`SCENE_CAMERA_TRACK` | a camera track names an unknown take, has invalid keys or easing, or produces a nonfinite or collapsed view | correct the take name, key times, easing or camera values |
7226
+ | <a id="SCENE_CAMERA_LOOP_CLOSES"></a>`SCENE_CAMERA_LOOP_CLOSES` | a looping take's camera pan or zoom differs at the unwrapped endpoints | give its first and last keys the same pan and zoom |
7227
+ | <a id="SCENE_CAMERA_BACKDROP"></a>`SCENE_CAMERA_BACKDROP` | a camera backdrop does not resolve to its declared, measurable region behind the figures | select a plate that draws its bound region behind the figures throughout the keyed take |
7228
+ | <a id="SCENE_CAMERA_PLATE_EDGE"></a>`SCENE_CAMERA_PLATE_EDGE` | the camera view extends past the posed backdrop on the named frame | adjust the camera or plate motion, or extend the plate to cover the required view |
7229
+ | <a id="SCENE_CAMERA_PLATE_ALPHA"></a>`SCENE_CAMERA_PLATE_ALPHA` | the posed backdrop admits transparent coverage on the named camera frame | fill the transparent area or move the view into opaque art |
7225
7230
  | <a id="SCENE_PIVOT_NAME_FREE"></a>`SCENE_PIVOT_NAME_FREE` | an opted-in character's source build already has a bone named `placement` that resolves to the generated name | rename the source bone or omit `placement_pivot` |
7226
7231
  | <a id="SCENE_PIVOT_DECLARED"></a>`SCENE_PIVOT_DECLARED` | a scene track keys an unresolved `<id>:placement` directly or through a bone group, and the character has not opted in | declare `"placement_pivot": true` on the named character |
7227
7232
  | <a id="SCENE_PIVOT_UNUSED"></a>`SCENE_PIVOT_UNUSED` | an opted-in character has no scene-authored translation key on its generated pivot | add a `translate`, `translatex` or `translatey` track with a key on `<id>:placement` in `animations`, or omit `placement_pivot` |
@@ -8056,6 +8061,7 @@ the same viewport compose uses for the shipped frames.
8056
8061
  | `characters[].idle_repeats` | optional safe integer of 2 or more (issue #1511). Counts total plays of this character's source idle within an explicit `scene.animations.idle`. Its declared duration must equal `idle_repeats * source idle duration` exactly. In the same scene, each character without the key must fill the duration once. In `scene.json`, `characters[].idle_duration` gives the source period, `characters[].idle_repeats` appears on opted-in rows, and top-level `idle_duration` gives the scene period |
8057
8062
  | `characters[].accept` | optional, a list of bar names: the bars this character's own check may have failed and still be composed (issue #203). `compose --accept <bar>[,<bar>…]` is the same list for every character; the two are joined, so the command line applies to every character and a character's list adds to it. Each name is one of the bars `check`'s summary names, less the gate — `loop`, `seam`, `BREATH_VISIBLE`, `BLINK_NO_HOLE`, `CHAIN_LAG`, `TIP_OVER_ROOT`, `STILL_REGIONS_DARK`, `TEXTURE_STRETCH`, `ANIMATIONS_DO_NOT_FOLD` (issue #320), `STRESS_OFF_CHAIN` (issue #347), `SEAM_OVER_MOTION` (the body-root bar, issue #686); anything else is `SCENE_ACCEPT_KNOWN`. When `check/check.json` declares `spec: "rig-parts-check/1"`, `compose` reads its `bar_outcomes` for the bars whose outcome status is `FAIL` in the report's order (issue #1373); without that spec it keeps the legacy `barsNotMet` reading. A build is taken when every bar its `check.json` failed is named; its gate red, a declared requirement not PASS, or a bar not named is `SCENE_BUILD_GREEN` as before. **It is for looking, not for shipping:** the `[compose]` line says which failing bars were accepted, `scene.json` records them as the character's `accepted`, the composed rig's own check measures them again and reports them as it finds them, and the run exits 1 even when that check is PASS (a composed rig has no `parts.json`, so the seam and four judgement lines say SKIP there). A list that accepts nothing — every build green — composes to the bytes a scene without one writes |
8058
8063
  | `animations` | optional map by scene clip name, each value a rigc `MotionAnimation` (`duration`, `tracks`, optional `loop`, `note`, and core timeline collections). Names resolve against the final scene without another prefix or unit conversion: `root`, `plate`, declared named plate bones and `<id>:<bone>`, including generated dials. Keying `root` moves the whole scene. A new name adds a clip. `idle` appends tracks and timelines once to the composed idle, preserving character metadata and physics constraints. Its duration must exactly equal the composed idle (`SCENE_DURATION_AGREES`, or `SCENE_REPEAT_DURATION` when a character opts in to repetition). Imported animation names are reserved (`SCENE_ANIMATION_NAME_FREE`). Absent declaration preserves legacy bytes and output paths (issue #1346) |
8064
+ | `camera` | optional keyed view over composed animation names. See [Keyed scene camera](#keyed-scene-camera-issue-1596) for the camera clock, coverage requirements and opt-in report version |
8059
8065
  | `order` | the draw order, back to front: a character id (its slots not named elsewhere, in its own order) or one `<id>:<slot>`. Every slot of every character is drawn exactly once. Interleaving is written by naming slots: `["a", "b:arm_l", "b"]` draws `b`'s left arm between `a` and the rest of `b` |
8060
8066
 
8061
8067
  A `root` key moves plates together with figures. For layered travel, key the plate bones and the character's `<id>:placement` bone enabled by `placement_pivot`.
@@ -8345,6 +8351,71 @@ character's input arrives isolated); a composed `parts.json`, so the bars that
8345
8351
  read See-through tags are measured per character by its own `build`, not over the
8346
8352
  scene; a rig `build` did not write.
8347
8353
 
8354
+ #### Keyed scene camera (issue #1596)
8355
+
8356
+ A camera projects an already posed scene into the fixed canvas. It follows the
8357
+ selected animation clock and leaves the rig, physics, stretch, fold and stock
8358
+ check viewport unchanged. Assign one or more camera tracks in the scene input.
8359
+ This example uses an existing two-second take called `shot`.
8360
+
8361
+ ```json
8362
+ {
8363
+ "backdrop": "background",
8364
+ "tracks": {
8365
+ "shot": [
8366
+ { "t": 0, "pan": [0, 0], "zoom": 1 },
8367
+ { "t": 1, "pan": [12, -4], "zoom": 1.2 },
8368
+ { "t": 2, "pan": [0, 0], "zoom": 1 }
8369
+ ]
8370
+ }
8371
+ }
8372
+ ```
8373
+
8374
+ The example object is the value of `camera`. `backdrop` names one scene plate
8375
+ behind the characters. A track names a final composed animation, including
8376
+ `idle` or a prefixed clip. A take without a track uses the existing view.
8377
+ Times are seconds, strictly increasing from zero through the declared
8378
+ duration. Pan offsets the view center from the stage center in canvas pixels,
8379
+ with positive X right and positive Y down. Zoom is positive and finite.
8380
+ Zoom 1 shows a stage-sized window. Zoom 2 halves its visible width and height
8381
+ about the panned center. The first and last pan and zoom must agree on a
8382
+ looping take at its unwrapped endpoints.
8383
+
8384
+ Between keys the default interpolation is linear in pan and reciprocal zoom.
8385
+ The outgoing key may use the same `ease` or `curve` as the scene's animation
8386
+ keys. Named easings use the composed easing table. Explicit curve channels
8387
+ are pan X, pan Y and reciprocal zoom, in that order. Controls use absolute
8388
+ time in seconds and the corresponding channel's absolute value units.
8389
+
8390
+ Compose checks every camera frame at 12 fps, including the exact take
8391
+ endpoint. The frame grid uses authored seconds, and each frame poses the
8392
+ packed model at the corresponding compiled animation phase. The selected
8393
+ plate can move with its own animation, its parents,
8394
+ or the whole scene. The posed plate must cover the view with opaque art at
8395
+ every sampled frame. Figure bounds and projected clipping are reported as
8396
+ framing evidence. Coverage is measured on the camera frame grid.
8397
+
8398
+ Coverage refusals name the take, plate and affected frame. See
8399
+ [`SCENE_CAMERA_PLATE_EDGE`](#SCENE_CAMERA_PLATE_EDGE) and
8400
+ [`SCENE_CAMERA_PLATE_ALPHA`](#SCENE_CAMERA_PLATE_ALPHA).
8401
+
8402
+ Camera scenes write `spine-parts-scene-report/2` to the existing
8403
+ `<out>/scene.json` path. The `camera` record contains `backdrop`,
8404
+ `model_sha256`, `fps`, `coverage` and `tracks`. The three coverage measures
8405
+ `max_edge_overrun_px`, `nonopaque_source_texels` and
8406
+ `nonopaque_output_pixels` are zero on `PASS`. Each keyed take lists its
8407
+ normalized `keys`, authored `duration`, `compiled_duration`, `loop` flag
8408
+ and `frames`. Named easings are resolved to absolute curves in the report.
8409
+ Each frame lists its index, both clock readings, pan, zoom, view rectangle,
8410
+ posed backdrop quad and projected figure bounds. The view and backdrop quad
8411
+ are in scene pixels, with X right and Y down. Figure bounds are in output
8412
+ pixels. The model hash names the exact packed
8413
+ `<out>/check/build/skeleton.model.json` whose poses were measured.
8414
+
8415
+ Backdrop raster coverage and figure framing are computed in memory. The
8416
+ compose input record keeps `rig-compose-run/1`. Existing scenes without a
8417
+ camera retain the report /1 schema and the same output bytes.
8418
+
8348
8419
  #### Animate a character's placement (issue #1498)
8349
8420
 
8350
8421
  Set `"placement_pivot": true` on a character and key `<id>:placement` in
@@ -10686,8 +10757,8 @@ Internal `SeamSupport.drawings` never enters check JSON. Named requirement
10686
10757
  <!-- check-row-table:begin -->
10687
10758
  | Row family | Registered JSON paths | row_scope | row_kind | row_subjects (producer expression) | Producer |
10688
10759
  | --- | --- | --- | --- | --- | --- |
10689
- | `ANIMATIONS_DO_NOT_FOLD.declared_not_folding` | `ANIMATIONS_DO_NOT_FOLD.declared_not_folding` | part when the supplied mapping resolves a piece; otherwise rig | finding | resolved piece for e.slot; otherwise [] | [check.ts:3874](../src/check.ts#L3874) |
10690
- | `ANIMATIONS_DO_NOT_FOLD.folding` | `ANIMATIONS_DO_NOT_FOLD.folding` | part when the supplied mapping resolves a piece; otherwise rig | finding when entry === undefined; otherwise evidence | resolved piece for slot; otherwise [] | [check.ts:3834](../src/check.ts#L3834) |
10760
+ | `ANIMATIONS_DO_NOT_FOLD.declared_not_folding` | `ANIMATIONS_DO_NOT_FOLD.declared_not_folding` | part when the supplied mapping resolves a piece; otherwise rig | finding | resolved piece for e.slot; otherwise [] | [check.ts:3876](../src/check.ts#L3876) |
10761
+ | `ANIMATIONS_DO_NOT_FOLD.folding` | `ANIMATIONS_DO_NOT_FOLD.folding` | part when the supplied mapping resolves a piece; otherwise rig | finding when entry === undefined; otherwise evidence | resolved piece for slot; otherwise [] | [check.ts:3836](../src/check.ts#L3836) |
10691
10762
  | `ART_JOINT_DISTANCE.joints` | `ART_JOINT_DISTANCE.joints` | 'rig' | finding when status === 'FAIL'; otherwise evidence | [] | [artjoints.ts:86](../src/artjoints.ts#L86) |
10692
10763
  | `BEHIND_PART_SEAMS.contributors` | `BEHIND_PART_SEAMS.turn.pairs[].frames[].standing.samples[].contributors`; `BEHIND_PART_SEAMS.turn.pairs[].frames[].motion_opened.samples[].contributors`; `BEHIND_PART_SEAMS.pairs[].setup.motion_opened.samples[].contributors`; `BEHIND_PART_SEAMS.pairs[].setup.standing.samples[].contributors`; `BEHIND_PART_SEAMS.pairs[].frames[].motion_opened.samples[].contributors`; `BEHIND_PART_SEAMS.pairs[].frames[].standing.samples[].contributors` | 'pair' | evidence | [pair.a, pair.b] | [behindseams.ts:664](../src/behindseams.ts#L664) |
10693
10764
  | `BEHIND_PART_SEAMS.hits` | `BEHIND_PART_SEAMS.pairs[].motion_opened.frames`; `BEHIND_PART_SEAMS.pairs[].standing.frames`; `BEHIND_PART_SEAMS.pairs[].motion_opened.worst`; `BEHIND_PART_SEAMS.pairs[].standing.worst` | 'pair' | finding when r.px > allowance; otherwise evidence | parts | [behindseams.ts:750](../src/behindseams.ts#L750) |
@@ -10703,53 +10774,53 @@ Internal `SeamSupport.drawings` never enters check JSON. Named requirement
10703
10774
  | `BEHIND_PART_SEAMS.unread_corridors` | `BEHIND_PART_SEAMS.turn.pairs[].frames[].standing.unread_corridors`; `BEHIND_PART_SEAMS.pairs[].setup.standing.unread_corridors`; `BEHIND_PART_SEAMS.pairs[].frames[].standing.unread_corridors` | 'pair' | evidence | [pair.a, pair.b] | [behindseams.ts:585](../src/behindseams.ts#L585) |
10704
10775
  | `BOUNDARY_COLOUR_STEP.over` | `BOUNDARY_COLOUR_STEP.over` | 'pair' | finding | r.parts | [boundarycolour.ts:221](../src/boundarycolour.ts#L221) |
10705
10776
  | `BOUNDARY_COLOUR_STEP.unmeasured` | `BOUNDARY_COLOUR_STEP.unmeasured` | part when the supplied mapping resolves a piece; otherwise rig | evidence | resolved piece for r.slot; otherwise [] | [boundarycolour.ts:222](../src/boundarycolour.ts#L222) |
10706
- | `CLOTH_SETTLES.rows` | `CLOTH_SETTLES.rows` | 'rig' | finding when speeds.length > 0 && s < speeds.length; otherwise evidence | [] | [check.ts:6327](../src/check.ts#L6327) |
10777
+ | `CLOTH_SETTLES.rows` | `CLOTH_SETTLES.rows` | 'rig' | finding when speeds.length > 0 && s < speeds.length; otherwise evidence | [] | [check.ts:6329](../src/check.ts#L6329) |
10707
10778
  | `CUT_JOINT_MATERIAL.rows` | `CUT_JOINT_MATERIAL.rows` | 'part' | finding when r.status === 'FAIL'; otherwise evidence | [r.part] | [cutmaterial.ts:280](../src/cutmaterial.ts#L280) |
10708
- | `FEET_STAY_LEVEL.feet` | `FEET_STAY_LEVEL.feet` | 'part' | finding when row.status === 'FAIL'; otherwise evidence | [row.part] | [check.ts:4076](../src/check.ts#L4076) |
10709
- | `FEET_STAY_LEVEL.feet[].worst.through` | `FEET_STAY_LEVEL.feet[].worst.through` | 'rig' | evidence | [] | [check.ts:4051](../src/check.ts#L4051) |
10710
- | `LIMB_ONE_BONE.parts` | `LIMB_ONE_BONE.parts` | 'part' | finding when fail; otherwise evidence | [p.name] | [check.ts:4369](../src/check.ts#L4369) |
10779
+ | `FEET_STAY_LEVEL.feet` | `FEET_STAY_LEVEL.feet` | 'part' | finding when row.status === 'FAIL'; otherwise evidence | [row.part] | [check.ts:4078](../src/check.ts#L4078) |
10780
+ | `FEET_STAY_LEVEL.feet[].worst.through` | `FEET_STAY_LEVEL.feet[].worst.through` | 'rig' | evidence | [] | [check.ts:4053](../src/check.ts#L4053) |
10781
+ | `LIMB_ONE_BONE.parts` | `LIMB_ONE_BONE.parts` | 'part' | finding when fail; otherwise evidence | [p.name] | [check.ts:4371](../src/check.ts#L4371) |
10711
10782
  | `PART_SUPPORT_REPORT.pairs` | `PART_SUPPORT_REPORT.pairs` | 'pair' | evidence; finding when length > 0; otherwise evidence | [F.name, B.name] | [coincide.ts:114](../src/coincide.ts#L114), [coincide.ts:130](../src/coincide.ts#L130) |
10712
10783
  | `PART_SUPPORT_REPORT.raw_pairs` | `PART_SUPPORT_REPORT.raw_pairs` | 'pair' | evidence | [F.name, B.name] | [coincide.ts:110](../src/coincide.ts#L110) |
10713
10784
  | `PART_SUPPORT_REPORT.unowned.regions` | `PART_SUPPORT_REPORT.unowned.regions` | 'rig' | finding | [] | [coincide.ts:145](../src/coincide.ts#L145) |
10714
10785
  | `PHYSICS_CONTRIBUTES.rows` | `PHYSICS_CONTRIBUTES.rows` | 'part' | evidence; finding when !moves; otherwise evidence | [part] | [physicscontrib.ts:217](../src/physicscontrib.ts#L217), [physicscontrib.ts:220](../src/physicscontrib.ts#L220) |
10715
- | `SEAM_OVER_MOTION.pairs` | `SEAM_OVER_MOTION.pairs` | 'pair' | evidence | [p.a, p.b] | [check.ts:5724](../src/check.ts#L5724) |
10716
- | `SEAM_OVER_MOTION.required.pairs` | `SEAM_OVER_MOTION.required.pairs` | 'pair' | finding when open > 0; otherwise evidence | [p.a, p.b] | [check.ts:5039](../src/check.ts#L5039) |
10717
- | `SEAM_OVER_MOTION.required.pairs[].open_frames` | `SEAM_OVER_MOTION.required.pairs[].open_frames` | 'pair' | evidence | [p.a, p.b] | [check.ts:5031](../src/check.ts#L5031) |
10718
- | `SEAM_OVER_MOTION.roots.unmeasured` | `SEAM_OVER_MOTION.roots.unmeasured` | 'part' | evidence | [root.part] | [check.ts:5697](../src/check.ts#L5697) |
10719
- | `SEAM_OVER_MOTION.rows` | `SEAM_OVER_MOTION.rows` | 'pair'; unique ? 'pair' : 'rig' | finding when motionSeamFinding(want.root !== undefined, p.status, p.banded, opens.length); otherwise evidence; finding when motionSeamFinding(rootNames.has(r.pair), r.status, r.banded, r.opens.length); otherwise evidence | [want.a, want.b]; unique ? [pair.a, pair.b] : [] | [check.ts:5654](../src/check.ts#L5654), [check.ts:5730](../src/check.ts#L5730) |
10720
- | `SEAM_OVER_MOTION.rows[].cells` | `SEAM_OVER_MOTION.rows[].cells` | 'pair' | evidence | [want.a, want.b] | [check.ts:5667](../src/check.ts#L5667) |
10721
- | `SEAM_OVER_MOTION.rows[].joint_contact.reasons` | `SEAM_OVER_MOTION.rows[].joint_contact.reasons` | 'pair' | evidence | [want.a, want.b] | [check.ts:5657](../src/check.ts#L5657) |
10786
+ | `SEAM_OVER_MOTION.pairs` | `SEAM_OVER_MOTION.pairs` | 'pair' | evidence | [p.a, p.b] | [check.ts:5726](../src/check.ts#L5726) |
10787
+ | `SEAM_OVER_MOTION.required.pairs` | `SEAM_OVER_MOTION.required.pairs` | 'pair' | finding when open > 0; otherwise evidence | [p.a, p.b] | [check.ts:5041](../src/check.ts#L5041) |
10788
+ | `SEAM_OVER_MOTION.required.pairs[].open_frames` | `SEAM_OVER_MOTION.required.pairs[].open_frames` | 'pair' | evidence | [p.a, p.b] | [check.ts:5033](../src/check.ts#L5033) |
10789
+ | `SEAM_OVER_MOTION.roots.unmeasured` | `SEAM_OVER_MOTION.roots.unmeasured` | 'part' | evidence | [root.part] | [check.ts:5699](../src/check.ts#L5699) |
10790
+ | `SEAM_OVER_MOTION.rows` | `SEAM_OVER_MOTION.rows` | 'pair'; unique ? 'pair' : 'rig' | finding when motionSeamFinding(want.root !== undefined, p.status, p.banded, opens.length); otherwise evidence; finding when motionSeamFinding(rootNames.has(r.pair), r.status, r.banded, r.opens.length); otherwise evidence | [want.a, want.b]; unique ? [pair.a, pair.b] : [] | [check.ts:5656](../src/check.ts#L5656), [check.ts:5732](../src/check.ts#L5732) |
10791
+ | `SEAM_OVER_MOTION.rows[].cells` | `SEAM_OVER_MOTION.rows[].cells` | 'pair' | evidence | [want.a, want.b] | [check.ts:5669](../src/check.ts#L5669) |
10792
+ | `SEAM_OVER_MOTION.rows[].joint_contact.reasons` | `SEAM_OVER_MOTION.rows[].joint_contact.reasons` | 'pair' | evidence | [want.a, want.b] | [check.ts:5659](../src/check.ts#L5659) |
10722
10793
  | `SEAM_OVER_MOTION.rows[].pose_at_worst.joints` | `SEAM_OVER_MOTION.rows[].pose_at_worst.joints` | 'rig' | evidence | [] | [motionseampose.ts:53](../src/motionseampose.ts#L53) |
10723
- | `SEAM_OVER_MOTION.worlds.*.rows` | `SEAM_OVER_MOTION.worlds.*.rows` | 'pair' | evidence | [want.a, want.b] | [check.ts:5651](../src/check.ts#L5651) |
10724
- | `SEAM_OVER_RANGE.joints` | `SEAM_OVER_RANGE.joints` | 'part' | evidence; finding when poses.some(p => p.status === 'FAIL'); otherwise evidence | [j.part] | [check.ts:4693](../src/check.ts#L4693), [check.ts:4739](../src/check.ts#L4739) |
10725
- | `SEAM_OVER_RANGE.joints[].poses` | `SEAM_OVER_RANGE.joints[].poses` | 'part' | finding when fail; otherwise evidence | [j.part] | [check.ts:4737](../src/check.ts#L4737) |
10794
+ | `SEAM_OVER_MOTION.worlds.*.rows` | `SEAM_OVER_MOTION.worlds.*.rows` | 'pair' | evidence | [want.a, want.b] | [check.ts:5653](../src/check.ts#L5653) |
10795
+ | `SEAM_OVER_RANGE.joints` | `SEAM_OVER_RANGE.joints` | 'part' | evidence; finding when poses.some(p => p.status === 'FAIL'); otherwise evidence | [j.part] | [check.ts:4695](../src/check.ts#L4695), [check.ts:4741](../src/check.ts#L4741) |
10796
+ | `SEAM_OVER_RANGE.joints[].poses` | `SEAM_OVER_RANGE.joints[].poses` | 'part' | finding when fail; otherwise evidence | [j.part] | [check.ts:4739](../src/check.ts#L4739) |
10726
10797
  | `SETUP_MATCHES_PAINTING.regions` | `SETUP_MATCHES_PAINTING.regions` | 'rig' | finding when status === 'FAIL'; otherwise evidence | [] | [setuppainting.ts:175](../src/setuppainting.ts#L175) |
10727
10798
  | `SETUP_MATCHES_PAINTING.regions[].slots` | `SETUP_MATCHES_PAINTING.regions[].slots` | part when the supplied mapping resolves a piece; otherwise rig | evidence | resolved piece for slot; otherwise [] | [setuppainting.ts:176](../src/setuppainting.ts#L176) |
10728
10799
  | `SOURCE_EXPOSURE.rows` | `SOURCE_EXPOSURE.rows` | 'part' | finding when declared !== undefined && r.px > declared.max_px; otherwise evidence | [r.part] | [sourceexposure.ts:292](../src/sourceexposure.ts#L292) |
10729
10800
  | `SOURCE_EXPOSURE.unmeasured` | `SOURCE_EXPOSURE.unmeasured` | part when the supplied mapping resolves a piece; otherwise rig | finding when declared !== undefined; otherwise evidence | resolved piece for u.slot; otherwise [] | [sourceexposure.ts:293](../src/sourceexposure.ts#L293) |
10730
- | `STILL_REGIONS_DARK.*.crossing` | `STILL_REGIONS_DARK.*.crossing` | part when the supplied mapping resolves a piece; otherwise rig | finding | resolved piece for sl.name; otherwise [] | [check.ts:9521](../src/check.ts#L9521) |
10731
- | `STILL_REGIONS_DARK.*.still_slots` | `STILL_REGIONS_DARK.*.still_slots` | part when the supplied mapping resolves a piece; otherwise rig | evidence; finding when r.max > tolerance; otherwise evidence | resolved piece for slot; otherwise [] | [check.ts:9507](../src/check.ts#L9507), [check.ts:9512](../src/check.ts#L9512) |
10732
- | `STRESS_OFF_CHAIN.not_read` | `STRESS_OFF_CHAIN.not_read` | 'part' | evidence | [r.part] | [check.ts:4297](../src/check.ts#L4297) |
10733
- | `STRESS_OFF_CHAIN.per_part` | `STRESS_OFF_CHAIN.per_part` | 'part' | finding when poses.some(p => typeof p.reading === 'number' && p.reading > STRESS_RIGID); otherwise evidence | [r.part] | [check.ts:4285](../src/check.ts#L4285) |
10734
- | `STRESS_OFF_CHAIN.per_part[].off_chain` | `STRESS_OFF_CHAIN.per_part[].off_chain` | 'part' | evidence | [r.part] | [check.ts:4285](../src/check.ts#L4285) |
10735
- | `STRESS_OFF_CHAIN.per_part[].poses` | `STRESS_OFF_CHAIN.per_part[].poses` | 'part' | evidence; finding when shown > STRESS_RIGID; otherwise evidence | [r.part] | [check.ts:4253](../src/check.ts#L4253), [check.ts:4271](../src/check.ts#L4271) |
10736
- | `TEXTURE_STRETCH.per_mesh` | `TEXTURE_STRETCH.per_mesh` | part when the supplied mapping resolves a piece; otherwise rig | evidence; finding when severity > TEXTURE_STRETCH_CEILING; otherwise evidence | resolved piece for m.slot; otherwise [] | [check.ts:10171](../src/check.ts#L10171), [check.ts:10181](../src/check.ts#L10181) |
10737
- | `TIP_OVER_ROOT.parts` | `TIP_OVER_ROOT.parts` | 'part' | evidence; finding when !ok && !(!rigid && hanging.onLink && Math.max(c.root, c.tip) < TIP_TRAVEL_FLOOR); otherwise evidence | [p.name] | [check.ts:8896](../src/check.ts#L8896), [check.ts:8901](../src/check.ts#L8901), [check.ts:8922](../src/check.ts#L8922), [check.ts:8933](../src/check.ts#L8933) |
10738
- | `WIND_BAND.pairs` | `WIND_BAND.pairs` | 'pair' | finding when !holdsAll; otherwise evidence | [p.a, p.b] | [check.ts:6831](../src/check.ts#L6831) |
10739
- | `WIND_BAND.pairs[].steps` | `WIND_BAND.pairs[].steps` | 'pair' | finding when !s.holds; otherwise evidence | [p.a, p.b] | [check.ts:6842](../src/check.ts#L6842) |
10740
- | `figure_openings.openings` | `figure_openings.openings` | 'pair' | finding | [ps.under, ps.above] | [check.ts:6148](../src/check.ts#L6148) |
10741
- | `loop_physics` | `loop_physics` | 'rig' | evidence | [] | [check.ts:7933](../src/check.ts#L7933) |
10742
- | `requirements.lines.* (bone)` | `requirements.lines.*` | 'rig' | finding when line.status === 'FAIL'; otherwise evidence | [] | [check.ts:8264](../src/check.ts#L8264) |
10743
- | `requirements.lines.* (seam)` | `requirements.lines.*` | 'pair' | finding when line.status === 'FAIL'; otherwise evidence | [r.part, r.neighbour] | [check.ts:8264](../src/check.ts#L8264) |
10744
- | `requirements.lines.* (stretch)` | `requirements.lines.*` | part when the supplied mapping resolves a piece; otherwise rig | finding when line.status === 'FAIL'; otherwise evidence | resolved piece for r.slot; otherwise [] | [check.ts:8264](../src/check.ts#L8264) |
10745
- | `seam_cells.frames` | `frames` | 'pair' | evidence | [p.a, p.b] | [check.ts:5028](../src/check.ts#L5028) |
10746
- | `seam_cells.frames[].cells` | `frames[].cells` | part when the supplied mapping resolves a piece; otherwise rig | evidence | resolved piece for cell.setupTop ?? ''; otherwise [] | [check.ts:4988](../src/check.ts#L4988) |
10747
- | `seam_pairs` | `seam_pairs`; `seam_scope.whole_pairs`; `sets.*.seam_pairs`; `sets.*.seam_scope.whole_pairs` | subjects.length === 0 ? 'rig' : subjects.length === 1 ? 'part' : 'pair' | evidence | subjects | [check.ts:2706](../src/check.ts#L2706) |
10748
- | `seam_scope.changes` | `seam_scope.changes`; `sets.*.seam_scope.changes` | 'rig' | evidence | [] | [check.ts:2184](../src/check.ts#L2184) |
10749
- | `seam_scope.domain.states` | `seam_scope.domain.states`; `sets.*.seam_scope.domain.states` | 'rig' | evidence | [] | [check.ts:2269](../src/check.ts#L2269) |
10750
- | `seam_scope.pairs` | `seam_scope.pairs`; `sets.*.seam_scope.pairs` | subjects.length === 0 ? 'rig' : subjects.length === 1 ? 'part' : 'pair' | evidence | subjects | [check.ts:7783](../src/check.ts#L7783) |
10751
- | `seam_scope.population.pairs` | `seam_scope.population.pairs`; `sets.*.seam_scope.population.pairs` | 'pair' | evidence | row.parts | [check.ts:2640](../src/check.ts#L2640) |
10752
- | `seam_scope.population.single_art` | `seam_scope.population.single_art`; `sets.*.seam_scope.population.single_art` | 'part' | evidence | [row.part] | [check.ts:2641](../src/check.ts#L2641) |
10801
+ | `STILL_REGIONS_DARK.*.crossing` | `STILL_REGIONS_DARK.*.crossing` | part when the supplied mapping resolves a piece; otherwise rig | finding | resolved piece for sl.name; otherwise [] | [check.ts:9523](../src/check.ts#L9523) |
10802
+ | `STILL_REGIONS_DARK.*.still_slots` | `STILL_REGIONS_DARK.*.still_slots` | part when the supplied mapping resolves a piece; otherwise rig | evidence; finding when r.max > tolerance; otherwise evidence | resolved piece for slot; otherwise [] | [check.ts:9509](../src/check.ts#L9509), [check.ts:9514](../src/check.ts#L9514) |
10803
+ | `STRESS_OFF_CHAIN.not_read` | `STRESS_OFF_CHAIN.not_read` | 'part' | evidence | [r.part] | [check.ts:4299](../src/check.ts#L4299) |
10804
+ | `STRESS_OFF_CHAIN.per_part` | `STRESS_OFF_CHAIN.per_part` | 'part' | finding when poses.some(p => typeof p.reading === 'number' && p.reading > STRESS_RIGID); otherwise evidence | [r.part] | [check.ts:4287](../src/check.ts#L4287) |
10805
+ | `STRESS_OFF_CHAIN.per_part[].off_chain` | `STRESS_OFF_CHAIN.per_part[].off_chain` | 'part' | evidence | [r.part] | [check.ts:4287](../src/check.ts#L4287) |
10806
+ | `STRESS_OFF_CHAIN.per_part[].poses` | `STRESS_OFF_CHAIN.per_part[].poses` | 'part' | evidence; finding when shown > STRESS_RIGID; otherwise evidence | [r.part] | [check.ts:4255](../src/check.ts#L4255), [check.ts:4273](../src/check.ts#L4273) |
10807
+ | `TEXTURE_STRETCH.per_mesh` | `TEXTURE_STRETCH.per_mesh` | part when the supplied mapping resolves a piece; otherwise rig | evidence; finding when severity > TEXTURE_STRETCH_CEILING; otherwise evidence | resolved piece for m.slot; otherwise [] | [check.ts:10290](../src/check.ts#L10290), [check.ts:10300](../src/check.ts#L10300) |
10808
+ | `TIP_OVER_ROOT.parts` | `TIP_OVER_ROOT.parts` | 'part' | evidence; finding when !ok && !(!rigid && hanging.onLink && Math.max(c.root, c.tip) < TIP_TRAVEL_FLOOR); otherwise evidence | [p.name] | [check.ts:8898](../src/check.ts#L8898), [check.ts:8903](../src/check.ts#L8903), [check.ts:8924](../src/check.ts#L8924), [check.ts:8935](../src/check.ts#L8935) |
10809
+ | `WIND_BAND.pairs` | `WIND_BAND.pairs` | 'pair' | finding when !holdsAll; otherwise evidence | [p.a, p.b] | [check.ts:6833](../src/check.ts#L6833) |
10810
+ | `WIND_BAND.pairs[].steps` | `WIND_BAND.pairs[].steps` | 'pair' | finding when !s.holds; otherwise evidence | [p.a, p.b] | [check.ts:6844](../src/check.ts#L6844) |
10811
+ | `figure_openings.openings` | `figure_openings.openings` | 'pair' | finding | [ps.under, ps.above] | [check.ts:6150](../src/check.ts#L6150) |
10812
+ | `loop_physics` | `loop_physics` | 'rig' | evidence | [] | [check.ts:7935](../src/check.ts#L7935) |
10813
+ | `requirements.lines.* (bone)` | `requirements.lines.*` | 'rig' | finding when line.status === 'FAIL'; otherwise evidence | [] | [check.ts:8266](../src/check.ts#L8266) |
10814
+ | `requirements.lines.* (seam)` | `requirements.lines.*` | 'pair' | finding when line.status === 'FAIL'; otherwise evidence | [r.part, r.neighbour] | [check.ts:8266](../src/check.ts#L8266) |
10815
+ | `requirements.lines.* (stretch)` | `requirements.lines.*` | part when the supplied mapping resolves a piece; otherwise rig | finding when line.status === 'FAIL'; otherwise evidence | resolved piece for r.slot; otherwise [] | [check.ts:8266](../src/check.ts#L8266) |
10816
+ | `seam_cells.frames` | `frames` | 'pair' | evidence | [p.a, p.b] | [check.ts:5030](../src/check.ts#L5030) |
10817
+ | `seam_cells.frames[].cells` | `frames[].cells` | part when the supplied mapping resolves a piece; otherwise rig | evidence | resolved piece for cell.setupTop ?? ''; otherwise [] | [check.ts:4990](../src/check.ts#L4990) |
10818
+ | `seam_pairs` | `seam_pairs`; `seam_scope.whole_pairs`; `sets.*.seam_pairs`; `sets.*.seam_scope.whole_pairs` | subjects.length === 0 ? 'rig' : subjects.length === 1 ? 'part' : 'pair' | evidence | subjects | [check.ts:2708](../src/check.ts#L2708) |
10819
+ | `seam_scope.changes` | `seam_scope.changes`; `sets.*.seam_scope.changes` | 'rig' | evidence | [] | [check.ts:2186](../src/check.ts#L2186) |
10820
+ | `seam_scope.domain.states` | `seam_scope.domain.states`; `sets.*.seam_scope.domain.states` | 'rig' | evidence | [] | [check.ts:2271](../src/check.ts#L2271) |
10821
+ | `seam_scope.pairs` | `seam_scope.pairs`; `sets.*.seam_scope.pairs` | subjects.length === 0 ? 'rig' : subjects.length === 1 ? 'part' : 'pair' | evidence | subjects | [check.ts:7785](../src/check.ts#L7785) |
10822
+ | `seam_scope.population.pairs` | `seam_scope.population.pairs`; `sets.*.seam_scope.population.pairs` | 'pair' | evidence | row.parts | [check.ts:2642](../src/check.ts#L2642) |
10823
+ | `seam_scope.population.single_art` | `seam_scope.population.single_art`; `sets.*.seam_scope.population.single_art` | 'part' | evidence | [row.part] | [check.ts:2643](../src/check.ts#L2643) |
10753
10824
 
10754
10825
  | Serialized type path | Reason for schema exclusion |
10755
10826
  | --- | --- |
package/docs/STABILITY.md CHANGED
@@ -1196,6 +1196,7 @@ execution in historical evidence is inferred from a current export.
1196
1196
  | scene placement pivot | `compose` | Issue #1498 adds optional literal `true` at `characters[].placement_pivot` in `spine-parts-scene/1`. It emits the identity `<id>:placement` under `root` and requires a scene-authored `translate`, `translatex` or `translatey` key in final scene pixels. The existing placement math stays on the original first-level bones, root regions and root weights. Source root bindings use the unkeyed identity `<id>:root` child when needed. `SCENE_FIELD_TYPE` refuses other explicit values, `SCENE_PIVOT_NAME_FREE` a source bone collision, `SCENE_PIVOT_DECLARED` an unresolved pivot targeted directly or through a bone group without an opt-in, `SCENE_PIVOT_UNUSED` an unused declaration and `SCENE_PIVOT_TRACK` a forbidden property or carrier key. `SCENE_PLATE_NAME_FREE` still governs named plate collisions. Core's unknown-bone refusal, rig gate, scene clip timing and endpoint closure still apply. `scene.json` adds `placement_pivot` with the generated name after the bounds fields and counts the generated bones for that character. `compose-run.json` binds the declaration through `scene.sha256` with its existing shape and key order. Omitting the declaration preserves default output bytes at the same paths, subject to the existing Core receipt clocks. |
1197
1197
  | `compose-run.json` | `compose` | spec `rig-compose-run/1` (issue #1348), separate from `rig-run/1`; a stable contract as of 2.44.0. Written at the `--out` root only after the gate and check are green and no accepted failing character remains, so an `--accept` preview writes none. Fixed keys in order: `spec`, `scene` (`path`, `sha256`), `characters` (each `id`, `build`, `files`, each file `path`, `sha256`, then optional `placement`), `plate` (`path`, `sha256`, or null), `plates` (each `name`, `path`, `sha256`). Scene and plate paths are the supplied and declared paths; character file paths are build-relative. Characters sort by `id`, files by `path`, named plates by `name`, in code-unit order. Each character's files are exactly `check/check.json`, `parts.json`, `rig/rig.json`, `rig/motion.json` and each distinct image the default skin names under `rig/images/`, including a generator's depth image. Every `sha256` is of the raw file bytes compose consumed before the gate. Only a character with `canvas_clip: true` has `placement`, with `canvas_clip: true`, `bounds` and `clipped_bounds` in that order from the scene report. There are no clocks, directory extras, requirements or CLI-option inventory, so identical inputs at identical supplied paths give identical record bytes. Compose owns the name: a file of that name at the `--out` root is deleted at the start of every compose, before stage validation, so a refused rerun leaves none. For scenes without opt-in, legacy outputs retain stable bytes, with the existing nested Core receipt clock comparison described above. |
1198
1198
  | the scene report | `compose` | spec `spine-parts-scene-report/1`; the plate block carries `sha256` of the plate PNG's bytes after `size` (issue #1183, additive under *What "stable" means here*: a new report key in a minor version, so the spec stays `/1`); `pack_mode` records `page_size` only when `--page-size <px>` is given (issue #1352, additive; without `--page-size`, rigc's default 2048 px page and padding 2 on each side bound any plate or region side to at most 2044 px before `CE_ATLAS_REGION_EXCEEDS_PAGE`) |
1199
+ | keyed scene camera | `compose` | optional `camera` in `spine-parts-scene/1` (issue #1596). A camera scene writes `spine-parts-scene-report/2` at the existing `scene.json` path with its keyed camera, sampled coverage and framing verdict, and packed model SHA-256. Report /1 and the existing output inventory and bytes are preserved for scenes without a camera, subject to the existing Core receipt clocks. The camera path uses Core animation easing and the posed backdrop at each sampled frame. Rig, motion and stock check outputs retain their existing semantics. The compose input receipt stays `rig-compose-run/1`. See [Keyed scene camera](AUTHORING.md#keyed-scene-camera-issue-1596) |
1199
1200
  | `idle.png`, `idle-indexed.png`, `idle.gif` | `loop`, `build --loop` | APNG and GIF encodings of the rendered idle |
1200
1201
  | `run.json` | `rig`, `assemble` | spec `rig-run/1` (issue #1165, additive): `spec`, `package` (`name`, `version`), `command` (`"rig"` or `"assemble"`), `started_at` and `finished_at` (UTC ISO-8601 millisecond timestamps ending in `Z`, read in the CLI layer), `config` (`path` relative to `--out`, `sha256` of the config file on disk), `inputs` on `assemble` (issues #1316, #1554, additive: one `{role, path, sha256}` entry for each of `--source`, `--full` and `--head` that was given, in that order, with `path` relative to `--out` by the per-platform link rule — naming `<dir>/layers.json` when given a directory — and `sha256` of the file `path` names), and `outputs` (`path` relative to `--out`, `sha256` of each written output file on disk, sorted by `path` in code-unit order and excluding `run.json` itself); written only after the command's gate is green |
1201
1202
  | the difference inventory (`--out`) | `diff-components` | spec `rig-parts-diff-components/1` by default (issue #1005: `stack`, `painting`, `definition`, `error_px`, `uncovered_error_px`, `components` — each `id`, `px`, `box`, `coverage`, `uncovered_px`, `borders` — and `below_floor`, byte-identical to 2.38.1), and spec `rig-parts-diff-components/2` under `--owners` (issue #1291: adds `owners` — each `{part, px}`, the topmost `parts.json` part above `COVERED_ALPHA` per covered pixel, back to front — before `borders` on every component); `--verify` verifies both `/1` and `/2` reports (with `--owners`, `/2` is required), while a `/1`-only reader (`readDiffComponents(text, input, [DIFF_COMPONENTS_SPEC])`) refuses `/2` by name |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rig-parts",
3
- "version": "2.62.0",
3
+ "version": "2.63.1",
4
4
  "description": "AI-authored 2D character parts from one anime painting and its See-through layer decomposition: measured parts, weighted-mesh rig specs, verified through rig-c before anything is written. A CLI for agents that cannot see the image.",
5
5
  "type": "module",
6
6
  "exports": {
package/src/check.ts CHANGED
@@ -98,7 +98,7 @@ import { createHash } from 'node:crypto';
98
98
  import { createRequire } from 'node:module';
99
99
  import type { Candidate, Piece, Viewport as RootCoverageViewport } from '@rig-c/core/render-shared';
100
100
  import { fillHoles } from './raster/morph.ts';
101
- import { closeSync, copyFileSync, cpSync, existsSync, mkdirSync, openSync, readdirSync, readFileSync, readSync, renameSync, rmSync, statSync, writeFileSync, writeSync } from 'node:fs';
101
+ import { closeSync, copyFileSync, cpSync, existsSync, mkdirSync, openSync, readdirSync, readFileSync, readSync, realpathSync, renameSync, rmSync, statSync, writeFileSync, writeSync } from 'node:fs';
102
102
  import { argvPathFromOut, diagnosticSegment, diagnosticSiblings, unsafeSegmentReason } from './outputpaths.ts';
103
103
  import { basename, delimiter, dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
104
104
  import { measureRecomposite, type RecompositeFigures, recompositeRecord, scenePhrase, sourceInRig, figureSilhouette } from './assemble.ts';
@@ -153,7 +153,9 @@ import {
153
153
  import { type AlternatePartsRecord, FRONT_SUFFIX, type LimbRecord, partImageReference, type PartRecord, type PartsFile, readParts } from './parts.ts';
154
154
  import { ARM_SPLIT_MIGRATION, poseRigBonesForDrawn, type RigBone, SETS_FILE, writtenShares } from './rig.ts';
155
155
  import { TURN_BONE, turnConstraintName, turnTwin } from './turn.ts';
156
- import { ROOT_BONE, loadConfigWithBytes, type Point } from './config.ts';
156
+ import { type CharacterConfig, contourRegionsOf, ROOT_BONE, loadConfigWithBytes, type Point } from './config.ts';
157
+ import { GRID } from './contour.ts';
158
+ import { regionBandSite, regionWeight, type RegionBandSite } from './localweights.ts';
157
159
  import { influences, meshLimits, type Segment, type Influence, type InfluenceLimits } from './weights.ts';
158
160
  import {
159
161
  requirementAnimations,
@@ -9970,10 +9972,127 @@ function stretchAtText(s: { triangle: number; vertices: readonly number[]; edge:
9970
9972
  export interface WeightStepContext {
9971
9973
  config?: InputFileRecord;
9972
9974
  stage?: StageBox;
9975
+ rigDir?: string;
9973
9976
  }
9974
9977
 
9975
9978
  type StepBinding = { bone: string; x: number; y: number; weight: number };
9976
9979
 
9980
+ const RIG_RUN_STAMP_FILE = 'run.json';
9981
+ const RIG_RUN_STAMP_SPEC = 'rig-run/1';
9982
+ const CONTOUR_GRID_TOLERANCE = 1e-2;
9983
+
9984
+ /** Load a hash-verified config from an explicit record (`build`) or the rig directory's `rig-run/1` stamp (`check`). */
9985
+ function loadVerifiedContourConfig(context?: WeightStepContext): CharacterConfig | null {
9986
+ if (context === undefined) return null;
9987
+ try {
9988
+ if (context.config !== undefined) {
9989
+ const loaded = loadConfigWithBytes(context.config.path);
9990
+ return inputFileRecord(loaded.bytes, context.config.path).sha256 === context.config.sha256 ? loaded.config : null;
9991
+ }
9992
+ if (context.rigDir !== undefined) {
9993
+ const stampPath = join(context.rigDir, RIG_RUN_STAMP_FILE);
9994
+ if (!existsSync(stampPath)) return null;
9995
+ const stamp: unknown = JSON.parse(readFileSync(stampPath, 'utf8'));
9996
+ if (!isRecord(stamp) || stamp.spec !== RIG_RUN_STAMP_SPEC || stamp.command !== 'rig' ||
9997
+ !isRecord(stamp.config) || typeof stamp.config.path !== 'string' || typeof stamp.config.sha256 !== 'string' ||
9998
+ !Array.isArray(stamp.outputs)) return null;
9999
+ const rigEntry = stamp.outputs.find((e): e is Record<string, unknown> => isRecord(e) && e.path === 'rig.json');
10000
+ const rigPath = join(context.rigDir, 'rig.json');
10001
+ if (rigEntry === undefined || typeof rigEntry.sha256 !== 'string' || !existsSync(rigPath)) return null;
10002
+ if (createHash('sha256').update(readFileSync(rigPath)).digest('hex') !== rigEntry.sha256) return null;
10003
+ const cfgPath = resolve(realpathSync(context.rigDir), stamp.config.path);
10004
+ const loaded = loadConfigWithBytes(cfgPath);
10005
+ return inputFileRecord(loaded.bytes, cfgPath).sha256 === stamp.config.sha256 ? loaded.config : null;
10006
+ }
10007
+ } catch {
10008
+ return null;
10009
+ }
10010
+ return null;
10011
+ }
10012
+
10013
+ function bandSiteLabel(site: RegionBandSite): string {
10014
+ if (site === 'band') return 'inside the band';
10015
+ if (site === 'cutoff') return 'at its cutoff';
10016
+ return site === 'region' ? 'inside the region' : 'outside the band';
10017
+ }
10018
+
10019
+ function bandTargetShare(part: string, targetBone: string, bindings: readonly StepBinding[]): number {
10020
+ const twin = turnTwin(part, targetBone);
10021
+ const stopped = `${targetBone}_d`;
10022
+ let share = 0;
10023
+ for (const b of bindings) {
10024
+ if (b.bone === targetBone || b.bone === twin || b.bone === stopped) share += b.weight;
10025
+ }
10026
+ return round6(share);
10027
+ }
10028
+
10029
+ /**
10030
+ * Issue #1598: when a vertex of a failing `TEXTURE_STRETCH` edge lies inside a declared contour band (`0 < d < band`)
10031
+ * or at its cutoff (`d === band`), name the governing contour band — its region, its target bone, its declared width
10032
+ * (`band`), and each vertex's band position and written share — from the verified config declaration and `rig.json`'s
10033
+ * weights alone. Empty for every other edge so unrelated failures keep their text byte for byte.
10034
+ */
10035
+ export function contourBandText(
10036
+ rig: Record<string, unknown>,
10037
+ slot: string,
10038
+ attachment: string,
10039
+ edge: readonly number[],
10040
+ context?: WeightStepContext,
10041
+ slotParts?: ReadonlyMap<string, string>,
10042
+ ): string {
10043
+ if (context?.stage === undefined || edge.length === 0) return '';
10044
+ const cfg = loadVerifiedContourConfig(context);
10045
+ if (cfg === null) return '';
10046
+ const part = slotParts?.get(slot) ?? slot;
10047
+ const meshPart = part in cfg.meshes ? part : slot in cfg.meshes ? slot : null;
10048
+ if (meshPart === null) return '';
10049
+ const mesh = cfg.meshes[meshPart];
10050
+ if (!('contour' in mesh)) return '';
10051
+ const regions = contourRegionsOf(mesh.contour);
10052
+ if (!regions.some((rg) => rg.band > 0)) return '';
10053
+ const skins = isRecord(rig.skins) ? rig.skins : {};
10054
+ const skin = isRecord(skins.default) ? skins.default : {};
10055
+ const onSlot = isRecord(skin[slot]) ? skin[slot] : {};
10056
+ const att = onSlot[attachment];
10057
+ if (!isRecord(att) || !Array.isArray(att.weights)) return '';
10058
+ const transforms = setupWorld(rig);
10059
+ const vertices: Array<{ index: number; point: Point; bindings: StepBinding[] }> = [];
10060
+ for (const v of edge) {
10061
+ const row = att.weights[v];
10062
+ if (!Array.isArray(row) || row.length === 0 || row.some((b) => !isRecord(b) || typeof b.bone !== 'string' ||
10063
+ typeof b.x !== 'number' || typeof b.y !== 'number' || typeof b.weight !== 'number')) return '';
10064
+ const bindings = (row as StepBinding[]).filter((b) => b.weight > 0);
10065
+ const first = bindings[0];
10066
+ if (first === undefined) return '';
10067
+ const transform = transforms.get(first.bone);
10068
+ if (transform === undefined) return '';
10069
+ const rx = transform.a * first.x + transform.b * first.y + transform.worldX - context.stage.x;
10070
+ const ry = cropToSpineY(transform.c * first.x + transform.d * first.y + transform.worldY - context.stage.y, context.stage.height);
10071
+ const ux = Math.round(rx * GRID);
10072
+ const uy = Math.round(ry * GRID);
10073
+ if (!Number.isFinite(ux) || !Number.isFinite(uy) ||
10074
+ Math.abs(rx * GRID - ux) > CONTOUR_GRID_TOLERANCE || Math.abs(ry * GRID - uy) > CONTOUR_GRID_TOLERANCE) return '';
10075
+ vertices.push({ index: v, point: [ux / GRID, uy / GRID], bindings });
10076
+ }
10077
+ const explicitCount = mesh.contour.regions?.length ?? 0;
10078
+ const clauses: string[] = [];
10079
+ for (const [k, reg] of regions.entries()) {
10080
+ if (reg.band <= 0) continue;
10081
+ const sites = vertices.map((v) => ({ ...v, site: regionBandSite(v.point, reg), share: bandTargetShare(meshPart, reg.bone, v.bindings) }));
10082
+ if (!sites.some((s) => s.site === 'band' || s.site === 'cutoff')) continue;
10083
+ if (sites.some((s) => {
10084
+ if (s.site !== 'band' && s.site !== 'region') return false;
10085
+ const g = regionWeight(s.point, reg);
10086
+ const effective = k < explicitCount && reg.falloff !== 'linear' && g < 0.5 ? 4 * g * g * (1 - g) : g;
10087
+ return effective >= 1e-4 && s.share <= 0;
10088
+ })) continue;
10089
+ const atField = k < explicitCount ? `meshes.${meshPart}.contour.regions[${k}].band` : `meshes.${meshPart}.contour.bust`;
10090
+ const perVertex = sites.map((s) => `vertex ${s.index} is ${bandSiteLabel(s.site)} (share ${s.share})`).join(' and ');
10091
+ clauses.push(`contour band region "${reg.name}" (target bone "${reg.bone}", width ${reg.band} px at ${atField}): ${perVertex}, so the band's falloff governs this edge`);
10092
+ }
10093
+ return clauses.join('; ');
10094
+ }
10095
+
9977
10096
  /** Recover only a replay that reproduces every written share on the named vertices. */
9978
10097
  function weightCutReplay(rig: Record<string, unknown>, part: string, rows: ReadonlyMap<number, StepBinding[]>, context?: WeightStepContext): { raw: Map<number, Influence[]>; limits: InfluenceLimits } | null {
9979
10098
  if (context?.config === undefined || context.stage === undefined) return null;
@@ -10182,10 +10301,11 @@ export function stretchLine(geo: IdleGeometry | null, path: string, problems: Pr
10182
10301
  if (severity > TEXTURE_STRETCH_CEILING) {
10183
10302
  failed = true;
10184
10303
  const step = bound === undefined ? '' : weightStepText(bound.rig, m.slot, m.attachment, at.edge, bound);
10304
+ const band = bound === undefined ? '' : contourBandText(bound.rig, m.slot, m.attachment, at.edge, bound, slotParts);
10185
10305
  problems.push({
10186
10306
  code: 'CHECK_TEXTURE_STRETCH',
10187
10307
  object: `mesh "${m.slot}" ${stretchAtText(at)}`,
10188
- detail: `the edge is ${round3(at.ratio)} times its rest length (max(ratio, 1/ratio) ${severity}); <= ${TEXTURE_STRETCH_CEILING} is required${bound === undefined ? '' : `; ${edgeBonesText(bound.rig, bound.motion, m.slot, m.attachment, at.edge)}${step === '' ? '' : `; ${step}`}`} — the texture on it is ${at.ratio >= 1 ? 'stretched' : 'squeezed'}: the bones this mesh is weighted to move apart (amplitudes too large down a chain), or a vertex blends bones that move against each other`,
10308
+ detail: `the edge is ${round3(at.ratio)} times its rest length (max(ratio, 1/ratio) ${severity}); <= ${TEXTURE_STRETCH_CEILING} is required${bound === undefined ? '' : `; ${edgeBonesText(bound.rig, bound.motion, m.slot, m.attachment, at.edge)}${step === '' ? '' : `; ${step}`}${band === '' ? '' : `; ${band}`}`} — the texture on it is ${at.ratio >= 1 ? 'stretched' : 'squeezed'}: the bones this mesh is weighted to move apart (amplitudes too large down a chain), or a vertex blends bones that move against each other`,
10189
10309
  });
10190
10310
  }
10191
10311
  }
@@ -97,8 +97,12 @@ function onSegment(px: number, py: number, ax: number, ay: number, bx: number, b
97
97
  return px >= Math.min(ax, bx) && px <= Math.max(ax, bx) && py >= Math.min(ay, by) && py <= Math.max(ay, by);
98
98
  }
99
99
 
100
- /** Is the squared distance from p to a–b at least `r2`? Exact, integer units, `BigInt` where a product could pass 2^53. */
101
- function atLeast(px: number, py: number, ax: number, ay: number, bx: number, by: number, r2: bigint): boolean {
100
+ function compareBigInt(a: bigint, b: bigint): -1 | 0 | 1 {
101
+ return a < b ? -1 : a > b ? 1 : 0;
102
+ }
103
+
104
+ /** Compare the squared distance from p to segment a–b against `r2`: -1 below, 0 equal, 1 above. Exact on integer units. */
105
+ function compareSegmentDistance2(px: number, py: number, ax: number, ay: number, bx: number, by: number, r2: bigint): -1 | 0 | 1 {
102
106
  const dx = bx - ax;
103
107
  const dy = by - ay;
104
108
  const vx = px - ax;
@@ -106,10 +110,15 @@ function atLeast(px: number, py: number, ax: number, ay: number, bx: number, by:
106
110
  const along = BigInt(vx) * BigInt(dx) + BigInt(vy) * BigInt(dy);
107
111
  const len2 = BigInt(dx) * BigInt(dx) + BigInt(dy) * BigInt(dy);
108
112
  const sq = (x: number, y: number): bigint => BigInt(x) * BigInt(x) + BigInt(y) * BigInt(y);
109
- if (along <= 0n) return sq(vx, vy) >= r2;
110
- if (along >= len2) return sq(px - bx, py - by) >= r2;
113
+ if (along <= 0n) return compareBigInt(sq(vx, vy), r2);
114
+ if (along >= len2) return compareBigInt(sq(px - bx, py - by), r2);
111
115
  const cross = BigInt(dx) * BigInt(vy) - BigInt(dy) * BigInt(vx);
112
- return cross * cross >= r2 * len2;
116
+ return compareBigInt(cross * cross, r2 * len2);
117
+ }
118
+
119
+ /** Is the squared distance from p to a–b at least `r2`? Exact, integer units, `BigInt` where a product could pass 2^53. */
120
+ function atLeast(px: number, py: number, ax: number, ay: number, bx: number, by: number, r2: bigint): boolean {
121
+ return compareSegmentDistance2(px, py, ax, ay, bx, by, r2) >= 0;
113
122
  }
114
123
 
115
124
  /** Strictly inside the ring by the crossing rule, on integer units (a point on an edge is asked separately). */
@@ -123,6 +132,43 @@ function insideRing(px: number, py: number, xs: readonly number[], ys: readonly
123
132
  return inside;
124
133
  }
125
134
 
135
+ /** Where a 1/256 px grid point sits relative to `reg` and its declared falloff band: exact on integer units. */
136
+ export type RegionBandSite = 'region' | 'band' | 'cutoff' | 'outside';
137
+
138
+ /**
139
+ * Classify `p` against `reg` and its declared `band` (`0 < d < band` is `'band'`, `d === band` with `band > 0` is `'cutoff'`).
140
+ * `p` must lie on the 1/256 px grid, like every contour vertex {@link localInfluences} weights.
141
+ */
142
+ export function regionBandSite(p: Point, reg: WeightRegion): RegionBandSite {
143
+ const px = units(p[0], 'point x');
144
+ const py = units(p[1], 'point y');
145
+ const B = units(reg.band, 'band');
146
+ if (reg.shape === 'circle') {
147
+ const dx = px - units(reg.cx, 'cx');
148
+ const dy = py - units(reg.cy, 'cy');
149
+ const R = units(reg.r, 'r');
150
+ const d2 = BigInt(dx) * BigInt(dx) + BigInt(dy) * BigInt(dy);
151
+ if (d2 <= BigInt(R) * BigInt(R)) return 'region';
152
+ if (B === 0) return 'outside';
153
+ const outer2 = BigInt(R + B) * BigInt(R + B);
154
+ return d2 < outer2 ? 'band' : d2 === outer2 ? 'cutoff' : 'outside';
155
+ }
156
+ const xs = reg.points.map((q) => units(q[0], 'polygon x'));
157
+ const ys = reg.points.map((q) => units(q[1], 'polygon y'));
158
+ const n = xs.length;
159
+ for (let i = 0; i < n; i++) if (onSegment(px, py, xs[i], ys[i], xs[(i + 1) % n], ys[(i + 1) % n])) return 'region';
160
+ if (insideRing(px, py, xs, ys)) return 'region';
161
+ if (B === 0) return 'outside';
162
+ const B2 = BigInt(B) * BigInt(B);
163
+ let atCutoff = false;
164
+ for (let i = 0; i < n; i++) {
165
+ const cmp = compareSegmentDistance2(px, py, xs[i], ys[i], xs[(i + 1) % n], ys[(i + 1) % n], B2);
166
+ if (cmp < 0) return 'band';
167
+ if (cmp === 0) atCutoff = true;
168
+ }
169
+ return atCutoff ? 'cutoff' : 'outside';
170
+ }
171
+
126
172
  /**
127
173
  * The nominal linear share at `p` (same frame as the region), used to decide
128
174
  * support. `p` must be on the 1/256 px grid. See the module header for