partforge 0.163.1 → 0.164.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/bin/cli.js +9 -5
- package/docs/AUTHORING-PARTS.md +195 -36
- package/docs/ERROR-PATTERNS.md +6 -0
- package/package.json +1 -1
- package/src/framework/lint/rules-verify.js +35 -2
- package/src/framework/oracle/bed-contact.js +94 -12
- package/src/framework/oracle/dfm-profiles.js +42 -51
- package/src/framework/oracle/gates.js +7 -1
- package/src/framework/oracle/measure.js +40 -15
- package/src/framework/oracle/verify.js +44 -20
- package/src/framework/process/fdm/descriptor.js +48 -0
- package/src/framework/process/registry.js +30 -0
- package/src/framework/process/resin/descriptor.js +19 -0
- package/src/framework/verify-metrics.js +17 -6
- package/types/part.d.ts +23 -9
- package/types/testing.d.ts +17 -3
package/types/part.d.ts
CHANGED
|
@@ -484,9 +484,9 @@ export interface DfmProfile {
|
|
|
484
484
|
minWall?: number;
|
|
485
485
|
/**
|
|
486
486
|
* Steepest unsupported face the process prints cleanly, in degrees from
|
|
487
|
-
* vertical (45 on the FDM profiles; absent on resin).
|
|
488
|
-
*
|
|
489
|
-
*
|
|
487
|
+
* vertical (45 on the FDM profiles; absent on resin). The print process alone
|
|
488
|
+
* arms the check; `null` switches it off under a named base. Reported as a
|
|
489
|
+
* cost (needing supports), never a failure.
|
|
490
490
|
*/
|
|
491
491
|
overhang?: number | null;
|
|
492
492
|
/**
|
|
@@ -495,6 +495,8 @@ export interface DfmProfile {
|
|
|
495
495
|
* profile alone; `null` switches it off under a named base.
|
|
496
496
|
*/
|
|
497
497
|
bedContact?: number | null;
|
|
498
|
+
/** Percent of a printed piece's posed base area resting on the bed below which the footprint cost fires. */
|
|
499
|
+
footprint?: number | null;
|
|
498
500
|
/** Carried for a future gap check; not enforced yet. */
|
|
499
501
|
clearance?: number;
|
|
500
502
|
/**
|
|
@@ -562,8 +564,8 @@ export interface SubPartExpectations {
|
|
|
562
564
|
wall?: Expectation;
|
|
563
565
|
/**
|
|
564
566
|
* Unsupported downward-facing surface in mm² (faces steeper than the profile's
|
|
565
|
-
* `overhang` angle, bed at the sub-part's own lowest Z).
|
|
566
|
-
*
|
|
567
|
+
* `overhang` angle, bed at the sub-part's own lowest Z). Armed by the print
|
|
568
|
+
* process alone; reported as a cost (`verify.costs`), never a failure.
|
|
567
569
|
*/
|
|
568
570
|
overhangArea?: Expectation;
|
|
569
571
|
/**
|
|
@@ -572,6 +574,13 @@ export interface SubPartExpectations {
|
|
|
572
574
|
* Under an FDM profile every printed sub-part gets `>=50` by default; a gate.
|
|
573
575
|
*/
|
|
574
576
|
bedContactPct?: Expectation;
|
|
577
|
+
/**
|
|
578
|
+
* Share (0–100) of the sub-part's posed base area (its xy extent in the print pose)
|
|
579
|
+
* whose flat underside touches the bed — near 0 for a piece standing on a point, a
|
|
580
|
+
* line or a curl. Under an FDM profile every printed sub-part gets `>=5`; reported as
|
|
581
|
+
* a cost (`verify.costs`), never a failure; `accept: ["footprint"]` records a brim.
|
|
582
|
+
*/
|
|
583
|
+
footprintPct?: Expectation;
|
|
575
584
|
/** Symmetric-difference volume vs. the sub-part's declared `reference` import. */
|
|
576
585
|
refXorVolume?: Expectation;
|
|
577
586
|
/** Percent volume delta vs. the sub-part's declared `reference` import. */
|
|
@@ -640,12 +649,17 @@ export interface VerifyBlock<P = ResolvedParams, D = Derived> {
|
|
|
640
649
|
/** A named DFM profile or an inline one. */
|
|
641
650
|
process?: DfmProfileName | DfmProfile;
|
|
642
651
|
/**
|
|
643
|
-
* `"print"` declares
|
|
644
|
-
* bed at its own lowest Z
|
|
645
|
-
* check is armed. Omit it while a part is still being shaped or is bound for
|
|
646
|
-
* another process.
|
|
652
|
+
* `"print"` declares that `build()` is the print pose — Z up, each sub-part's
|
|
653
|
+
* bed at its own lowest Z. It does not arm any check; the print process does.
|
|
647
654
|
*/
|
|
648
655
|
orientation?: "print";
|
|
656
|
+
/**
|
|
657
|
+
* Costs the user accepted, by id. An accepted cost is still measured and
|
|
658
|
+
* reported (`accepted: true`), but no longer raised as something to fix. Only the
|
|
659
|
+
* process's own default check is marked accepted: a limit you wrote in `expect`
|
|
660
|
+
* (`overhangArea: "<=500"`) keeps its meaning and is never marked accepted.
|
|
661
|
+
*/
|
|
662
|
+
accept?: ("supports" | "footprint")[];
|
|
649
663
|
/** Which cases to check; default is `"defaults"` plus every preset name. */
|
|
650
664
|
cases?: string[];
|
|
651
665
|
/**
|
package/types/testing.d.ts
CHANGED
|
@@ -433,6 +433,14 @@ export interface SubPartFacts {
|
|
|
433
433
|
bedHoverGap: number | null;
|
|
434
434
|
/** Centroid of the largest hovering face; `null` when nothing hovers. */
|
|
435
435
|
bedHoverAt: number[] | null;
|
|
436
|
+
/**
|
|
437
|
+
* Share (0–100) of the piece's silhouette on the bed (its outline seen from below, in
|
|
438
|
+
* the print pose) that actually touches it — the footprint cost's reading, from the
|
|
439
|
+
* bed-contact pass; `null` when that pass did not run or the silhouette is empty.
|
|
440
|
+
*/
|
|
441
|
+
footprintPct: number | null;
|
|
442
|
+
/** The piece's lowest point, in display coordinates; `null` when not checked. */
|
|
443
|
+
footprintAt: number[] | null;
|
|
436
444
|
/**
|
|
437
445
|
* Present only when bed contact had to be read off the piece's export build (its
|
|
438
446
|
* print pose could not be read from place() alone) and that build failed.
|
|
@@ -521,6 +529,8 @@ export interface MeasureReport {
|
|
|
521
529
|
measuredOverhang: number | null;
|
|
522
530
|
/** Whether the bed-contact pass ran (the part is checked for it). */
|
|
523
531
|
measuredBedContact: boolean;
|
|
532
|
+
/** Whether the footprint was read — the same pass, so always `measuredBedContact`. */
|
|
533
|
+
measuredFootprint: boolean;
|
|
524
534
|
/**
|
|
525
535
|
* Present only in a view holding a sheet part: whether the printed sub-parts' print
|
|
526
536
|
* (export) poses were built for `printBbox`.
|
|
@@ -595,7 +605,7 @@ export function measure(
|
|
|
595
605
|
|
|
596
606
|
// --- verify -----------------------------------------------------------------
|
|
597
607
|
|
|
598
|
-
export type CheckStatus = "pass" | "fail" | "warn" | "skip";
|
|
608
|
+
export type CheckStatus = "pass" | "fail" | "warn" | "cost" | "skip";
|
|
599
609
|
|
|
600
610
|
export interface VerifyCheck {
|
|
601
611
|
/** `"part"` is the vacuous-verify notice; `"case"` the quick-lap "not measured" marker. */
|
|
@@ -603,8 +613,10 @@ export interface VerifyCheck {
|
|
|
603
613
|
/** The sub-part name, `"a×b"` for a pair check, or `null` for a scalar view metric. */
|
|
604
614
|
subpart: string | null;
|
|
605
615
|
metric: string;
|
|
606
|
-
/** `gate` failures set a non-zero exit code; `warn` never blocks. */
|
|
607
|
-
kind: "gate" | "warn";
|
|
616
|
+
/** `gate` failures set a non-zero exit code; `warn` never blocks; `cost` is a design choice with a price. */
|
|
617
|
+
kind: "gate" | "warn" | "cost";
|
|
618
|
+
/** On a `cost` check: whether the user listed its id in `verify.accept`. */
|
|
619
|
+
accepted?: boolean;
|
|
608
620
|
/** The asserted expression, stringified. */
|
|
609
621
|
expr: string;
|
|
610
622
|
actual: unknown;
|
|
@@ -651,6 +663,8 @@ export interface VerifyReport {
|
|
|
651
663
|
/** Every failing check, flattened, each tagged with its `case`. */
|
|
652
664
|
failures: Array<VerifyCheck & { case: string }>;
|
|
653
665
|
warnings: Array<VerifyCheck & { case: string }>;
|
|
666
|
+
/** Design choices with a price (supports, footprint); never failures. Accepted ones are flagged. */
|
|
667
|
+
costs: Array<VerifyCheck & { case: string }>;
|
|
654
668
|
/** Checks a quick lap could not evaluate. */
|
|
655
669
|
unevaluated: Array<VerifyCheck & { case: string }>;
|
|
656
670
|
/** Check instances the part or its profile declared, across cases (near-miss notices excluded). */
|