@rig-c/parts 1.86.0 → 1.88.0
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 +52 -12
- package/docs/AUTHORING.md +205 -2
- package/docs/STABILITY.md +50 -5
- package/package.json +1 -1
- package/src/assemble.ts +2 -10
- package/src/build.ts +12 -8
- package/src/check.ts +5 -4
- package/src/config.ts +14 -3
- package/src/depthmaps.ts +170 -0
- package/src/depthworkflow.ts +239 -0
- package/src/rig.ts +17 -0
- package/src/seamrule.ts +11 -0
- package/src/setuppainting.ts +6 -1
package/src/seamrule.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Shared seam choices for the config reader and assembly. */
|
|
2
|
+
export type SeamRule = 'near-white' | 'silhouette';
|
|
3
|
+
export const SEAM_RULES: readonly SeamRule[] = ['near-white', 'silhouette'];
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The seam rule a run uses when none is named. Set by measurement, not taste:
|
|
7
|
+
* the silhouette rule ships as the default only if it lowers the error pixel
|
|
8
|
+
* count on every oracle character without raising mean |d| on any
|
|
9
|
+
* (ORACLE_assemble.md, *faithful vs silhouette*).
|
|
10
|
+
*/
|
|
11
|
+
export const DEFAULT_SEAM_RULE: SeamRule = 'near-white';
|
package/src/setuppainting.ts
CHANGED
|
@@ -74,6 +74,10 @@ export interface SetupPaintingLine {
|
|
|
74
74
|
reason?: string;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
/** An undeclared observation has no measured pixels, inferred regions or limit. */
|
|
78
|
+
export type SetupPaintingObservation = SetupPaintingLine | { status: 'SKIP'; reason: string };
|
|
79
|
+
export const UNDECLARED_SETUP_PAINTING_REASON = 'setup_painting is undeclared; setup-to-painting was not measured. To measure it, give --requirements <file> declaring setup_painting.rgb_tolerance and setup_painting.regions with name, box and authored max_pixels limits';
|
|
80
|
+
|
|
77
81
|
/** Pixel metric only. Caller supplies the actual renderer's textured setup and
|
|
78
82
|
* its per-pixel drawn-piece owners on precisely the source grid. RGB under
|
|
79
83
|
* zero alpha is ignored: both observations are source-over white first.
|
|
@@ -119,7 +123,8 @@ export function setupPaintingLine(
|
|
|
119
123
|
...(noLimit ? { reason: 'a region has no declared max_pixels; it is measured as SKIP, never PASS' } : {}) };
|
|
120
124
|
}
|
|
121
125
|
|
|
122
|
-
export function setupPaintingLines(line:
|
|
126
|
+
export function setupPaintingLines(line: SetupPaintingObservation): string[] {
|
|
127
|
+
if (!('regions' in line)) return [`${SETUP_PAINTING_LINE}: SKIP — ${line.reason}`];
|
|
123
128
|
return [`${SETUP_PAINTING_LINE}: ${line.status}${line.reason === undefined ? '' : ` — ${line.reason}`}; ${line.registration}; ${line.compositing}`,
|
|
124
129
|
...line.regions.flatMap(r => [`${SETUP_PAINTING_LINE}: region "${r.name}" ${r.status} — box [${r.box.join(', ')}], pixelcount ${r.pixel_count}, limit ${r.limit ?? 'undeclared (SKIP)'}, RGB tolerance ${line.rgb_tolerance}`,
|
|
125
130
|
...r.slots.map(s => `${SETUP_PAINTING_LINE}: slot "${s.slot}" region "${r.name}" — box [${s.box.join(', ')}], pixelcount ${s.pixel_count}; region total ${r.pixel_count}, limit ${r.limit ?? 'undeclared (SKIP)'}`)])];
|