@cutoptim/engine 1.0.0 → 1.3.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/dist/types.gen.d.ts +49 -0
- package/dist/types.gen.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/types.gen.d.ts
CHANGED
|
@@ -503,6 +503,36 @@ export interface Part1D {
|
|
|
503
503
|
material?: string;
|
|
504
504
|
/** Opaque JSON object (any keys) echoed back VERBATIM on the matching output (a part's meta on every placed piece of it; a stock row's meta on every sheet/rod cut from it). Attach ERP article numbers, order-line ids, customer refs to reconcile the cut plan with your system. Never parsed, never affects placement. Part meta follows its request row: the meta of each row lands on exactly its qty of placed pieces, even when rows share a name; stock meta by stock-row order. */
|
|
505
505
|
meta?: Record<string, unknown>;
|
|
506
|
+
ends?: MitreEnds;
|
|
507
|
+
/** Mitre pairing only: which 180° turns of the part on the bar are allowed, so its angled end can meet a neighbour's. `none` (default — a profiled moulding or one-sided stock), `face` (end for end, the crown or top edge stays up — roof members), `edge` (end for end over the edge — flat stock, frames), `any`. */
|
|
508
|
+
flip?: "none" | "face" | "edge" | "any";
|
|
509
|
+
/** Mitre pairing only: the side of the bar the `angle` of `ends` is seen on. Required with `ends` (a 1D part has no cross-section to take it from). Unit-agnostic: pick one unit (mm, inch, …) for every length in the request and every length in the response is in that same unit. Nothing is converted server-side. */
|
|
510
|
+
depth?: number;
|
|
511
|
+
/** Mitre pairing only: the other side, the one the `bevel` is seen on. Required with `ends`. Unit-agnostic: pick one unit (mm, inch, …) for every length in the request and every length in the response is in that same unit. Nothing is converted server-side. */
|
|
512
|
+
thickness?: number;
|
|
513
|
+
}
|
|
514
|
+
/** One end cut of a part, in degrees from square (0 = a square end), signed. The part is measured long point to long point (`length` is its overall length). A part whose two end cuts would cross inside its section (shorter than its leads) cannot be made: a 400 `invalid_request` naming `parts[i].ends` says how long it must at least be. */
|
|
515
|
+
export interface EndCut {
|
|
516
|
+
/** The face angle: the mitre or plumb cut as seen on the `depth` side (wood: on `sh` as entered). */
|
|
517
|
+
angle: number;
|
|
518
|
+
/** The edge angle: the bevel as seen on the `thickness` side (wood: on `sw` as entered). A compound cut has both. */
|
|
519
|
+
bevel?: number;
|
|
520
|
+
}
|
|
521
|
+
/** The angled ends of a part, read only with `options.mitrePairing`. Two parts of one section whose facing ends lie in one plane (after a turn `flip` allows) can be cut with ONE saw cut between them: the triangle between the long and the short point is not wasted. Without `mitrePairing` the ends are not used (a warning says so) and the part packs as its `length`. */
|
|
522
|
+
export interface MitreEnds {
|
|
523
|
+
start?: EndCut;
|
|
524
|
+
end?: EndCut;
|
|
525
|
+
}
|
|
526
|
+
/** This part's far end is ONE saw cut shared with the next part on the bar. The next part starts at `pos + length − lead + kerfAlongAxis` computed from the rounded values shown (not one kerf after `pos + length`), and the shared wood is counted once in `yieldPct`. */
|
|
527
|
+
export interface SharedCut {
|
|
528
|
+
/** Face angle of the cut in degrees, as the part lies on the bar. */
|
|
529
|
+
angle: number;
|
|
530
|
+
/** Edge angle of the cut in degrees, as the part lies on the bar (0 = none). */
|
|
531
|
+
bevel: number;
|
|
532
|
+
/** The kerf measured along the bar: an angled blade removes more length than its width. Unit-agnostic: pick one unit (mm, inch, …) for every length in the request and every length in the response is in that same unit. Nothing is converted server-side. */
|
|
533
|
+
kerfAlongAxis: number;
|
|
534
|
+
/** Distance along the bar between the cut's long point and short point. Unit-agnostic: pick one unit (mm, inch, …) for every length in the request and every length in the response is in that same unit. Nothing is converted server-side. */
|
|
535
|
+
lead: number;
|
|
506
536
|
}
|
|
507
537
|
export interface Stock1D {
|
|
508
538
|
/** Bar length. Unit-agnostic: pick one unit (mm, inch, …) for every length in the request and every length in the response is in that same unit. Nothing is converted server-side. */
|
|
@@ -538,6 +568,8 @@ export interface Options1D {
|
|
|
538
568
|
respectStock?: boolean;
|
|
539
569
|
/** Output filter: report a leftover only if it is at least this long. */
|
|
540
570
|
minOffcut?: number;
|
|
571
|
+
/** Pair parts of one section whose facing ends (`parts[].ends`) can share ONE saw cut. Off by default: a request without it is solved exactly as before. On, a plan with pairs is returned only when it ranks strictly better than the unpaired plan by the packer's own ranking (parts placed first, then material — or price with `minimizeCost`); otherwise the unpaired plan comes back. Pairs only, no chains of three or more. */
|
|
572
|
+
mitrePairing?: boolean;
|
|
541
573
|
}
|
|
542
574
|
export interface Optimize1DRequest {
|
|
543
575
|
parts: Array<Part1D>;
|
|
@@ -566,6 +598,10 @@ export interface PartWood {
|
|
|
566
598
|
material?: string;
|
|
567
599
|
/** Opaque JSON object (any keys) echoed back VERBATIM on the matching output (a part's meta on every placed piece of it; a stock row's meta on every sheet/rod cut from it). Attach ERP article numbers, order-line ids, customer refs to reconcile the cut plan with your system. Never parsed, never affects placement. Part meta follows its request row: the meta of each row lands on exactly its qty of placed pieces, even when rows share a name; stock meta by stock-row order. */
|
|
568
600
|
meta?: Record<string, unknown>;
|
|
601
|
+
/** Angled ends (mitre pairing). The `angle` is seen on `sh` AS ENTERED and the `bevel` on `sw`, so send the section the way the angles were measured. */
|
|
602
|
+
ends?: MitreEnds;
|
|
603
|
+
/** Mitre pairing only: which 180° turns of the part on the bar are allowed, so its angled end can meet a neighbour's. `none` (default — a profiled moulding or one-sided stock), `face` (end for end, the crown or top edge stays up — roof members), `edge` (end for end over the edge — flat stock, frames), `any`. */
|
|
604
|
+
flip?: "none" | "face" | "edge" | "any";
|
|
569
605
|
}
|
|
570
606
|
export interface StockWood {
|
|
571
607
|
/** Optional stock label, echoed back as `sections[].stockName` so a plan can name the material an operator has to fetch. */
|
|
@@ -600,6 +636,8 @@ export interface OptionsWood {
|
|
|
600
636
|
respectStock?: boolean;
|
|
601
637
|
/** Output filter: report a leftover only if it is at least this long. */
|
|
602
638
|
minOffcut?: number;
|
|
639
|
+
/** Pair parts of one section whose facing ends (`parts[].ends`) can share ONE saw cut. Off by default: a request without it is solved exactly as before. On, a plan with pairs is returned only when it ranks strictly better than the unpaired plan by the packer's own ranking (parts placed first, then material — or price with `minimizeCost`); otherwise the unpaired plan comes back. Pairs only, no chains of three or more. */
|
|
640
|
+
mitrePairing?: boolean;
|
|
603
641
|
}
|
|
604
642
|
export interface OptimizeWoodRequest {
|
|
605
643
|
parts: Array<PartWood>;
|
|
@@ -625,6 +663,10 @@ export interface CutStep {
|
|
|
625
663
|
length: number;
|
|
626
664
|
/** 1-based machine pass. Starts at 1 and increments ONLY when the axis flips relative to the parent cut, so ripping a board into six strips is one stage and crosscutting them is the next. This is the panel-saw sense of "3-stage cutting", not tree depth, and it is what `options.maxCutStages` constrains. */
|
|
627
665
|
stage: number;
|
|
666
|
+
/** 1D/wood with `options.mitrePairing` only: the face angle in degrees of an ANGLED cut, as the part lies on the bar — a shared cut (between a part with `sharedCut` and the next one) or an end of a part with `ends` that no neighbour shares. A part's angled start, or a square start right after an angled end, is a saw pass of its own: a HEAD step at that part's `pos`, before its far step (so `metrics.cuts` can exceed `placed`). A far step's `pos` is the long point of the part it frees (`pos + length`). Absent on every square cut. */
|
|
667
|
+
angle?: number;
|
|
668
|
+
/** Comes with `angle`: the edge angle of that cut in degrees (0 = none). */
|
|
669
|
+
bevel?: number;
|
|
628
670
|
}
|
|
629
671
|
/** A part on a board. `x`/`y` is its top-left corner measured from the top-left corner of the sheet, `x` growing right and `y` growing downward. */
|
|
630
672
|
export interface PlacedPart2D {
|
|
@@ -877,6 +919,9 @@ export interface PlacedPart1D {
|
|
|
877
919
|
length: number;
|
|
878
920
|
/** Opaque JSON object (any keys) echoed back VERBATIM on the matching output (a part's meta on every placed piece of it; a stock row's meta on every sheet/rod cut from it). Attach ERP article numbers, order-line ids, customer refs to reconcile the cut plan with your system. Never parsed, never affects placement. Part meta follows its request row: the meta of each row lands on exactly its qty of placed pieces, even when rows share a name; stock meta by stock-row order. */
|
|
879
921
|
meta?: Record<string, unknown>;
|
|
922
|
+
sharedCut?: SharedCut;
|
|
923
|
+
/** Mitre pairing only: the part lies turned on the bar so its end meets its neighbour's — `face` end for end (crown kept up), `edge` end for end over the edge, `roll` rolled about its axis. Absent = as entered. */
|
|
924
|
+
flipped?: "face" | "edge" | "roll";
|
|
880
925
|
}
|
|
881
926
|
export interface Rod {
|
|
882
927
|
/** FULL bar length as supplied in `stock`. */
|
|
@@ -909,6 +954,8 @@ export interface Metrics1D {
|
|
|
909
954
|
totalPrice: number;
|
|
910
955
|
/** How many pieces fitted only because `options.tolerance` allowed an overshoot. */
|
|
911
956
|
toleranceAcceptedCount: number;
|
|
957
|
+
/** Present only with `options.mitrePairing`: how many cuts in the plan are shared by two parts (`sharedCut`). */
|
|
958
|
+
sharedCuts?: number;
|
|
912
959
|
}
|
|
913
960
|
export interface Unplaced1D {
|
|
914
961
|
/** The part name. */
|
|
@@ -1028,6 +1075,8 @@ export interface MetricsWood {
|
|
|
1028
1075
|
totalPrice: number;
|
|
1029
1076
|
/** How many pieces fitted only because `options.tolerance` allowed an overshoot. */
|
|
1030
1077
|
toleranceAcceptedCount: number;
|
|
1078
|
+
/** Present only with `options.mitrePairing`: how many cuts in the plan are shared by two parts (`sharedCut`). */
|
|
1079
|
+
sharedCuts?: number;
|
|
1031
1080
|
}
|
|
1032
1081
|
export interface OptimizeWoodResponse {
|
|
1033
1082
|
engine: "heuristic" | "balanced";
|
package/dist/types.gen.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// GENERATED by scripts/gen-sdks.ts from the CutOptim Engine API OpenAPI document — DO NOT EDIT.
|
|
2
|
-
// contract 1 · spec sha256
|
|
2
|
+
// contract 1 · spec sha256 e29a45d3c07667cf676ceb46a7c24ec3203683e50f72ba25f0677ac4af140c71 · @cutoptim/engine 1.3.0
|
|
3
3
|
export {};
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.3.0";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// The package version — rewritten by scripts/gen-sdks.ts together with package.json (sent as the User-Agent).
|
|
2
|
-
export const VERSION = '1.
|
|
2
|
+
export const VERSION = '1.3.0';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cutoptim/engine",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Official client for the CutOptim Engine API — cutting optimization (2D panels, 1D linear, timber, true-shape nesting) over HTTPS.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "CutOptim <support@cutoptim.com>",
|