any2orca 0.12.1 → 0.14.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/CHANGELOG.md +20 -0
- package/README.md +7 -2
- package/dist/archive/meshPaint.d.ts +25 -0
- package/dist/archive/meshPaint.js +136 -0
- package/dist/archive/objectWorldBboxXY.d.ts +19 -1
- package/dist/archive/objectWorldBboxXY.js +32 -8
- package/dist/archive/paintColor.d.ts +21 -0
- package/dist/archive/paintColor.js +88 -0
- package/dist/archive/plateFilaments.d.ts +65 -0
- package/dist/archive/plateFilaments.js +363 -0
- package/dist/cli/commands/convert.d.ts +10 -0
- package/dist/cli/commands/convert.js +83 -19
- package/dist/cli/commands/inspect.d.ts +17 -0
- package/dist/cli/commands/inspect.js +75 -0
- package/dist/cli/main.js +43 -1
- package/dist/cli/surface.d.ts +29 -0
- package/dist/cli/surface.js +6 -0
- package/dist/engine/carrySourceLayerHeight.js +2 -2
- package/dist/engine/runConvertPipeline.d.ts +9 -2
- package/dist/engine/runConvertPipeline.js +24 -6
- package/dist/explain/filamentNotes.d.ts +17 -1
- package/dist/explain/filamentNotes.js +28 -12
- package/dist/explain/notes.d.ts +40 -0
- package/dist/explain/notes.js +74 -0
- package/dist/explain/plateNotes.d.ts +32 -0
- package/dist/explain/plateNotes.js +89 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.js +4 -1
- package/dist/inspect.d.ts +9 -1
- package/dist/inspect.js +2 -1
- package/dist/problemReport.d.ts +68 -0
- package/dist/problemReport.js +312 -0
- package/dist/profiles.d.ts +12 -0
- package/dist/profiles.js +18 -1
- package/dist/project.d.ts +31 -8
- package/dist/project.js +91 -48
- package/dist/sources/bambuFamily.js +6 -1
- package/dist/sources/prusa/prusa.js +6 -1
- package/dist/sources/reader.d.ts +6 -0
- package/dist/version.js +1 -1
- package/package.json +2 -2
package/dist/cli/main.js
CHANGED
|
@@ -8,8 +8,9 @@ import { loadCatalog } from "../profiles.js";
|
|
|
8
8
|
import { VERSION } from "../version.js";
|
|
9
9
|
import { MAX_UNPACKED_BYTES_LIMIT } from "../archive/safeUnzip.js";
|
|
10
10
|
import { runConvert, runWatch } from "./commands/convert.js";
|
|
11
|
-
import { CONVERT_OPTIONS, DIFF_OPTIONS, PRESETS_OPTIONS, PROFILES_OPTIONS } from "./surface.js";
|
|
11
|
+
import { CONVERT_OPTIONS, DIFF_OPTIONS, INSPECT_OPTIONS, PRESETS_OPTIONS, PROFILES_OPTIONS } from "./surface.js";
|
|
12
12
|
import { runDiff } from "./commands/diff.js";
|
|
13
|
+
import { runInspect } from "./commands/inspect.js";
|
|
13
14
|
import { presetForConvert, presetForDiff, runPresetsAdd, runPresetsExport, runPresetsImport, runPresetsList, runPresetsRemove, runPresetsShow, } from "./commands/presets.js";
|
|
14
15
|
import { resolveAboveStockChoice } from "../engine/aboveStock.js";
|
|
15
16
|
import { runProfiles } from "./commands/profiles.js";
|
|
@@ -55,6 +56,7 @@ Commands:
|
|
|
55
56
|
${formatOptions([
|
|
56
57
|
["convert <files...>", "Convert one or more .3mf files (or bundle .zip files of several)"],
|
|
57
58
|
["diff <a.3mf> <b.3mf>", "Compare the settings of two projects, or one with Snapmaker's stock profile"],
|
|
59
|
+
["inspect <file.3mf>", "Show what a project holds: its printer, filaments, and each plate's objects and filaments"],
|
|
58
60
|
["presets add | list | show | ...", "Save your own tuned print settings from a 3MF and convert with them"],
|
|
59
61
|
["profiles", "List the profiles convert can use"],
|
|
60
62
|
["nozzle [<size> | match | clear]", "Say which nozzle size your U1 has (default 0.4 mm), for every conversion"],
|
|
@@ -105,6 +107,28 @@ marked "above the U1's limit (capped)", and one above Snapmaker's stock value
|
|
|
105
107
|
|
|
106
108
|
Exit codes: 0 no differences, 1 differences, 2 an error.
|
|
107
109
|
`;
|
|
110
|
+
const INSPECT_HELP = `Usage: any2orca inspect <file.3mf> [options]
|
|
111
|
+
|
|
112
|
+
Shows what a project holds, read the way convert reads it, without converting
|
|
113
|
+
or writing anything: the printer and slicer version it was saved for, its
|
|
114
|
+
process preset, nozzle size and layer height, every filament, and each plate's
|
|
115
|
+
objects and the filaments it uses (by its objects, parts, paint, a filament set
|
|
116
|
+
for a range of heights, supports, or a tool change at a layer), with the heights
|
|
117
|
+
each is used between. The U1 prints with four filaments at a time, so a plate's
|
|
118
|
+
line also says how many it needs at the same height when that is fewer than it
|
|
119
|
+
uses; that number is an estimate from the model, not a slice.
|
|
120
|
+
|
|
121
|
+
It reads source projects and converted ones alike.
|
|
122
|
+
|
|
123
|
+
Options:
|
|
124
|
+
${formatOptions([
|
|
125
|
+
["--json", "Print the whole reading as JSON (format any2orca-inspect, version 1), every object with its plate and footprint included"],
|
|
126
|
+
["--max-unpacked <size>", "The most the project may unpack to, e.g. 4GB or 3000MB (default 2GB, at most 16GB)"],
|
|
127
|
+
["-h, --help", "Show this help"],
|
|
128
|
+
])}
|
|
129
|
+
|
|
130
|
+
Exit codes: 0 read, 2 a file that can't be read or a usage error.
|
|
131
|
+
`;
|
|
108
132
|
const PROFILES_HELP = `Usage: any2orca profiles [options]
|
|
109
133
|
|
|
110
134
|
Lists the profiles "convert --profile <id>" accepts, and the Snapmaker Orca
|
|
@@ -215,6 +239,7 @@ ${formatOptions([
|
|
|
215
239
|
["--explain", "After each file, list what the conversion changed, grouped by why: from the creator's file, kept at Snapmaker's stock value, capped for the U1, set for the firmware, layout, and your choices"],
|
|
216
240
|
["--explain-json", "Also write that, with every settings difference, to <output>.what-changed.json next to each output (format any2orca-what-changed)"],
|
|
217
241
|
["--max-unpacked <size>", "The most a project may unpack to, e.g. 4GB or 3000MB (default 2GB, at most 16GB). For a very large project; it needs about twice that much memory"],
|
|
242
|
+
["--report", "After each file, print a problem report to copy into a bug report: versions, where it ran, what the project is (slicer, printer, filaments, plates), the options, the result or the error's code, and the notes. Text only, nothing is sent; it holds no file name, object names or paths"],
|
|
218
243
|
["--no-stamp", "Leave the small version note (Metadata/any2orca.json) out of the converted file. The note says which any2orca version, profile catalog and options made the file, so it can be traced if a bug turns up; it holds no file names, paths, times or identifiers. The file works the same without it"],
|
|
219
244
|
["--out-dir <dir>", "Write outputs here instead of next to each input (created if missing)"],
|
|
220
245
|
["--suffix <text>", 'Output filename suffix (default "_U1"; "" removes it, refused if the output would overwrite the input)'],
|
|
@@ -322,6 +347,22 @@ async function runCommand(command, rest, io) {
|
|
|
322
347
|
return 2;
|
|
323
348
|
}
|
|
324
349
|
}
|
|
350
|
+
case "inspect": {
|
|
351
|
+
if (hasHelpFlag(rest)) {
|
|
352
|
+
io.out(INSPECT_HELP);
|
|
353
|
+
return 0;
|
|
354
|
+
}
|
|
355
|
+
try {
|
|
356
|
+
const { values, positionals } = parseArgs({ args: rest, allowPositionals: true, options: INSPECT_OPTIONS });
|
|
357
|
+
if (positionals.length !== 1)
|
|
358
|
+
throw new Error("Usage: any2orca inspect <file.3mf> [--json] (see: any2orca inspect --help)");
|
|
359
|
+
return runInspect({ file: positionals[0], json: Boolean(values.json), ...(values["max-unpacked"] !== undefined ? { maxUnpackedBytes: parseMaxUnpacked(values["max-unpacked"]) } : {}) }, io.out);
|
|
360
|
+
}
|
|
361
|
+
catch (err) {
|
|
362
|
+
io.err(`Error: ${describeFsError(err)}`);
|
|
363
|
+
return 2;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
325
366
|
case "presets": {
|
|
326
367
|
const [sub, ...args] = rest;
|
|
327
368
|
if (!sub || hasHelpFlag(rest)) {
|
|
@@ -487,6 +528,7 @@ async function runCommand(command, rest, io) {
|
|
|
487
528
|
...(values["max-unpacked"] !== undefined ? { maxUnpackedBytes: parseMaxUnpacked(values["max-unpacked"]) } : {}),
|
|
488
529
|
explain: Boolean(values.explain),
|
|
489
530
|
explainJson: Boolean(values["explain-json"]),
|
|
531
|
+
report: Boolean(values.report),
|
|
490
532
|
outDir: values["out-dir"],
|
|
491
533
|
archiveDir: values["archive-dir"],
|
|
492
534
|
suffix: values.suffix ?? "_U1",
|
package/dist/cli/surface.d.ts
CHANGED
|
@@ -58,6 +58,15 @@ export declare const PRESETS_OPTIONS: {
|
|
|
58
58
|
readonly type: "string";
|
|
59
59
|
};
|
|
60
60
|
};
|
|
61
|
+
export declare const INSPECT_OPTIONS: {
|
|
62
|
+
readonly json: {
|
|
63
|
+
readonly type: "boolean";
|
|
64
|
+
readonly default: false;
|
|
65
|
+
};
|
|
66
|
+
readonly "max-unpacked": {
|
|
67
|
+
readonly type: "string";
|
|
68
|
+
};
|
|
69
|
+
};
|
|
61
70
|
export declare const PROFILES_OPTIONS: {
|
|
62
71
|
readonly "profiles-dir": {
|
|
63
72
|
readonly type: "string";
|
|
@@ -136,6 +145,10 @@ export declare const CONVERT_OPTIONS: {
|
|
|
136
145
|
readonly type: "boolean";
|
|
137
146
|
readonly default: false;
|
|
138
147
|
};
|
|
148
|
+
readonly report: {
|
|
149
|
+
readonly type: "boolean";
|
|
150
|
+
readonly default: false;
|
|
151
|
+
};
|
|
139
152
|
readonly "out-dir": {
|
|
140
153
|
readonly type: "string";
|
|
141
154
|
};
|
|
@@ -242,6 +255,10 @@ export declare const CLI_SURFACE: {
|
|
|
242
255
|
readonly type: "boolean";
|
|
243
256
|
readonly default: false;
|
|
244
257
|
};
|
|
258
|
+
readonly report: {
|
|
259
|
+
readonly type: "boolean";
|
|
260
|
+
readonly default: false;
|
|
261
|
+
};
|
|
245
262
|
readonly "out-dir": {
|
|
246
263
|
readonly type: "string";
|
|
247
264
|
};
|
|
@@ -309,6 +326,18 @@ export declare const CLI_SURFACE: {
|
|
|
309
326
|
};
|
|
310
327
|
};
|
|
311
328
|
};
|
|
329
|
+
readonly inspect: {
|
|
330
|
+
readonly positionals: "<file.3mf>";
|
|
331
|
+
readonly options: {
|
|
332
|
+
readonly json: {
|
|
333
|
+
readonly type: "boolean";
|
|
334
|
+
readonly default: false;
|
|
335
|
+
};
|
|
336
|
+
readonly "max-unpacked": {
|
|
337
|
+
readonly type: "string";
|
|
338
|
+
};
|
|
339
|
+
};
|
|
340
|
+
};
|
|
312
341
|
readonly presets: {
|
|
313
342
|
readonly subcommands: readonly ["add", "list", "show", "remove", "export", "import"];
|
|
314
343
|
readonly options: {
|
package/dist/cli/surface.js
CHANGED
|
@@ -27,6 +27,10 @@ export const PRESETS_OPTIONS = {
|
|
|
27
27
|
out: { type: "string" },
|
|
28
28
|
...PROFILE_OPTIONS,
|
|
29
29
|
};
|
|
30
|
+
export const INSPECT_OPTIONS = {
|
|
31
|
+
json: { type: "boolean", default: false },
|
|
32
|
+
"max-unpacked": { type: "string" },
|
|
33
|
+
};
|
|
30
34
|
export const PROFILES_OPTIONS = {
|
|
31
35
|
nozzle: { type: "string" },
|
|
32
36
|
...PROFILE_OPTIONS,
|
|
@@ -47,6 +51,7 @@ export const CONVERT_OPTIONS = {
|
|
|
47
51
|
"max-unpacked": { type: "string" },
|
|
48
52
|
explain: { type: "boolean", default: false },
|
|
49
53
|
"explain-json": { type: "boolean", default: false },
|
|
54
|
+
report: { type: "boolean", default: false },
|
|
50
55
|
"out-dir": { type: "string" },
|
|
51
56
|
suffix: { type: "string", default: "_U1" },
|
|
52
57
|
"dry-run": { type: "boolean", default: false },
|
|
@@ -67,6 +72,7 @@ export const CLI_SURFACE = {
|
|
|
67
72
|
convert: { positionals: "<files...>", options: CONVERT_OPTIONS },
|
|
68
73
|
// --against-stock takes an optional value, so main.ts reads it before parseArgs.
|
|
69
74
|
diff: { positionals: "<a.3mf> [<b.3mf>]", options: { ...DIFF_OPTIONS, "against-stock": { type: "string", optionalValue: true } } },
|
|
75
|
+
inspect: { positionals: "<file.3mf>", options: INSPECT_OPTIONS },
|
|
70
76
|
presets: { subcommands: ["add", "list", "show", "remove", "export", "import"], options: PRESETS_OPTIONS },
|
|
71
77
|
profiles: { options: PROFILES_OPTIONS },
|
|
72
78
|
// `any2orca nozzle 0.6` saves the size; a size is a value, not a subcommand, so it isn't listed as one.
|
|
@@ -36,6 +36,6 @@ export function carrySourceLayerHeight(settings, sourceSettings, machineSettings
|
|
|
36
36
|
return;
|
|
37
37
|
settings.layer_height = String(kept);
|
|
38
38
|
warnings.push(kept === source
|
|
39
|
-
? ` WARN: the U1 has no ${source}mm profile for this nozzle size, so your file's ${source}mm layer height was kept, on the closest profile (${tier}mm).`
|
|
40
|
-
: ` WARN: your file's ${source}mm layer height is outside what the U1 supports for this nozzle size, so it was set to ${kept}mm, on the closest profile (${tier}mm).`);
|
|
39
|
+
? ` WARN: the U1 has no ${source} mm profile for this nozzle size, so your file's ${source} mm layer height was kept, on the closest profile (${tier} mm).`
|
|
40
|
+
: ` WARN: your file's ${source} mm layer height is outside what the U1 supports for this nozzle size, so it was set to ${kept} mm, on the closest profile (${tier} mm).`);
|
|
41
41
|
}
|
|
@@ -4,6 +4,7 @@ import type { PrinterFilamentPresets } from "../profiles.js";
|
|
|
4
4
|
import { type ResolvedAboveStockChoice } from "./aboveStock.js";
|
|
5
5
|
import type { JsonRecord } from "./types.js";
|
|
6
6
|
import { type ChangeItem, type ChangeReason } from "../explain/whatChanged.js";
|
|
7
|
+
import { type ConvertNote } from "../explain/notes.js";
|
|
7
8
|
/**
|
|
8
9
|
* Everything the pipeline needs to know about a printer + profile,
|
|
9
10
|
* independent of where it came from (the profile catalog, or a fixture
|
|
@@ -55,10 +56,12 @@ export interface RunConvertPipelineOptions {
|
|
|
55
56
|
*/
|
|
56
57
|
aboveStock?: ResolvedAboveStockChoice;
|
|
57
58
|
/**
|
|
58
|
-
* The nozzle size the file is for
|
|
59
|
-
* item when they differ. Absent when
|
|
59
|
+
* The nozzle size the file is for, how it was chosen ("match" for the creator's size) and the sizes the creator's
|
|
60
|
+
* project uses (see matchProfile), for a What changed item and the notes' wording when they differ. Absent when
|
|
61
|
+
* the profile was given outright.
|
|
60
62
|
*/
|
|
61
63
|
nozzle?: {
|
|
64
|
+
choice?: string;
|
|
62
65
|
size: string;
|
|
63
66
|
sourceSizes: readonly string[];
|
|
64
67
|
};
|
|
@@ -73,6 +76,10 @@ export interface RunConvertPipelineResult {
|
|
|
73
76
|
warnings: string[];
|
|
74
77
|
/** Notes to show before every other: a filament the creator's printer took at another diameter. Also in `warnings`. */
|
|
75
78
|
leadWarnings: string[];
|
|
79
|
+
/** The lead warnings with their topic and slots (1-based), for `report.notes`. */
|
|
80
|
+
leadNotes: ConvertNote[];
|
|
81
|
+
/** The warnings about placing objects on the U1's plates (in `warnings` too), for `report.notes`. */
|
|
82
|
+
plateWarnings: string[];
|
|
76
83
|
/** What the conversion changed, grouped by why (see explain/whatChanged.ts). */
|
|
77
84
|
changes: ReadonlyMap<ChangeReason, ChangeItem[]>;
|
|
78
85
|
}
|
|
@@ -21,6 +21,7 @@ import { offSizeDiameter, setFilamentDiameter, U1_FILAMENT_DIAMETER } from "./se
|
|
|
21
21
|
import { remapBrimType } from "./remapBrimType.js";
|
|
22
22
|
import { resizeFlushVolumes } from "./resizeFlushVolumes.js";
|
|
23
23
|
import { ChangeTracker, valueText } from "../explain/whatChanged.js";
|
|
24
|
+
import { noteFrom } from "../explain/notes.js";
|
|
24
25
|
import { isGcodeKey, isSpoolKey, U1_VALUE_KEYS } from "./policy.js";
|
|
25
26
|
const U1_VALUE_KEY_SET = new Set(U1_VALUE_KEYS);
|
|
26
27
|
function numbers(value) {
|
|
@@ -78,6 +79,7 @@ export function runConvertPipeline(profile, request, application, options = {})
|
|
|
78
79
|
const sourceSlots = slots;
|
|
79
80
|
const offSizeSlots = new Set(slots.flatMap((slot, i) => (offSizeDiameter(slot.filament_diameter ?? filamentKeyArrays?.filament_diameter?.[i]) === null ? [] : [i])));
|
|
80
81
|
const leadWarnings = [];
|
|
82
|
+
const leadNotes = [];
|
|
81
83
|
// What changed items for those slots, added under the firmware group once the tracker exists.
|
|
82
84
|
const offSizeItems = [];
|
|
83
85
|
const missingPresetsWarning = (missing) => warnings.push(` WARN: the profile catalog has no settings for ${missing.join(", ")}, so only ${missing.length === 1 ? "its name" : "their names"} changed. Update the profile catalog.`);
|
|
@@ -118,12 +120,18 @@ export function runConvertPipeline(profile, request, application, options = {})
|
|
|
118
120
|
const renamedTo = renamedFilaments.find((r) => r.slot === i)?.after ?? (typeof slots[i]?.filament_settings_id === "string" && slots[i].filament_settings_id !== name ? String(slots[i].filament_settings_id) : null);
|
|
119
121
|
const withSettings = appliedPresets.some((a) => a.slot === i);
|
|
120
122
|
const was = `Filament ${i + 1} was ${name} (${diameter} mm) on the creator's printer. The U1 takes ${U1_FILAMENT_DIAMETER} mm filament, so`;
|
|
123
|
+
const lead = (text) => {
|
|
124
|
+
leadWarnings.push(text);
|
|
125
|
+
const note = noteFrom("filament-diameter", text, [i + 1]);
|
|
126
|
+
if (note)
|
|
127
|
+
leadNotes.push(note);
|
|
128
|
+
};
|
|
121
129
|
if (renamedTo) {
|
|
122
|
-
|
|
130
|
+
lead(` WARN: ${was} it's set to ${renamedTo}${withSettings ? " with that preset's settings" : ""}. Load ${U1_FILAMENT_DIAMETER} mm ${type}; the creator's filament may print differently from the preset's, so check its settings before printing.`);
|
|
123
131
|
offSizeItems.push({ label: `Filament ${i + 1} set to ${renamedTo}`, before: `${name} (${diameter} mm)`, after: renamedTo, note: `the U1 takes ${U1_FILAMENT_DIAMETER} mm filament; the creator's values were for ${diameter} mm${withSettings ? "; the preset's settings are used" : ""}` });
|
|
124
132
|
}
|
|
125
133
|
else {
|
|
126
|
-
|
|
134
|
+
lead(` WARN: ${was} its diameter is set to ${U1_FILAMENT_DIAMETER} mm. No U1 preset fits its material, so its other settings are the creator's, tuned for ${diameter} mm; load ${U1_FILAMENT_DIAMETER} mm ${type} and check them before printing.`);
|
|
127
135
|
}
|
|
128
136
|
}
|
|
129
137
|
// A filament tuned for another nozzle size than the file is for: its flow, max volumetric speed, pressure
|
|
@@ -166,13 +174,21 @@ export function runConvertPipeline(profile, request, application, options = {})
|
|
|
166
174
|
const n = nums.map((i) => String(i + 1));
|
|
167
175
|
return n.length === 1 ? `Filament ${n[0]} was` : `Filaments ${n.slice(0, -1).join(", ")} and ${n[n.length - 1]} were`;
|
|
168
176
|
};
|
|
177
|
+
// Under "match" the size is the closest U1 profile's, not the user's choice.
|
|
178
|
+
const forSize = options.nozzle?.choice === "match" ? `converted with the U1's ${options.targetNozzleDiameter} mm profile` : `converted for your ${options.targetNozzleDiameter} mm nozzles`;
|
|
179
|
+
const lead = (text, slots) => {
|
|
180
|
+
leadWarnings.push(text);
|
|
181
|
+
const note = noteFrom("nozzle", text, slots.map((i) => i + 1));
|
|
182
|
+
if (note)
|
|
183
|
+
leadNotes.push(note);
|
|
184
|
+
};
|
|
169
185
|
for (const [size, group] of [...bySize].sort((a, b) => Number(a[0]) - Number(b[0]))) {
|
|
170
186
|
const taken = group.slots.filter((i) => !group.unmatched.includes(i));
|
|
171
187
|
if (taken.length > 0) {
|
|
172
|
-
|
|
188
|
+
lead(` WARN: ${listed(taken)} tuned for a ${size} mm nozzle on the creator's printer; ${forSize}, ${taken.length === 1 ? "it takes" : "they take"} the U1's calibration for ${taken.length === 1 ? "its material" : "their materials"} from ${[...group.presets].join(", ")} (flow, max volumetric speed, pressure advance, retraction, cooling) and ${taken.length === 1 ? "keeps" : "keep"} the creator's temperatures and other filament facts. The colors are unchanged, so a preset of your own can be chosen in Snapmaker Orca.`, taken);
|
|
173
189
|
}
|
|
174
190
|
if (group.unmatched.length > 0) {
|
|
175
|
-
|
|
191
|
+
lead(` WARN: ${listed(group.unmatched)} tuned for a ${size} mm nozzle on the creator's printer, and no U1 preset fits ${group.unmatched.length === 1 ? "its" : "their"} material, so the settings are the creator's; check them before printing on ${options.nozzle?.choice === "match" ? "" : "your "}${options.targetNozzleDiameter} mm nozzles.`, group.unmatched);
|
|
176
192
|
}
|
|
177
193
|
}
|
|
178
194
|
}
|
|
@@ -196,7 +212,7 @@ export function runConvertPipeline(profile, request, application, options = {})
|
|
|
196
212
|
const highFlowSelection = resolveHighFlowSelection(request.highFlowHotends, toolheads);
|
|
197
213
|
const highFlowApplies = highFlowSelection !== null && printer.highFlowSupported === true;
|
|
198
214
|
if (highFlowSelection !== null && !highFlowApplies) {
|
|
199
|
-
warnings.push(" WARN: high-flow hotends were requested, but Snapmaker has no high-flow option for this nozzle size (only 0.
|
|
215
|
+
warnings.push(" WARN: high-flow hotends were requested, but Snapmaker has no high-flow option for this nozzle size (only 0.4 mm), so the project is set up for standard hotends.");
|
|
200
216
|
}
|
|
201
217
|
const highFlowValues = highFlowApplies ? (p.highFlowOverrides ?? {}) : {};
|
|
202
218
|
const highFlowTuning = Object.keys(highFlowValues).length > 0
|
|
@@ -313,7 +329,7 @@ export function runConvertPipeline(profile, request, application, options = {})
|
|
|
313
329
|
if (options.nozzle && options.nozzle.sourceSizes.some((s) => s !== options.nozzle.size)) {
|
|
314
330
|
const sizes = options.nozzle.sourceSizes;
|
|
315
331
|
tracker.add("yours", {
|
|
316
|
-
label: `Converted for your ${options.nozzle.size} mm nozzles`,
|
|
332
|
+
label: options.nozzle.choice === "match" ? `Converted for ${options.nozzle.size} mm nozzles` : `Converted for your ${options.nozzle.size} mm nozzles`,
|
|
317
333
|
before: sizes.length > 0 ? `${sizes.join(", ")} mm` : null,
|
|
318
334
|
after: `${options.nozzle.size} mm`,
|
|
319
335
|
note: sizes.length > 1 ? "the creator's project mixes nozzle sizes; Snapmaker Orca allows one for all four toolheads" : "the creator's project is set up for another nozzle size",
|
|
@@ -379,6 +395,8 @@ export function runConvertPipeline(profile, request, application, options = {})
|
|
|
379
395
|
},
|
|
380
396
|
warnings,
|
|
381
397
|
leadWarnings,
|
|
398
|
+
leadNotes,
|
|
399
|
+
plateWarnings: shiftWarnings.filter((w) => w.includes("WARN")),
|
|
382
400
|
changes: tracker.build(request.projectSettings, p.baselineProjectSettings, newSettings, (key) => {
|
|
383
401
|
if (U1_VALUE_KEY_SET.has(key))
|
|
384
402
|
return "always the U1's own value";
|
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
import type { ConvertReport } from "../project.js";
|
|
2
|
+
/** The parts of a report the filament naming option's notes are made from. */
|
|
3
|
+
export type NotesReport = Pick<ConvertReport, "filamentPresets" | "filamentComplianceFallback" | "filamentComplianceUnchanged">;
|
|
4
|
+
/** A sentence of {@link filamentNotes} and the filaments it's about. */
|
|
5
|
+
export interface FilamentPresetNote {
|
|
6
|
+
/** The filament slots the sentence names, counting from 1 as slicers show them; none when it's about product lines rather than slots. */
|
|
7
|
+
slots: number[];
|
|
8
|
+
/** The sentence, with its final period. */
|
|
9
|
+
text: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The sentences of {@link filamentNotes}, each with the slots it names. `group` splits the filaments of one preset
|
|
13
|
+
* into separate sentences when they're there for different reasons (one tuned for another nozzle size, one the
|
|
14
|
+
* naming option chose): filaments with the same preset and the same group share a sentence.
|
|
15
|
+
*/
|
|
16
|
+
export declare function filamentPresetNotes(report: NotesReport, group?: (slot: number) => string): FilamentPresetNote[];
|
|
2
17
|
/**
|
|
3
18
|
* What the Snapmaker or Generic filament option did, one sentence per note: which filaments use a preset's own
|
|
4
19
|
* settings and what that replaced, which use Generic because Snapmaker makes no preset for them, and which kept
|
|
5
20
|
* the creator's name and settings because no preset fits. Empty when the option wasn't used or changed nothing.
|
|
21
|
+
* The same sentences are in `report.notes`, with their slots and topic.
|
|
6
22
|
*/
|
|
7
|
-
export declare function filamentNotes(report:
|
|
23
|
+
export declare function filamentNotes(report: NotesReport): string[];
|
|
@@ -23,20 +23,24 @@ const NAMED = [
|
|
|
23
23
|
];
|
|
24
24
|
const list = (items) => (items.length <= 1 ? items.join("") : `${items.slice(0, -1).join(", ")} and ${items.at(-1)}`);
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
26
|
+
* The sentences of {@link filamentNotes}, each with the slots it names. `group` splits the filaments of one preset
|
|
27
|
+
* into separate sentences when they're there for different reasons (one tuned for another nozzle size, one the
|
|
28
|
+
* naming option chose): filaments with the same preset and the same group share a sentence.
|
|
29
29
|
*/
|
|
30
|
-
export function
|
|
30
|
+
export function filamentPresetNotes(report, group = () => "") {
|
|
31
31
|
const notes = [];
|
|
32
32
|
const byPreset = new Map();
|
|
33
|
-
for (const p of report.filamentPresets ?? [])
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
for (const p of report.filamentPresets ?? []) {
|
|
34
|
+
const key = `${group(p.slot)}\u0000${p.preset}`;
|
|
35
|
+
byPreset.set(key, [...(byPreset.get(key) ?? []), p]);
|
|
36
|
+
}
|
|
37
|
+
for (const [key, slots] of byPreset) {
|
|
38
|
+
const preset = key.slice(key.indexOf("\u0000") + 1);
|
|
36
39
|
const changed = slots.find((s) => s.changed.length > 0)?.changed ?? [];
|
|
37
|
-
const
|
|
40
|
+
const numbers = slots.map((s) => s.slot);
|
|
41
|
+
const which = `${slots.length === 1 ? "Filament" : "Filaments"} ${list(numbers.map(String))}`;
|
|
38
42
|
if (changed.length === 0) {
|
|
39
|
-
notes.push(`${which} ${slots.length === 1 ? "uses" : "use"} ${preset}'s own settings, which match the creator's.`);
|
|
43
|
+
notes.push({ slots: numbers, text: `${which} ${slots.length === 1 ? "uses" : "use"} ${preset}'s own settings, which match the creator's.` });
|
|
40
44
|
continue;
|
|
41
45
|
}
|
|
42
46
|
// The settings people know by name first; the rest as a count.
|
|
@@ -47,14 +51,26 @@ export function filamentNotes(report) {
|
|
|
47
51
|
const rest = changed.length - named.length;
|
|
48
52
|
const others = `${rest} other setting${rest === 1 ? "" : "s"}`;
|
|
49
53
|
const what = named.length === 0 ? others : rest > 0 ? `${named.join(", ")}, and ${others}` : list(named);
|
|
50
|
-
notes.push(`${which} ${slots.length === 1 ? "uses" : "use"} ${preset}'s own settings instead of the creator's: ${what}.`);
|
|
54
|
+
notes.push({ slots: numbers, text: `${which} ${slots.length === 1 ? "uses" : "use"} ${preset}'s own settings instead of the creator's: ${what}.` });
|
|
51
55
|
}
|
|
52
56
|
const fallback = report.filamentComplianceFallback ?? [];
|
|
53
57
|
if (fallback.length > 0)
|
|
54
|
-
notes.push(`Snapmaker makes no preset for ${list(fallback)} at this nozzle size, so ${fallback.length === 1 ? "it uses" : "those use"} Generic.`);
|
|
58
|
+
notes.push({ slots: [], text: `Snapmaker makes no preset for ${list(fallback)} at this nozzle size, so ${fallback.length === 1 ? "it uses" : "those use"} Generic.` });
|
|
55
59
|
const unchanged = report.filamentComplianceUnchanged ?? [];
|
|
56
60
|
if (unchanged.length > 0) {
|
|
57
|
-
notes.push(
|
|
61
|
+
notes.push({
|
|
62
|
+
slots: [],
|
|
63
|
+
text: `No Snapmaker or Generic preset fits ${list(unchanged)} at this nozzle size, so ${unchanged.length === 1 ? "its name and settings stay" : "their names and settings stay"} as the creator had them. Snapmaker Space may refuse this file.`,
|
|
64
|
+
});
|
|
58
65
|
}
|
|
59
66
|
return notes;
|
|
60
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* What the Snapmaker or Generic filament option did, one sentence per note: which filaments use a preset's own
|
|
70
|
+
* settings and what that replaced, which use Generic because Snapmaker makes no preset for them, and which kept
|
|
71
|
+
* the creator's name and settings because no preset fits. Empty when the option wasn't used or changed nothing.
|
|
72
|
+
* The same sentences are in `report.notes`, with their slots and topic.
|
|
73
|
+
*/
|
|
74
|
+
export function filamentNotes(report) {
|
|
75
|
+
return filamentPresetNotes(report).map((note) => note.text);
|
|
76
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The topics a note can have, in the order the notes come. First what the user has to act on before printing (other
|
|
3
|
+
* filament to load; a plate whose filaments the U1 can't print as they are, or only with filament changes, or that
|
|
4
|
+
* the Snapmaker Orca release can print wrong), then why the file is for this nozzle size and profile, then the
|
|
5
|
+
* filament naming option, then what reading the file and converting its settings and plates had to say.
|
|
6
|
+
*/
|
|
7
|
+
export declare const NOTE_TOPICS: readonly ["filament-diameter", "plate-filaments", "nozzle", "profile", "filament-presets", "source", "settings", "plates"];
|
|
8
|
+
/** The topics this release of the library gives its notes. */
|
|
9
|
+
export type KnownNoteTopic = (typeof NOTE_TOPICS)[number];
|
|
10
|
+
/** A note's topic: one of `NOTE_TOPICS`, or a value a newer library adds; show an unknown one as it is, after the known ones. */
|
|
11
|
+
export type NoteTopic = KnownNoteTopic | (string & {});
|
|
12
|
+
/** One note for the user, in the result's own words. */
|
|
13
|
+
export interface ConvertNote {
|
|
14
|
+
/** What the note is about; `NOTE_TOPICS` lists the values and their order. */
|
|
15
|
+
topic: NoteTopic;
|
|
16
|
+
/** The filament slots the note is about, counting from 1 as slicers show them. Absent when it's about the whole file. */
|
|
17
|
+
slots?: number[];
|
|
18
|
+
/** One or more sentences: a capital at the start, a period at the end, "0.4 mm" with a space. */
|
|
19
|
+
text: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Same cleanup every UI applies before showing warnings: drop routine
|
|
23
|
+
* bookkeeping lines, strip the internal "WARN" and "note" markers and
|
|
24
|
+
* internal file names.
|
|
25
|
+
*/
|
|
26
|
+
export declare function cleanWarnings(warnings: readonly string[]): string[];
|
|
27
|
+
/**
|
|
28
|
+
* The one sentence style: `cleanWarnings`' cleanup (no "WARN:" marker, no file names, plain text), then a capital
|
|
29
|
+
* at the start unless the first word is a setting key, and a final period. The source strings write "0.4 mm" with a
|
|
30
|
+
* space themselves (a name quoted from the file, "0.20mm QUALITY", stays as it is). Returns null for a routine line
|
|
31
|
+
* `cleanWarnings` drops.
|
|
32
|
+
*/
|
|
33
|
+
export declare function styleNote(text: string): string | null;
|
|
34
|
+
/** A note from a raw warning line; null when the line is routine. */
|
|
35
|
+
export declare function noteFrom(topic: NoteTopic, text: string, slots?: readonly number[]): ConvertNote | null;
|
|
36
|
+
/**
|
|
37
|
+
* Sorted by topic in `NOTE_TOPICS`' order, unknown topics last in the order given; within a topic the order given
|
|
38
|
+
* stays, so a caller puts each topic's headline first.
|
|
39
|
+
*/
|
|
40
|
+
export declare function sortNotes(notes: readonly ConvertNote[]): ConvertNote[];
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
/**
|
|
3
|
+
* A result's notes as one list a UI can show in its given order: every sentence `warnings`, `profileNotes` and
|
|
4
|
+
* `filamentNotes()` hold, each once, with the topic it's about and the filaments it names, sorted by topic with
|
|
5
|
+
* each topic's headline first.
|
|
6
|
+
*/
|
|
7
|
+
import { plainText } from "../plainText.js";
|
|
8
|
+
/**
|
|
9
|
+
* The topics a note can have, in the order the notes come. First what the user has to act on before printing (other
|
|
10
|
+
* filament to load; a plate whose filaments the U1 can't print as they are, or only with filament changes, or that
|
|
11
|
+
* the Snapmaker Orca release can print wrong), then why the file is for this nozzle size and profile, then the
|
|
12
|
+
* filament naming option, then what reading the file and converting its settings and plates had to say.
|
|
13
|
+
*/
|
|
14
|
+
export const NOTE_TOPICS = ["filament-diameter", "plate-filaments", "nozzle", "profile", "filament-presets", "source", "settings", "plates"];
|
|
15
|
+
/**
|
|
16
|
+
* Same cleanup every UI applies before showing warnings: drop routine
|
|
17
|
+
* bookkeeping lines, strip the internal "WARN" and "note" markers and
|
|
18
|
+
* internal file names.
|
|
19
|
+
*/
|
|
20
|
+
export function cleanWarnings(warnings) {
|
|
21
|
+
return warnings
|
|
22
|
+
.map((w) => w.trim())
|
|
23
|
+
.filter((w) => {
|
|
24
|
+
if (!w)
|
|
25
|
+
return false;
|
|
26
|
+
if (w.includes("SKIP filament_colour: list length mismatch"))
|
|
27
|
+
return false;
|
|
28
|
+
if (w.includes("left unchanged"))
|
|
29
|
+
return false;
|
|
30
|
+
if (w.includes("ignored") && w.includes("trailing non-JSON"))
|
|
31
|
+
return false;
|
|
32
|
+
return true;
|
|
33
|
+
})
|
|
34
|
+
.map((w) => w
|
|
35
|
+
.replace(/^WARN:\s*/i, "")
|
|
36
|
+
.replace(/^WARN\s+/i, "")
|
|
37
|
+
.replace(/^note:\s*/i, "")
|
|
38
|
+
.replace(/\s+in\s+model_settings\.config\.?/i, "")
|
|
39
|
+
.replace(/\s+in\s+3D\/3dmodel\.model\.?/i, "")
|
|
40
|
+
.replace(/\s+in\s+[A-Za-z0-9_./-]+\.(config|model|xml)\.?/i, "")
|
|
41
|
+
.replace(/\.$/, ""))
|
|
42
|
+
// Warnings can quote names from the file; they're prose for people, so they never carry control characters.
|
|
43
|
+
.map(plainText);
|
|
44
|
+
}
|
|
45
|
+
const TOPIC_ORDER = new Map(NOTE_TOPICS.map((topic, i) => [topic, i]));
|
|
46
|
+
/**
|
|
47
|
+
* The one sentence style: `cleanWarnings`' cleanup (no "WARN:" marker, no file names, plain text), then a capital
|
|
48
|
+
* at the start unless the first word is a setting key, and a final period. The source strings write "0.4 mm" with a
|
|
49
|
+
* space themselves (a name quoted from the file, "0.20mm QUALITY", stays as it is). Returns null for a routine line
|
|
50
|
+
* `cleanWarnings` drops.
|
|
51
|
+
*/
|
|
52
|
+
export function styleNote(text) {
|
|
53
|
+
const [clean] = cleanWarnings([text]);
|
|
54
|
+
if (clean === undefined)
|
|
55
|
+
return null;
|
|
56
|
+
const firstWord = clean.split(/\s/, 1)[0] ?? "";
|
|
57
|
+
const capitalized = /^[a-z]/.test(clean) && !firstWord.includes("_") ? clean[0].toUpperCase() + clean.slice(1) : clean;
|
|
58
|
+
return /[.!?]$/.test(capitalized) ? capitalized : `${capitalized}.`;
|
|
59
|
+
}
|
|
60
|
+
/** A note from a raw warning line; null when the line is routine. */
|
|
61
|
+
export function noteFrom(topic, text, slots) {
|
|
62
|
+
const styled = styleNote(text);
|
|
63
|
+
if (styled === null)
|
|
64
|
+
return null;
|
|
65
|
+
return { topic, ...(slots && slots.length > 0 ? { slots: [...slots] } : {}), text: styled };
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Sorted by topic in `NOTE_TOPICS`' order, unknown topics last in the order given; within a topic the order given
|
|
69
|
+
* stays, so a caller puts each topic's headline first.
|
|
70
|
+
*/
|
|
71
|
+
export function sortNotes(notes) {
|
|
72
|
+
const rank = (topic) => TOPIC_ORDER.get(topic) ?? NOTE_TOPICS.length;
|
|
73
|
+
return notes.map((note, i) => ({ note, i })).sort((a, b) => rank(a.note.topic) - rank(b.note.topic) || a.i - b.i).map(({ note }) => note);
|
|
74
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a result says about the filaments each plate uses: a plate that needs more filaments at the same height than
|
|
3
|
+
* the printer has toolheads, a plate that uses more than that but never at once, and, for a project with more
|
|
4
|
+
* filaments than toolheads, which ones each plate uses (what to load for it).
|
|
5
|
+
*/
|
|
6
|
+
import type { PlateFilaments } from "../archive/plateFilaments.js";
|
|
7
|
+
/** "filament 4", "filaments 1 and 3", "filaments 1, 3, 5 and 6". */
|
|
8
|
+
export declare function filamentList(slots: readonly number[]): string;
|
|
9
|
+
export interface PlateNote {
|
|
10
|
+
/** The plate's filament slots. */
|
|
11
|
+
slots: number[];
|
|
12
|
+
text: string;
|
|
13
|
+
/** Worth a warning (the plate can't print as it is, or needs filament changes); false for a plain "what it uses" line. */
|
|
14
|
+
warning: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The notes for a project's plates, the ones that can't print as they are first, then the ones that need filament
|
|
18
|
+
* changes, then the plain lines, each group in plate order.
|
|
19
|
+
*
|
|
20
|
+
* @param filamentCount how many filaments the source project has
|
|
21
|
+
* @param toolheads how many the printer prints with at a time
|
|
22
|
+
*/
|
|
23
|
+
export declare function plateFilamentNotes(plates: readonly PlateFilaments[], filamentCount: number, toolheads: number): PlateNote[];
|
|
24
|
+
/**
|
|
25
|
+
* The note for a release that can leave a high-numbered filament out of some layers
|
|
26
|
+
* (`ProfileCatalog.sharedLayerFilamentLimit`): null unless some plate uses a filament above the limit together
|
|
27
|
+
* with the filament that many numbers below it (17 with 1, 18 with 2, for a limit of 16). That pair is what test
|
|
28
|
+
* slices lost layers on; a filament above the limit with other filaments on its plate, or alone, printed whole.
|
|
29
|
+
*
|
|
30
|
+
* @param slicer the release, as shown to the user: "Snapmaker Orca 2.4.1"
|
|
31
|
+
*/
|
|
32
|
+
export declare function sharedLayerFilamentNote(plates: readonly PlateFilaments[], limit: number | null, slicer: string): PlateNote | null;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/** "filament 4", "filaments 1 and 3", "filaments 1, 3, 5 and 6". */
|
|
2
|
+
export function filamentList(slots) {
|
|
3
|
+
if (slots.length === 1)
|
|
4
|
+
return `filament ${slots[0]}`;
|
|
5
|
+
return `filaments ${slots.slice(0, -1).join(", ")} and ${slots[slots.length - 1]}`;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The notes for a project's plates, the ones that can't print as they are first, then the ones that need filament
|
|
9
|
+
* changes, then the plain lines, each group in plate order.
|
|
10
|
+
*
|
|
11
|
+
* @param filamentCount how many filaments the source project has
|
|
12
|
+
* @param toolheads how many the printer prints with at a time
|
|
13
|
+
*/
|
|
14
|
+
export function plateFilamentNotes(plates, filamentCount, toolheads) {
|
|
15
|
+
const tooMany = [];
|
|
16
|
+
const withChanges = [];
|
|
17
|
+
const plain = [];
|
|
18
|
+
for (const { plate, filaments, mostAtOnce } of plates) {
|
|
19
|
+
if (filaments.length === 0)
|
|
20
|
+
continue;
|
|
21
|
+
const slots = filaments.map((f) => f.slot);
|
|
22
|
+
if (mostAtOnce > toolheads) {
|
|
23
|
+
tooMany.push({
|
|
24
|
+
slots,
|
|
25
|
+
warning: true,
|
|
26
|
+
text: `Plate ${plate} needs ${mostAtOnce} filaments at the same height (it uses ${filamentList(slots)}), and the U1 prints with ${toolheads} at a time, so it can't print as it is. In Snapmaker Orca, move some of its objects to another plate or use fewer filaments on it.`,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
else if (slots.length > toolheads) {
|
|
30
|
+
withChanges.push({
|
|
31
|
+
slots,
|
|
32
|
+
warning: true,
|
|
33
|
+
text: `Plate ${plate} uses ${slots.length} filaments (${filamentList(slots)}), no more than ${mostAtOnce} at the same height. The U1 prints with ${toolheads} at a time, so this plate needs filament changes at pauses, which you set up in Snapmaker Orca.`,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
else if (filamentCount > toolheads) {
|
|
37
|
+
plain.push({ slots, warning: false, text: `Plate ${plate} uses ${filamentList(slots)}.` });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return [...tooMany, ...withChanges, ...plain];
|
|
41
|
+
}
|
|
42
|
+
/** "plate 3", "plates 3 and 4", "plates 1, 3 and 4". */
|
|
43
|
+
function plateList(plates) {
|
|
44
|
+
if (plates.length === 1)
|
|
45
|
+
return `plate ${plates[0]}`;
|
|
46
|
+
return `plates ${plates.slice(0, -1).join(", ")} and ${plates[plates.length - 1]}`;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The note for a release that can leave a high-numbered filament out of some layers
|
|
50
|
+
* (`ProfileCatalog.sharedLayerFilamentLimit`): null unless some plate uses a filament above the limit together
|
|
51
|
+
* with the filament that many numbers below it (17 with 1, 18 with 2, for a limit of 16). That pair is what test
|
|
52
|
+
* slices lost layers on; a filament above the limit with other filaments on its plate, or alone, printed whole.
|
|
53
|
+
*
|
|
54
|
+
* @param slicer the release, as shown to the user: "Snapmaker Orca 2.4.1"
|
|
55
|
+
*/
|
|
56
|
+
export function sharedLayerFilamentNote(plates, limit, slicer) {
|
|
57
|
+
if (limit === null)
|
|
58
|
+
return null;
|
|
59
|
+
const affectedPlates = [];
|
|
60
|
+
const affectedSlots = new Set();
|
|
61
|
+
const partnerSlots = new Set();
|
|
62
|
+
for (const { plate, filaments } of plates) {
|
|
63
|
+
// Each filament above the limit whose partner, the filament `limit` numbers below it, is on the plate too.
|
|
64
|
+
const onPlate = new Set(filaments.map((f) => f.slot));
|
|
65
|
+
const above = [...onPlate].filter((slot) => slot > limit && onPlate.has(slot - limit));
|
|
66
|
+
if (above.length === 0)
|
|
67
|
+
continue;
|
|
68
|
+
affectedPlates.push(plate);
|
|
69
|
+
for (const slot of above) {
|
|
70
|
+
affectedSlots.add(slot);
|
|
71
|
+
partnerSlots.add(slot - limit);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (affectedPlates.length === 0)
|
|
75
|
+
return null;
|
|
76
|
+
const slots = [...affectedSlots].sort((a, b) => a - b);
|
|
77
|
+
const partners = [...partnerSlots].sort((a, b) => a - b);
|
|
78
|
+
const one = slots.length === 1;
|
|
79
|
+
// What to do first, then what can happen, then how to see it and how to avoid it. A filament from 1 to the limit
|
|
80
|
+
// is never the one left out, so moving the higher-numbered filament there is safe whatever else the plate uses.
|
|
81
|
+
return {
|
|
82
|
+
slots,
|
|
83
|
+
warning: true,
|
|
84
|
+
text: `Check ${plateList(affectedPlates)} before printing. ${slicer} can skip ${filamentList(slots)} on some layers when ` +
|
|
85
|
+
`${filamentList(partners)} ${partners.length === 1 ? "is" : "are"} on the same plate, and it gives no warning. ` +
|
|
86
|
+
`Look through the sliced preview for missing color. To avoid the problem, print ${one ? "the two" : "each pair"} on separate plates, ` +
|
|
87
|
+
`or give ${filamentList(slots)} ${one ? "a number" : "numbers"} from 1 to ${limit} in Snapmaker Orca.`,
|
|
88
|
+
};
|
|
89
|
+
}
|