bambu-printer-mcp 1.1.39 → 1.1.41

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/CONTRIBUTORS.md CHANGED
@@ -6,6 +6,7 @@ Thank you to everyone who builds, tests, reports problems, and shares real print
6
6
 
7
7
  | Contributor | Contribution |
8
8
  | --- | --- |
9
+ | [JackCA](https://github.com/JackCA) | Reports an X2D retaining `FAILED` with no active print/HMS error after cancellation, supplies read-only printer evidence for `fail_reason: 0300400C`, and contributes narrow canceled-task recovery, job-bound physical confirmation, a recheck of the job and error codes after connecting and before clearing hardware errors on any model, and regression coverage in [#76](https://github.com/DMontgomery40/bambu-printer-mcp/pull/76). Physical print delivery after the fix remains unverified. |
9
10
  | [ZombieLurker](https://github.com/ZombieLurker) | Reports and diagnoses the unused-nozzle preheat rejection for OrcaSlicer 2.4.2 single-filament H2D jobs in [#73](https://github.com/DMontgomery40/bambu-printer-mcp/issues/73), supplies the exact startup commands and environment, and verifies a local inspection fix. H2D Pro coverage is independently supported by its official profile; no physical printing is claimed by this release. |
10
11
  | [MorganFreeeman](https://github.com/MorganFreeeman) | Reports in [#67](https://github.com/DMontgomery40/bambu-printer-mcp/issues/67) that every H2D print stopped on stock HS01 nozzles. Supplies idle and mid-print firmware 01.04.00.00 nozzle reports showing a permanent `stat: 1` with `sn: "N/A"`, proposes keeping the check narrow to nozzles without an identity chip, and points out the misleading declined-confirmation advice and the missing settings-table entries. Maintainer validation uses their reports in regressions; no H2D hardware was available. |
11
12
  | [Aaron Roberts (aaroberts)](https://github.com/aaroberts) | Diagnoses FULU's Linux host exit 101 and its working-directory library loading in [#68](https://github.com/DMontgomery40/bambu-printer-mcp/issues/68), reports both upstream as [FULU #50](https://github.com/FULU-Foundation/OrcaSlicer-bambulab/issues/50) and [#51](https://github.com/FULU-Foundation/OrcaSlicer-bambulab/issues/51), and shares a working configuration: the `cat` wrapper, absolute plug-in paths, the FULU GUI's session file for cloud login, and the required 02.05.02.5x plug-in. Reports cloud printing on two P1S printers with 1.1.33. The server now sets the library paths and explains exit 101. The host fixes themselves remain with FULU. |
@@ -1,5 +1,5 @@
1
1
  import { createHash } from "node:crypto";
2
- import { readFreshPrinterStatus } from "../safety/printer-state.js";
2
+ import { isCancelledX2DJob, readFreshPrinterStatus } from "../safety/printer-state.js";
3
3
  import fs from "node:fs/promises";
4
4
  import { readFileSync, existsSync } from "node:fs";
5
5
  import path from "node:path";
@@ -438,7 +438,10 @@ export class BambuImplementation {
438
438
  }
439
439
  }
440
440
  finishedJobIdentity(status) {
441
- return status.raw.gcode_state === "FINISH" ? JSON.stringify([status.raw.gcode_file, status.raw.subtask_name, status.raw.task_id, status.raw.subtask_id]) : undefined;
441
+ const raw = status.raw;
442
+ return raw.gcode_state === "FINISH" || isCancelledX2DJob(raw, String(status.model ?? ""))
443
+ ? JSON.stringify([raw.gcode_state, raw.gcode_file, raw.subtask_name, raw.task_id, raw.subtask_id, raw.job_id])
444
+ : undefined;
442
445
  }
443
446
  /**
444
447
  * The human print confirmation. Its result goes to assertBedClearance at
@@ -453,7 +456,9 @@ export class BambuImplementation {
453
456
  await this.confirmHardwareAction(`Start a checked print on ${inspection.model.toUpperCase()} (${serial})? Nozzles: ${inspection.nozzleDiameters.join(", ")} mm. ` +
454
457
  `Materials: ${inspection.materials.join(", ")}. Peak targets: nozzle ${inspection.maxNozzleTemperature}°C, bed ${inspection.maxBedTemperature}°C, chamber ${inspection.maxChamberTemperature}°C. ` +
455
458
  `File SHA-256: ${inspection.sha256}. Confirm the physical spool labels and that the build plate is clear.` +
456
- (finishedJob !== undefined ? " The printer reports FINISH: remove the previous part and debris before confirming." : "") +
459
+ (finishedJob !== undefined ? (status.raw.gcode_state === "FAILED"
460
+ ? " The previous X2D task was canceled (0300400C): remove every detached part, support and strand from the plate and nozzle before confirming. FAILED is the previous job's terminal state; no error-reset command is sent."
461
+ : " The printer reports FINISH: remove the previous part and debris before confirming.") : "") +
457
462
  (cleared ? ` Previously cleared hardware codes: ${cleared.map(describeHmsKey).join(", ")}. Confirm their physical causes have been resolved.` : "") +
458
463
  (notices.length ? ` The printer also reports ${notices.join(", ")}, which Bambu lists for this model without text and never shows as a fault; ` +
459
464
  `${notices.length === 1 ? "it does" : "they do"} not block printing.` : "") +
@@ -979,11 +984,22 @@ export class BambuImplementation {
979
984
  const hidden = new Set(hiddenHmsKeys(status.raw, serial, String(status.model ?? "")));
980
985
  return [`print_error:${status.raw.print_error}`, ...status.raw.hms.map(reportedHmsKey).filter((key) => !hidden.has(key))].sort();
981
986
  };
982
- const codes = codesFor(await this.getSafetyStatus(host, serial, token));
983
- await this.confirmHardwareAction(`Clear reported hardware errors on ${serial}: ${codes.map(describeHmsKey).join(", ")}? Inspect the printer and resolve the physical cause first. Confirm only after removing obstructions and correcting the fault.`, true);
987
+ const initialStatus = await this.getSafetyStatus(host, serial, token);
988
+ const codes = codesFor(initialStatus);
989
+ // Bind the physical inspection to the job observed before asking the
990
+ // person. Identical error codes alone cannot identify a different job.
991
+ const jobIdentity = (raw) => JSON.stringify([
992
+ raw.gcode_file, raw.subtask_name, raw.task_id, raw.subtask_id, raw.job_id,
993
+ ]);
994
+ const confirmedJob = jobIdentity(initialStatus.raw);
995
+ const jobName = initialStatus.raw.subtask_name || initialStatus.raw.gcode_file;
996
+ await this.confirmHardwareAction(`Clear reported hardware errors on ${serial}: ${codes.map(describeHmsKey).join(", ")}?${jobName ? ` Current job: ${String(jobName)}.` : ""} Inspect the printer and resolve the physical cause first. Confirm only after removing obstructions and correcting the fault.`, true);
984
997
  const beforeDispatch = async () => {
985
998
  assertActive();
986
- const current = codesFor(await this.getSafetyStatus(host, serial, token));
999
+ const currentStatus = await this.getSafetyStatus(host, serial, token);
1000
+ if (jobIdentity(currentStatus.raw) !== confirmedJob)
1001
+ throw new Error("Printer job changed before clearing hardware errors. Inspect the current job and confirm again; nothing further sent.");
1002
+ const current = codesFor(currentStatus);
987
1003
  if (JSON.stringify(current) !== JSON.stringify(codes))
988
1004
  throw new Error("Hardware errors changed before clearing. Inspect the new report before retrying.");
989
1005
  assertActive();
@@ -993,8 +1009,10 @@ export class BambuImplementation {
993
1009
  assertActive();
994
1010
  if (dispatch)
995
1011
  await dispatch(assertActive, beforeDispatch);
996
- else
1012
+ else {
1013
+ await beforeDispatch();
997
1014
  await printer.publish({ print: { command: "clean_print_error", sequence_id: "0" } });
1015
+ }
998
1016
  this.clearedErrors.set(serial, codes);
999
1017
  await sleep(COMMAND_SETTLE_MS);
1000
1018
  return { status: "success", message: "Confirmed HMS clear command sent. The next print requires acknowledgment of these cleared codes.", cleared_codes: codes };
@@ -39,6 +39,16 @@ export interface ValidatedPrinterState {
39
39
  reportedNozzles: ReportedNozzle[];
40
40
  filaments: ReportedFilament[];
41
41
  }
42
+ /**
43
+ * X2D retains FAILED after a canceled job even with no active print error.
44
+ * Bambu Studio classifies FAILED as a finished job; its v02.08.02.61
45
+ * hms_en_20P table (926a7192574bcb9b3a732e1ec59a46d79cb45466)
46
+ * calls 0300400C "The task was canceled."
47
+ * Only this observed terminal condition qualifies, never an arbitrary failure.
48
+ * Callers still validate HMS, identity, hardware and material configuration,
49
+ * and print dispatch must obtain job-bound physical bed-clearance confirmation.
50
+ */
51
+ export declare function isCancelledX2DJob(raw: Record<string, any>, model: string): boolean;
42
52
  /** Nozzles whose reported diameter and type are configured settings rather than chip readings. */
43
53
  export declare function unchippedNozzles(raw: unknown): number[];
44
54
  /** The one key format for a reported entry, shared by the gate and clear_hms_errors. */
@@ -116,6 +116,20 @@ function finiteNumber(value) {
116
116
  const number = Number(value);
117
117
  return Number.isFinite(number) ? number : undefined;
118
118
  }
119
+ /**
120
+ * X2D retains FAILED after a canceled job even with no active print error.
121
+ * Bambu Studio classifies FAILED as a finished job; its v02.08.02.61
122
+ * hms_en_20P table (926a7192574bcb9b3a732e1ec59a46d79cb45466)
123
+ * calls 0300400C "The task was canceled."
124
+ * Only this observed terminal condition qualifies, never an arbitrary failure.
125
+ * Callers still validate HMS, identity, hardware and material configuration,
126
+ * and print dispatch must obtain job-bound physical bed-clearance confirmation.
127
+ */
128
+ export function isCancelledX2DJob(raw, model) {
129
+ return normalizeModel(model) === "x2d" && raw.gcode_state === "FAILED" &&
130
+ finiteNumber(raw.print_error) === 0 && finiteNumber(raw.fail_reason) === 0x0300400c &&
131
+ [raw.gcode_file, raw.subtask_name].some(value => typeof value === "string" && value.trim().length > 0);
132
+ }
119
133
  const token = (value) => typeof value === "string" ? value.trim().toLowerCase().replace(/[\s_-]/g, "") : "";
120
134
  function nozzleTypeAndFlow(value) {
121
135
  const text = String(value ?? "");
@@ -296,9 +310,10 @@ function logHiddenNotices(raw, serial, model) {
296
310
  }
297
311
  function validateErrors(raw, requireIdle, serial, model) {
298
312
  const state = typeof raw.gcode_state === "string" ? raw.gcode_state.toUpperCase() : "UNKNOWN";
299
- if (requireIdle && !["IDLE", "FINISH"].includes(state))
313
+ const cancelled = isCancelledX2DJob(raw, model);
314
+ if (requireIdle && !["IDLE", "FINISH"].includes(state) && !cancelled)
300
315
  throw new Error(`Printer state ${state} is not safely idle.`);
301
- if (!requireIdle && !["IDLE", "FINISH", "RUNNING", "PAUSE"].includes(state))
316
+ if (!requireIdle && !["IDLE", "FINISH", "RUNNING", "PAUSE"].includes(state) && !cancelled)
302
317
  throw new Error(`Printer state ${state} is unknown or failed.`);
303
318
  if (finiteNumber(raw.print_error) !== 0)
304
319
  throw new Error("Printer reports a print error or did not report its error state.");
@@ -1823,22 +1823,23 @@ export class STLManipulator extends EventEmitter {
1823
1823
  throw new Error("Operation cancelled");
1824
1824
  if (progressCallback)
1825
1825
  progressCallback(75, "Finding largest flat surface...");
1826
- // Find the group with the largest total area (excluding near-vertical faces)
1826
+ // Include already-horizontal faces: excluding Z-aligned normals can
1827
+ // stand a flat model on its edge, including on a repeated layFlat call.
1827
1828
  let largestArea = 0;
1828
1829
  let targetNormal = null;
1829
- const upVector = new THREE.Vector3(0, 1, 0); // Assuming Y is up for most models initially?
1830
1830
  const downVector = new THREE.Vector3(0, 0, -1); // Target normal (pointing down)
1831
+ // Faces are grouped by direction, so a part whose flat faces are all
1832
+ // horizontal has equal up- and down-facing areas. On a tie, keep the
1833
+ // face that already points down so a seated part is not flipped.
1831
1834
  for (const group of normalGroups.values()) {
1832
- // Check if the normal is reasonably horizontal (not too close to vertical Z)
1833
- // Angle threshold could be adjusted (e.g., > 5 degrees from Z axis)
1834
- if (Math.abs(group.representativeNormal.z) < 0.99 && group.totalArea > largestArea) {
1835
+ const tied = targetNormal !== null && Math.abs(group.totalArea - largestArea) <= largestArea * 1e-6;
1836
+ if (tied ? group.representativeNormal.z < targetNormal.z : group.totalArea > largestArea) {
1835
1837
  largestArea = group.totalArea;
1836
1838
  targetNormal = group.representativeNormal;
1837
1839
  }
1838
1840
  }
1839
1841
  if (!targetNormal) {
1840
- // If no suitable horizontal face found, maybe pick the lowest Z face?
1841
- // For now, throw an error or return unchanged.
1842
+ // Only a mesh without any face area reaches this.
1842
1843
  console.warn("Could not find a suitable large flat face to lay down. No changes made.");
1843
1844
  this.emit('operationComplete', { operationId, type: 'layFlat', success: true, output: stlFilePath, message: "No suitable flat face found." });
1844
1845
  return stlFilePath;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bambu-printer-mcp",
3
- "version": "1.1.39",
3
+ "version": "1.1.41",
4
4
  "description": "MCP server for Bambu Lab 3D printers with STL manipulation, slicing, and print management",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
@@ -1,5 +1,5 @@
1
1
  import { createHash } from "node:crypto";
2
- import { readFreshPrinterStatus } from "../safety/printer-state.js";
2
+ import { isCancelledX2DJob, readFreshPrinterStatus } from "../safety/printer-state.js";
3
3
  import fs from "node:fs/promises";
4
4
  import { readFileSync, existsSync } from "node:fs";
5
5
  import path from "node:path";
@@ -527,7 +527,10 @@ export class BambuImplementation {
527
527
  }
528
528
 
529
529
  private finishedJobIdentity(status: any): string | undefined {
530
- return status.raw.gcode_state === "FINISH" ? JSON.stringify([status.raw.gcode_file, status.raw.subtask_name, status.raw.task_id, status.raw.subtask_id]) : undefined;
530
+ const raw = status.raw;
531
+ return raw.gcode_state === "FINISH" || isCancelledX2DJob(raw, String(status.model ?? ""))
532
+ ? JSON.stringify([raw.gcode_state, raw.gcode_file, raw.subtask_name, raw.task_id, raw.subtask_id, raw.job_id])
533
+ : undefined;
531
534
  }
532
535
 
533
536
  /**
@@ -544,7 +547,9 @@ export class BambuImplementation {
544
547
  `Start a checked print on ${inspection.model.toUpperCase()} (${serial})? Nozzles: ${inspection.nozzleDiameters.join(", ")} mm. ` +
545
548
  `Materials: ${inspection.materials.join(", ")}. Peak targets: nozzle ${inspection.maxNozzleTemperature}°C, bed ${inspection.maxBedTemperature}°C, chamber ${inspection.maxChamberTemperature}°C. ` +
546
549
  `File SHA-256: ${inspection.sha256}. Confirm the physical spool labels and that the build plate is clear.` +
547
- (finishedJob !== undefined ? " The printer reports FINISH: remove the previous part and debris before confirming." : "") +
550
+ (finishedJob !== undefined ? (status.raw.gcode_state === "FAILED"
551
+ ? " The previous X2D task was canceled (0300400C): remove every detached part, support and strand from the plate and nozzle before confirming. FAILED is the previous job's terminal state; no error-reset command is sent."
552
+ : " The printer reports FINISH: remove the previous part and debris before confirming.") : "") +
548
553
  (cleared ? ` Previously cleared hardware codes: ${cleared.map(describeHmsKey).join(", ")}. Confirm their physical causes have been resolved.` : "") +
549
554
  (notices.length ? ` The printer also reports ${notices.join(", ")}, which Bambu lists for this model without text and never shows as a fault; ` +
550
555
  `${notices.length === 1 ? "it does" : "they do"} not block printing.` : "") +
@@ -1101,11 +1106,21 @@ export class BambuImplementation {
1101
1106
  const hidden = new Set(hiddenHmsKeys(status.raw, serial, String(status.model ?? "")));
1102
1107
  return [`print_error:${status.raw.print_error}`, ...status.raw.hms.map(reportedHmsKey).filter((key: string) => !hidden.has(key))].sort();
1103
1108
  };
1104
- const codes = codesFor(await this.getSafetyStatus(host, serial, token));
1105
- await this.confirmHardwareAction(`Clear reported hardware errors on ${serial}: ${codes.map(describeHmsKey).join(", ")}? Inspect the printer and resolve the physical cause first. Confirm only after removing obstructions and correcting the fault.`, true);
1109
+ const initialStatus = await this.getSafetyStatus(host, serial, token);
1110
+ const codes = codesFor(initialStatus);
1111
+ // Bind the physical inspection to the job observed before asking the
1112
+ // person. Identical error codes alone cannot identify a different job.
1113
+ const jobIdentity = (raw: Record<string, any>) => JSON.stringify([
1114
+ raw.gcode_file, raw.subtask_name, raw.task_id, raw.subtask_id, raw.job_id,
1115
+ ]);
1116
+ const confirmedJob = jobIdentity(initialStatus.raw);
1117
+ const jobName = initialStatus.raw.subtask_name || initialStatus.raw.gcode_file;
1118
+ await this.confirmHardwareAction(`Clear reported hardware errors on ${serial}: ${codes.map(describeHmsKey).join(", ")}?${jobName ? ` Current job: ${String(jobName)}.` : ""} Inspect the printer and resolve the physical cause first. Confirm only after removing obstructions and correcting the fault.`, true);
1106
1119
  const beforeDispatch = async () => {
1107
1120
  assertActive();
1108
- const current = codesFor(await this.getSafetyStatus(host, serial, token));
1121
+ const currentStatus = await this.getSafetyStatus(host, serial, token);
1122
+ if (jobIdentity(currentStatus.raw) !== confirmedJob) throw new Error("Printer job changed before clearing hardware errors. Inspect the current job and confirm again; nothing further sent.");
1123
+ const current = codesFor(currentStatus);
1109
1124
  if (JSON.stringify(current) !== JSON.stringify(codes)) throw new Error("Hardware errors changed before clearing. Inspect the new report before retrying.");
1110
1125
  assertActive();
1111
1126
  };
@@ -1113,7 +1128,10 @@ export class BambuImplementation {
1113
1128
  const printer = dispatch ? undefined : await this.getPrinter(host, serial, token);
1114
1129
  assertActive();
1115
1130
  if (dispatch) await dispatch(assertActive, beforeDispatch);
1116
- else await printer!.publish({ print: { command: "clean_print_error", sequence_id: "0" } });
1131
+ else {
1132
+ await beforeDispatch();
1133
+ await printer!.publish({ print: { command: "clean_print_error", sequence_id: "0" } });
1134
+ }
1117
1135
  this.clearedErrors.set(serial, codes);
1118
1136
  await sleep(COMMAND_SETTLE_MS);
1119
1137
  return { status: "success", message: "Confirmed HMS clear command sent. The next print requires acknowledgment of these cleared codes.", cleared_codes: codes };
@@ -126,6 +126,21 @@ function finiteNumber(value: unknown): number | undefined {
126
126
  const number = Number(value);
127
127
  return Number.isFinite(number) ? number : undefined;
128
128
  }
129
+
130
+ /**
131
+ * X2D retains FAILED after a canceled job even with no active print error.
132
+ * Bambu Studio classifies FAILED as a finished job; its v02.08.02.61
133
+ * hms_en_20P table (926a7192574bcb9b3a732e1ec59a46d79cb45466)
134
+ * calls 0300400C "The task was canceled."
135
+ * Only this observed terminal condition qualifies, never an arbitrary failure.
136
+ * Callers still validate HMS, identity, hardware and material configuration,
137
+ * and print dispatch must obtain job-bound physical bed-clearance confirmation.
138
+ */
139
+ export function isCancelledX2DJob(raw: Record<string, any>, model: string): boolean {
140
+ return normalizeModel(model) === "x2d" && raw.gcode_state === "FAILED" &&
141
+ finiteNumber(raw.print_error) === 0 && finiteNumber(raw.fail_reason) === 0x0300400c &&
142
+ [raw.gcode_file, raw.subtask_name].some(value => typeof value === "string" && value.trim().length > 0);
143
+ }
129
144
  const token = (value: unknown) => typeof value === "string" ? value.trim().toLowerCase().replace(/[\s_-]/g, "") : "";
130
145
  function nozzleTypeAndFlow(value: unknown): {type?: string; flow?: string} {
131
146
  const text = String(value ?? "");
@@ -304,8 +319,9 @@ function logHiddenNotices(raw: Record<string, any>, serial: string, model: strin
304
319
 
305
320
  function validateErrors(raw: Record<string,any>, requireIdle: boolean, serial: string, model: string) {
306
321
  const state = typeof raw.gcode_state === "string" ? raw.gcode_state.toUpperCase() : "UNKNOWN";
307
- if (requireIdle && !["IDLE","FINISH"].includes(state)) throw new Error(`Printer state ${state} is not safely idle.`);
308
- if (!requireIdle && !["IDLE","FINISH","RUNNING","PAUSE"].includes(state)) throw new Error(`Printer state ${state} is unknown or failed.`);
322
+ const cancelled = isCancelledX2DJob(raw, model);
323
+ if (requireIdle && !["IDLE","FINISH"].includes(state) && !cancelled) throw new Error(`Printer state ${state} is not safely idle.`);
324
+ if (!requireIdle && !["IDLE","FINISH","RUNNING","PAUSE"].includes(state) && !cancelled) throw new Error(`Printer state ${state} is unknown or failed.`);
309
325
  if (finiteNumber(raw.print_error) !== 0) throw new Error("Printer reports a print error or did not report its error state.");
310
326
  if (!Array.isArray(raw.hms)) throw new Error("Printer HMS error state is missing or malformed.");
311
327
  for (const reported of raw.hms) {
@@ -2255,24 +2255,25 @@ export class STLManipulator extends EventEmitter {
2255
2255
  if (!this.activeOperations.get(operationId)) throw new Error("Operation cancelled");
2256
2256
  if (progressCallback) progressCallback(75, "Finding largest flat surface...");
2257
2257
 
2258
- // Find the group with the largest total area (excluding near-vertical faces)
2258
+ // Include already-horizontal faces: excluding Z-aligned normals can
2259
+ // stand a flat model on its edge, including on a repeated layFlat call.
2259
2260
  let largestArea = 0;
2260
2261
  let targetNormal: THREE.Vector3 | null = null;
2261
- const upVector = new THREE.Vector3(0, 1, 0); // Assuming Y is up for most models initially?
2262
2262
  const downVector = new THREE.Vector3(0, 0, -1); // Target normal (pointing down)
2263
2263
 
2264
+ // Faces are grouped by direction, so a part whose flat faces are all
2265
+ // horizontal has equal up- and down-facing areas. On a tie, keep the
2266
+ // face that already points down so a seated part is not flipped.
2264
2267
  for (const group of normalGroups.values()) {
2265
- // Check if the normal is reasonably horizontal (not too close to vertical Z)
2266
- // Angle threshold could be adjusted (e.g., > 5 degrees from Z axis)
2267
- if (Math.abs(group.representativeNormal.z) < 0.99 && group.totalArea > largestArea) {
2268
+ const tied = targetNormal !== null && Math.abs(group.totalArea - largestArea) <= largestArea * 1e-6;
2269
+ if (tied ? group.representativeNormal.z < targetNormal!.z : group.totalArea > largestArea) {
2268
2270
  largestArea = group.totalArea;
2269
2271
  targetNormal = group.representativeNormal;
2270
2272
  }
2271
2273
  }
2272
2274
 
2273
2275
  if (!targetNormal) {
2274
- // If no suitable horizontal face found, maybe pick the lowest Z face?
2275
- // For now, throw an error or return unchanged.
2276
+ // Only a mesh without any face area reaches this.
2276
2277
  console.warn("Could not find a suitable large flat face to lay down. No changes made.");
2277
2278
  this.emit('operationComplete', { operationId, type: 'layFlat', success: true, output: stlFilePath, message: "No suitable flat face found." });
2278
2279
  return stlFilePath;