spine-parts 2.13.1 → 2.14.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/docs/AUTHORING.md +1 -0
- package/docs/STABILITY.md +8 -2
- package/package.json +1 -1
- package/src/assemble.ts +3 -0
- package/src/build.ts +22 -2
- package/src/config.ts +10 -5
- package/src/paintingedges.ts +46 -2
package/docs/AUTHORING.md
CHANGED
|
@@ -4992,6 +4992,7 @@ row in this page's `rule` and `line` tables; the selftest holds that (`TY16`).
|
|
|
4992
4992
|
| <a id="PARTS_HYBRID_PAIR"></a>`PARTS_HYBRID_PAIR` | a rigid joint references a missing or inconsistent generated band | re-run assemble; keep source, joint, carriers and measured geometry together |
|
|
4993
4993
|
| <a id="RIG_HYBRID_SOURCE"></a>`RIG_HYBRID_SOURCE` | an assembled band no longer matches its config declaration | re-run assemble with the current config |
|
|
4994
4994
|
| <a id="RIG_HYBRID_RIGID"></a>`RIG_HYBRID_RIGID` | a band neighbour is not a rigid region | attach the upper and lower pieces as regions on their own carriers |
|
|
4995
|
+
| <a id="ASSEMBLE_ALT_FIGURE_MASK_OMITTED"></a>`ASSEMBLE_ALT_FIGURE_MASK_OMITTED` | informational line naming an alternate whose painting file has different bytes from the primary painting, so its assembly omits the primary figure mask | supply the same painting bytes to share the verified declaration; different-painting alternates keep their omitted-mask assembly path |
|
|
4995
4996
|
| <a id="ASSEMBLE_ALT_TIP_NAME"></a>`ASSEMBLE_ALT_TIP_NAME` | an explicit endpoint names no supplied bone | declare the single bone or expanded link |
|
|
4996
4997
|
| <a id="ASSEMBLE_ALT_TIP_POINT"></a>`ASSEMBLE_ALT_TIP_POINT` | an explicit endpoint is not finite after normalization onto the accepted rig canvas | correct the source-crop pair and scale |
|
|
4997
4998
|
| <a id="PARTS_ALT_TIPS"></a>`PARTS_ALT_TIPS` | alternate endpoints are not a non-empty bone-name map of finite rig-crop pairs | re-run assemble with valid source-crop tips |
|
package/docs/STABILITY.md
CHANGED
|
@@ -556,7 +556,7 @@ The separate ordering scalar is unchanged. No-image outputs retain legacy bytes.
|
|
|
556
556
|
|
|
557
557
|
| Optional field | Additive contract |
|
|
558
558
|
| --- | --- |
|
|
559
|
-
| `setup_painting.figure_mask` | Verified source-grid alpha support restricts region counts; omission preserves the shipped domain and output bytes. |
|
|
559
|
+
| `setup_painting.figure_mask` | Verified source-grid alpha support restricts region counts and opts busy-ground visible assembly into bounded hole and interior-translucency restoration; omission preserves the shipped domain and output bytes. |
|
|
560
560
|
|
|
561
561
|
The optional `setup_painting.figure_mask` (issue #974, additive) declares a
|
|
562
562
|
`path` and byte `sha256` for independent figure alpha support on the original
|
|
@@ -565,7 +565,13 @@ sampled at nearest source pixel centres onto the stage, with empty support
|
|
|
565
565
|
refused. Region limits count only inside that support. Outside-mask uncovered
|
|
566
566
|
mismatches have their own unbarred stage-wide row. The verified declaration is
|
|
567
567
|
recorded in the report. Omitting it preserves existing output bytes and the
|
|
568
|
-
shipped domain predicate.
|
|
568
|
+
shipped domain predicate. Assemble reads the same requirements declaration through
|
|
569
|
+
the explicit requirements flag or config.requirements. Busy-ground visible
|
|
570
|
+
restoration requires pre-step and assembled four-neighbour support, prefers the
|
|
571
|
+
frontmost pre-step holder, then nearest pre-step owner with frontmost ties.
|
|
572
|
+
Keep, feather, locked and moving-pair boundaries remain excluded. Plain-ground
|
|
573
|
+
assembly keeps its existing path.
|
|
574
|
+
Busy-ground visible assembly validates config.requirements and its flag correspondence, refusing malformed requirements or unverifiable figure masks before writing.
|
|
569
575
|
|
|
570
576
|
The optional `setup_painting` key in `spine-parts-requirements/1` adds a
|
|
571
577
|
`SETUP_MATCHES_PAINTING` measurement when declared. It requires authored
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spine-parts",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.14.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
|
"bin": {
|
package/src/assemble.ts
CHANGED
|
@@ -337,6 +337,8 @@ export interface AssembleInput {
|
|
|
337
337
|
projectRule: ProjectRule;
|
|
338
338
|
/** `config.assemble.ground` (issue #996), read by `paintingEdges` under `visible` only; absent, `plain`. */
|
|
339
339
|
ground?: Ground;
|
|
340
|
+
/** Verified requirements figure support on the rig grid, for busy visible restoration. */
|
|
341
|
+
declaredFigure?: Mask;
|
|
340
342
|
/** `config.scene` (issue #242): the painting is a scene, so the recomposite is read inside the figure ({@link sceneFigure}). Absent or false: nothing changes. */
|
|
341
343
|
scene?: boolean;
|
|
342
344
|
/** `config.limbs` (issue #349): the parts cut at their joints ({@link LimbCount}). Absent or empty: nothing changes. */
|
|
@@ -5735,6 +5737,7 @@ function assembleParts(input: AssembleInput, targets?: ReadonlySet<string>, befo
|
|
|
5735
5737
|
const e = paintingEdges(stack.map(onRig), srcr, {
|
|
5736
5738
|
painted: supportPainted,
|
|
5737
5739
|
figure: visibleFigure,
|
|
5740
|
+
...(input.declaredFigure === undefined ? {} : { declaredFigure: input.declaredFigure }),
|
|
5738
5741
|
...(input.ground === undefined ? {} : { ground: input.ground }),
|
|
5739
5742
|
editable: order.map((d) => !('patch' in d)),
|
|
5740
5743
|
keep: keepInOrder,
|
package/src/build.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { readSetupFigureMask } from './setupfiguremask.ts';
|
|
1
2
|
import { EDGE_RESIDUAL_FILE, edgeResidualLines } from './edgeresidual.ts';
|
|
2
3
|
import { SUPPORT_DOMAINS_FILE, writeSupportDomains } from './supportdomains.ts';
|
|
3
4
|
import { COINCIDE_LINE, supportLines } from './coincide.ts';
|
|
@@ -340,10 +341,12 @@ export function assembleStage(input: AssembleStageInput, outs: AssembleOutputs,
|
|
|
340
341
|
const pinholesAsked = requirementsFile !== null && pinholesRequired(requirementsFile);
|
|
341
342
|
// The early door: assemble runs before propose has drafted bones, meshes,
|
|
342
343
|
// regions and motion, so it requires only what it reads (issue #20).
|
|
343
|
-
const cfg = loadEarlyConfig(input.config, 'assemble');
|
|
344
|
+
const cfg = loadEarlyConfig(input.config, 'assemble', input.project);
|
|
344
345
|
const supportDeclarations = JSON.stringify(cfg.assemble.cuts ?? []);
|
|
345
346
|
const seam = input.seam ?? cfg.assemble.seam ?? DEFAULT_SEAM_RULE;
|
|
346
347
|
const project = input.project ?? cfg.assemble.project ?? DEFAULT_PROJECT_RULE;
|
|
348
|
+
const requirements = cfg.assemble.ground === 'busy' && project === 'visible'
|
|
349
|
+
? buildRequirements(input.requirements, cfg.requirements, input.config) : null;
|
|
347
350
|
const src = readSource(input.source);
|
|
348
351
|
const read = readRuns(input.full, input.head);
|
|
349
352
|
// Issue #946: every declared receipt is held to its file, and under `required` every edited image needs one, before anything is assembled.
|
|
@@ -354,9 +357,14 @@ export function assembleStage(input: AssembleStageInput, outs: AssembleOutputs,
|
|
|
354
357
|
const runs = applyTakenRegions(takenRuns, src, cfg, input.config, requirementsFile?.setup_painting, receipts, input.source);
|
|
355
358
|
for (const note of runs.notes) log(note.startsWith('WARN ') ? note : `note: ${note}`);
|
|
356
359
|
const fields = stageFields(cfg, runs.single ? { w: src.width, h: src.height } : null);
|
|
360
|
+
const setupPainting = requirements === null || fields.ground !== 'busy' || project !== 'visible' ? undefined
|
|
361
|
+
: readRequirements(requirements.read).setup_painting;
|
|
362
|
+
const figureSupport = setupPainting === undefined ? undefined
|
|
363
|
+
: readSetupFigureMask(setupPainting, requirements!.read, src, Math.trunc(src.width * fields.rigScale), Math.trunc(src.height * fields.rigScale));
|
|
364
|
+
const declaredFigure = figureSupport === undefined ? undefined : { width: Math.trunc(src.width * fields.rigScale), height: Math.trunc(src.height * fields.rigScale), data: figureSupport };
|
|
357
365
|
const under = readUnders(input.config, fields.cuts);
|
|
358
366
|
const caps = fields.limbs === undefined ? undefined : readCaps(input.config, fields.limbs);
|
|
359
|
-
const result = assemble({ source: src, full: runs.full, head: runs.head, depth: cfg.depth, depthBase: dirname(resolve(input.config)), ...fields, under,
|
|
367
|
+
const result = assemble({ source: src, full: runs.full, head: runs.head, depth: cfg.depth, depthBase: dirname(resolve(input.config)), ...fields, under, ...(declaredFigure === undefined ? {} : { declaredFigure }),
|
|
360
368
|
...((cfg.assemble.take ?? []).some(t => 'part' in t) ? { regionTake: { full: takenRuns.full, head: takenRuns.head, targets: (cfg.assemble.take ?? []).flatMap(t => 'part' in t ? [t.part] : []) } } : {}), ...(caps === undefined ? {} : { caps }), seamRule: seam, projectRule: project });
|
|
361
369
|
|
|
362
370
|
// Issue #454: alternate painting sets, assembled before any file is written.
|
|
@@ -422,6 +430,7 @@ export function assembleStage(input: AssembleStageInput, outs: AssembleOutputs,
|
|
|
422
430
|
// Issue #664: each limb segment part with a declared front slot -> the part its front slot follows.
|
|
423
431
|
const frontAfter = new Map<string, string>();
|
|
424
432
|
for (const limb of Object.values(fields.limbs ?? {})) for (const p of limb.front?.parts ?? []) frontAfter.set(p, (limb.front as { after: string }).after);
|
|
433
|
+
const primaryPaintingHash = declaredFigure === undefined ? null : createHash('sha256').update(readFileSync(input.source)).digest('hex');
|
|
425
434
|
for (const alt of mergedAlts) {
|
|
426
435
|
if (alt.source === undefined || alt.full === undefined) {
|
|
427
436
|
altProblems.push({
|
|
@@ -670,6 +679,16 @@ export function assembleStage(input: AssembleStageInput, outs: AssembleOutputs,
|
|
|
670
679
|
: altFront.size === 0
|
|
671
680
|
? setExclusions(result.images, exW, exH, altSegParts, replacedSet)
|
|
672
681
|
: altSegParts.flatMap((sp) => setExclusions(altFront.has(sp) ? frontOrdered(result.images, new Set([sp]), frontAfter) : result.images, exW, exH, [sp], replacedSet));
|
|
682
|
+
const alternateFigure = declaredFigure !== undefined &&
|
|
683
|
+
createHash('sha256').update(readFileSync(alt.source)).digest('hex') === primaryPaintingHash ? declaredFigure : undefined;
|
|
684
|
+
if (declaredFigure !== undefined && alternateFigure === undefined) {
|
|
685
|
+
const notice = {
|
|
686
|
+
code: 'ASSEMBLE_ALT_FIGURE_MASK_OMITTED',
|
|
687
|
+
object: `alternate "${alt.name}"`,
|
|
688
|
+
detail: 'has different painting bytes; the primary figure mask is omitted',
|
|
689
|
+
};
|
|
690
|
+
log(`${notice.code}: ${notice.object} ${notice.detail}`);
|
|
691
|
+
}
|
|
673
692
|
let altRes: ReturnType<typeof assemble>;
|
|
674
693
|
try {
|
|
675
694
|
altRes = assemble({
|
|
@@ -697,6 +716,7 @@ export function assembleStage(input: AssembleStageInput, outs: AssembleOutputs,
|
|
|
697
716
|
...(fields.headFaceUnderfill === undefined ? {} : { headFaceUnderfill: fields.headFaceUnderfill }),
|
|
698
717
|
...(fields.yieldRefused === undefined ? {} : { yieldRefused: fields.yieldRefused }),
|
|
699
718
|
...(fields.ground === undefined ? {} : { ground: fields.ground }),
|
|
719
|
+
...(alternateFigure === undefined ? {} : { declaredFigure: alternateFigure }),
|
|
700
720
|
...(fields.turnMovingPair === undefined ? {} : { turnMovingPair: fields.turnMovingPair }),
|
|
701
721
|
...(fields.turn === undefined ? {} : { turn: fields.turn, regions: fields.regions, meshes: fields.meshes, motion: fields.motion }),
|
|
702
722
|
seamRule: seam,
|
package/src/config.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SEAM_RULES, type SeamRule } from './seamrule.ts';
|
|
2
|
-
import { GROUNDS, type Ground, PROJECT_RULES, type ProjectRule } from './projectrule.ts';
|
|
2
|
+
import { DEFAULT_PROJECT_RULE, GROUNDS, type Ground, PROJECT_RULES, type ProjectRule } from './projectrule.ts';
|
|
3
3
|
import type { TakeDeclaration } from './takeregion.ts';
|
|
4
4
|
import { paintingExtensionProblems, type PaintingExtension } from './paintingextension.ts';
|
|
5
5
|
import { baseAnchorProblems, type BaseAnchor } from './baseanchor.ts';
|
|
@@ -1671,6 +1671,8 @@ export interface EarlyConfig {
|
|
|
1671
1671
|
|
|
1672
1672
|
/** What plain `assemble` reads: the early config plus the plan `--propose-plan` printed. */
|
|
1673
1673
|
export interface AssembleConfig {
|
|
1674
|
+
/** Existing requirements declaration, shared by standalone assemble and build. */
|
|
1675
|
+
requirements?: string;
|
|
1674
1676
|
depth?: DepthConfig;
|
|
1675
1677
|
key: string;
|
|
1676
1678
|
seethrough: SeeThrough;
|
|
@@ -1719,7 +1721,7 @@ export function parseEarlyConfig(raw: Json, door: EarlyDoor): PaintConfig | Earl
|
|
|
1719
1721
|
}
|
|
1720
1722
|
|
|
1721
1723
|
/** The early loader with, when `base` is the config's directory, the pose file `generation.control.skeleton` names read beside it. */
|
|
1722
|
-
function parseEarlyConfigFrom(raw: Json, door: EarlyDoor, base: string | null): { config: PaintConfig | EarlyConfig | AssembleConfig; pose: ControlPose | null } {
|
|
1724
|
+
function parseEarlyConfigFrom(raw: Json, door: EarlyDoor, base: string | null, project?: ProjectRule): { config: PaintConfig | EarlyConfig | AssembleConfig; pose: ControlPose | null } {
|
|
1723
1725
|
const c = new Check();
|
|
1724
1726
|
// `generation` is taken out of the generic presence check so its absence can
|
|
1725
1727
|
// say what the block has to hold, rather than only that it is missing.
|
|
@@ -1760,6 +1762,9 @@ function parseEarlyConfigFrom(raw: Json, door: EarlyDoor, base: string | null):
|
|
|
1760
1762
|
}
|
|
1761
1763
|
}
|
|
1762
1764
|
if (door === 'assemble') {
|
|
1765
|
+
const busyVisible = isPlainObject(t.assemble) && t.assemble.ground === 'busy' &&
|
|
1766
|
+
(project ?? t.assemble.project ?? DEFAULT_PROJECT_RULE) === 'visible';
|
|
1767
|
+
if (busyVisible && 'requirements' in t && c.string('config.requirements', t.requirements) && base !== null) checkRequirementsFile(c, configFilePath('requirements', base, t.requirements) as string);
|
|
1763
1768
|
if ('seethrough' in t) checkSeeThrough(c, t.seethrough);
|
|
1764
1769
|
const made = 'assemble' in t ? checkAssemble(c, t.assemble, door) : { parts: [], patches: [], cuts: [] };
|
|
1765
1770
|
checkProposedRigScale(c, t);
|
|
@@ -1810,9 +1815,9 @@ function parseEarlyConfigFrom(raw: Json, door: EarlyDoor, base: string | null):
|
|
|
1810
1815
|
|
|
1811
1816
|
export function loadEarlyConfig(path: string, door: 'paint'): PaintConfig;
|
|
1812
1817
|
export function loadEarlyConfig(path: string, door: 'layers'): EarlyConfig;
|
|
1813
|
-
export function loadEarlyConfig(path: string, door: 'assemble'): AssembleConfig;
|
|
1814
|
-
export function loadEarlyConfig(path: string, door: EarlyDoor): PaintConfig | EarlyConfig | AssembleConfig {
|
|
1815
|
-
return parseEarlyConfigFrom(readConfigFile(path), door, dirname(resolve(path))).config;
|
|
1818
|
+
export function loadEarlyConfig(path: string, door: 'assemble', project?: ProjectRule): AssembleConfig;
|
|
1819
|
+
export function loadEarlyConfig(path: string, door: EarlyDoor, project?: ProjectRule): PaintConfig | EarlyConfig | AssembleConfig {
|
|
1820
|
+
return parseEarlyConfigFrom(readConfigFile(path), door, dirname(resolve(path)), project).config;
|
|
1816
1821
|
}
|
|
1817
1822
|
|
|
1818
1823
|
/**
|
package/src/paintingedges.ts
CHANGED
|
@@ -52,7 +52,9 @@ import { type Mask, newMask, type Raster, RasterError } from './raster/types.ts'
|
|
|
52
52
|
* - on FRONT's side of See-through's line, a pixel whose colour FRONT itself
|
|
53
53
|
* holds deeper in (within half of {@link EDGE_CONTRAST}, and nearer that
|
|
54
54
|
* than any BEHIND-side pixel) is FRONT's interior — a lining, a highlight —
|
|
55
|
-
* and reads 1, however it falls along the axis.
|
|
55
|
+
* and reads 1, however it falls along the axis. On the silhouette (BEHIND is
|
|
56
|
+
* background), raw integer coverage 16..239 is graded and keeps its estimate:
|
|
57
|
+
* proximity to an interior colour does not establish opaque coverage (#1068).
|
|
56
58
|
*
|
|
57
59
|
* A painted pixel no part covers above the owner floor — the gap between two
|
|
58
60
|
* soft rims — is owned by the nearest part (within `2 * EDGE_RADIUS + 2`), so
|
|
@@ -175,6 +177,8 @@ export interface PaintingEdgeOptions {
|
|
|
175
177
|
painted: Uint8Array;
|
|
176
178
|
/** Canonical painted figure domain for completing allocated gaps and interior translucency. */
|
|
177
179
|
figure?: Mask;
|
|
180
|
+
/** Independently declared support, consumed only on busy ground. */
|
|
181
|
+
declaredFigure?: Mask;
|
|
178
182
|
/** Per part: whether the step may write it (false for a painting patch). */
|
|
179
183
|
editable: readonly boolean[];
|
|
180
184
|
keep?: ReadonlyArray<Mask | null>;
|
|
@@ -257,6 +261,12 @@ export function paintingEdges(parts: Raster[], srcr: Raster, options: PaintingEd
|
|
|
257
261
|
const R = EDGE_RADIUS;
|
|
258
262
|
const cap = 2 * R + 2;
|
|
259
263
|
const busy = options.ground === 'busy';
|
|
264
|
+
const declaredFigure = busy ? options.declaredFigure : undefined;
|
|
265
|
+
const preSupport = declaredFigure === undefined ? undefined : parts.map(part => {
|
|
266
|
+
const support = new Uint8Array(W * H);
|
|
267
|
+
for (let p = 0; p < W * H; p++) support[p] = part.data[p * 4 + 3] > 0 ? 1 : 0;
|
|
268
|
+
return support;
|
|
269
|
+
});
|
|
260
270
|
/** A part's support before the step: where its own alpha is above 0. */
|
|
261
271
|
const supports = (i: number, p: number): boolean => parts[i].data[p * 4 + 3] > 0;
|
|
262
272
|
const owner = new Int16Array(W * H).fill(-1);
|
|
@@ -428,7 +438,8 @@ export function paintingEdges(parts: Raster[], srcr: Raster, options: PaintingEd
|
|
|
428
438
|
let matte = Math.round((255 * Math.min(hi - lo, Math.max(0, along(p) - lo))) / (hi - lo));
|
|
429
439
|
// On FRONT's side of the line, a colour FRONT itself holds deeper in (within half the contrast floor, and nearer FRONT than
|
|
430
440
|
// BEHIND) is FRONT's interior — a light lining, a highlight — not a mix with BEHIND, however it falls along the axis.
|
|
431
|
-
|
|
441
|
+
const gradedSilhouette = behind === -1 && matte >= 16 && matte <= 239;
|
|
442
|
+
if (a === front && matte < 255 && !gradedSilhouette) {
|
|
432
443
|
let dF = Infinity;
|
|
433
444
|
let dFdeep = Infinity;
|
|
434
445
|
for (let qy = Math.max(0, y - R); qy <= Math.min(H - 1, y + R); qy++) {
|
|
@@ -674,6 +685,39 @@ export function paintingEdges(parts: Raster[], srcr: Raster, options: PaintingEd
|
|
|
674
685
|
}
|
|
675
686
|
}
|
|
676
687
|
}
|
|
688
|
+
// Busy restoration reads frozen pre-step support and pre-restoration art.
|
|
689
|
+
// Neither owner allocation nor a newly restored pixel supplies a witness.
|
|
690
|
+
if (declaredFigure !== undefined && preSupport !== undefined) {
|
|
691
|
+
for (let p = 0; p < W * H; p++) {
|
|
692
|
+
if (declaredFigure.data[p] !== 1 || srcr.data[p * 4 + 3] === 0 || locked[p] === 1 ||
|
|
693
|
+
options.keep?.some(m => m?.data[p] === 1) || options.feathered?.some(m => m?.data[p] === 1)) continue;
|
|
694
|
+
const x = p % W;
|
|
695
|
+
const neighbours = [
|
|
696
|
+
...(x > 0 ? [p - 1] : []), ...(x + 1 < W ? [p + 1] : []),
|
|
697
|
+
...(p >= W ? [p - W] : []), ...(p + W < W * H ? [p + W] : []),
|
|
698
|
+
];
|
|
699
|
+
let alpha = 0;
|
|
700
|
+
for (const part of parts) {
|
|
701
|
+
const a = part.data[p * 4 + 3];
|
|
702
|
+
const t = a * 255 + alpha * (255 - a) + 128;
|
|
703
|
+
alpha = ((t >>> 8) + t) >>> 8;
|
|
704
|
+
}
|
|
705
|
+
if (alpha >= 128 || (alpha > 0 && (neighbours.length !== 4 ||
|
|
706
|
+
!neighbours.every(q => declaredFigure.data[q] === 1 && srcr.data[q * 4 + 3] > 0)))) continue;
|
|
707
|
+
const qualifies = (k: number): boolean => options.editable[k] &&
|
|
708
|
+
neighbours.some(q => preSupport[k][q] === 1) && neighbours.some(q => parts[k].data[q * 4 + 3] > 0);
|
|
709
|
+
let front = -1;
|
|
710
|
+
let distance = cap;
|
|
711
|
+
for (let k = n - 1; k >= 0; k--) {
|
|
712
|
+
if (!qualifies(k)) continue;
|
|
713
|
+
if (preSupport[k][p] === 1) { front = k; break; }
|
|
714
|
+
if (near[k][p] < distance) { front = k; distance = near[k][p]; }
|
|
715
|
+
}
|
|
716
|
+
if (front < 0 || parts.some((part, k) => k !== front &&
|
|
717
|
+
(preSupport[k][p] === 1 || part.data[p * 4 + 3] > 0) && options.movingPair?.(front, k) === true)) continue;
|
|
718
|
+
restore.push([p, front]);
|
|
719
|
+
}
|
|
720
|
+
}
|
|
677
721
|
for (const [p, front] of restore) {
|
|
678
722
|
const s = p * 4;
|
|
679
723
|
parts[front].data.set([srcr.data[s], srcr.data[s + 1], srcr.data[s + 2], 255], s);
|