bambu-printer-mcp 1.1.92 → 1.1.94
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/README.md +6 -2
- package/dist/3mf_parser.js +3 -2
- package/dist/cad/contracts.js +9 -0
- package/dist/cad-engine.d.ts +5 -0
- package/dist/cad-engine.js +34 -0
- package/dist/counterpart/flight-tools.d.ts +2 -2
- package/dist/counterpart/info.d.ts +2 -0
- package/dist/counterpart/info.js +6 -1
- package/dist/counterpart/make-3mf.d.ts +10 -0
- package/dist/counterpart/make-3mf.js +472 -65
- package/dist/counterpart/model-plates.d.ts +8 -1
- package/dist/counterpart/model-plates.js +9 -4
- package/dist/counterpart/plate-filaments.d.ts +19 -0
- package/dist/counterpart/plate-filaments.js +72 -10
- package/dist/counterpart/remote.js +1 -0
- package/dist/counterpart/schemas.d.ts +7 -2
- package/dist/counterpart/schemas.js +1 -0
- package/dist/counterpart/self-check.d.ts +79 -0
- package/dist/counterpart/self-check.js +163 -0
- package/dist/index.js +12 -2
- package/dist/printers/bambu.js +27 -19
- package/dist/printers/report-merge.d.ts +12 -0
- package/dist/printers/report-merge.js +46 -0
- package/dist/stl/stl-manipulator.js +79 -20
- package/dist/tool-annotations.js +1 -0
- package/package.json +6 -1
- package/src/3mf_parser.ts +3 -2
- package/src/cad/contracts.ts +10 -0
- package/src/cad/project3mf.py +426 -0
- package/src/cad/worker.py +6 -2
- package/src/cad-engine.ts +31 -0
- package/src/counterpart/info.ts +7 -1
- package/src/counterpart/make-3mf.ts +446 -61
- package/src/counterpart/model-plates.ts +17 -5
- package/src/counterpart/plate-filaments.ts +75 -7
- package/src/counterpart/remote.ts +1 -0
- package/src/counterpart/schemas.ts +3 -1
- package/src/counterpart/self-check.ts +164 -0
- package/src/index.ts +13 -2
- package/src/printers/bambu.ts +27 -19
- package/src/printers/report-merge.ts +48 -0
- package/src/stl/stl-manipulator.ts +75 -14
- package/src/tool-annotations.ts +1 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Merging Bambu MQTT reports. P1/A1 printers push only what changed, so a merged report keeps every field until the
|
|
3
|
+
* printer sends it again. A new job's first pushes can carry its name and layer count before its layer number, and the
|
|
4
|
+
* previous job's last layer then read against the new total ("315/150"). Until the new job reports its own progress,
|
|
5
|
+
* its report has none.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Fields that name the job a report describes. The layer count is not one: a running job's count can be revised, and a
|
|
9
|
+
* different job differs in its name, file or task id.
|
|
10
|
+
*/
|
|
11
|
+
const JOB_FIELDS = ["subtask_name", "gcode_file", "task_id"];
|
|
12
|
+
/** A new job prepares (PREPARE, SLICING) after any end; RUNNING straight after FAILED is that job resuming. */
|
|
13
|
+
const PREPARING = new Set(["PREPARE", "SLICING"]);
|
|
14
|
+
const DONE = new Set(["FINISH", "IDLE"]);
|
|
15
|
+
/** The previous job's progress, left out of a new job's report until the printer reports the new job's own. */
|
|
16
|
+
const JOB_PROGRESS = ["layer_num", "mc_percent", "mc_remaining_time"];
|
|
17
|
+
/** A job field's value, or undefined for a placeholder: empty, or 0 (LAN prints report task_id "0"). */
|
|
18
|
+
function named(value) {
|
|
19
|
+
const text = value === undefined || value === null ? "" : String(value).trim();
|
|
20
|
+
return text === "" || text === "0" ? undefined : text;
|
|
21
|
+
}
|
|
22
|
+
/** True when update describes a different job than the report merged before it. */
|
|
23
|
+
export function startsNewJob(previous, update) {
|
|
24
|
+
if (!previous)
|
|
25
|
+
return false;
|
|
26
|
+
for (const field of JOB_FIELDS) {
|
|
27
|
+
const before = named(previous[field]), after = named(update[field]);
|
|
28
|
+
if (before !== undefined && after !== undefined && before !== after)
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
const before = String(previous.gcode_state), after = String(update.gcode_state);
|
|
32
|
+
return (DONE.has(before) || before === "FAILED") && PREPARING.has(after) || DONE.has(before) && after === "RUNNING";
|
|
33
|
+
}
|
|
34
|
+
/** The previous job's progress fields to leave out when update starts a new job without reporting them. */
|
|
35
|
+
export function newJobResets(previous, update) {
|
|
36
|
+
if (!startsNewJob(previous, update))
|
|
37
|
+
return [];
|
|
38
|
+
return JOB_PROGRESS.filter(field => update[field] === undefined && previous?.[field] !== undefined);
|
|
39
|
+
}
|
|
40
|
+
/** previous merged with update, without the previous job's progress when update starts a new one (newJobResets). */
|
|
41
|
+
export function mergeBambuReport(previous, update) {
|
|
42
|
+
const merged = { ...previous, ...update };
|
|
43
|
+
for (const field of newJobResets(previous, update))
|
|
44
|
+
delete merged[field];
|
|
45
|
+
return merged;
|
|
46
|
+
}
|
|
@@ -10,7 +10,7 @@ import path from 'path';
|
|
|
10
10
|
import { promisify } from 'util';
|
|
11
11
|
import { EventEmitter } from 'events';
|
|
12
12
|
import * as crypto from 'crypto';
|
|
13
|
-
import {
|
|
13
|
+
import { spawn } from 'child_process';
|
|
14
14
|
import { keepSlice, restoreSlice, sliceCacheKey } from '../slicer/slice-cache.js';
|
|
15
15
|
import { listModelPlates } from '../counterpart/model-plates.js';
|
|
16
16
|
import { flattenForCli, detectProfilesRoot, resolveBblMachineProfile } from '../slicer/profile-flatten.js';
|
|
@@ -169,6 +169,32 @@ function slicerResultText(result) {
|
|
|
169
169
|
...plates.map(plate => plate && typeof plate === "object" ? plate.warning_message : undefined),
|
|
170
170
|
].filter((text) => typeof text === "string" && text.trim() !== "").map(text => text.trim()).join("\n");
|
|
171
171
|
}
|
|
172
|
+
/** The output kept from each stream, as execFile's default maxBuffer; the rest is dropped, not failed. */
|
|
173
|
+
const SLICER_OUTPUT_LIMIT = 1024 * 1024;
|
|
174
|
+
/**
|
|
175
|
+
* execFile for the slicer, with detached passed through (execFile drops it): on POSIX the slicer then leads its own
|
|
176
|
+
* process group, so a cancel can stop the helpers it starts too. The callback gets what execFile's would.
|
|
177
|
+
*/
|
|
178
|
+
function execSlicer(file, args, env, detached, callback) {
|
|
179
|
+
// stdin is ignored, as execFile ends it: no slicer reads it.
|
|
180
|
+
const child = spawn(file, args, { ...(env ? { env } : {}), detached, stdio: ["ignore", "pipe", "pipe"] });
|
|
181
|
+
let stdout = "", stderr = "", settled = false;
|
|
182
|
+
const keep = (text, chunk) => text.length >= SLICER_OUTPUT_LIMIT ? text : (text + chunk.toString("utf8")).slice(0, SLICER_OUTPUT_LIMIT);
|
|
183
|
+
child.stdout?.on("data", (chunk) => { stdout = keep(stdout, chunk); });
|
|
184
|
+
child.stderr?.on("data", (chunk) => { stderr = keep(stderr, chunk); });
|
|
185
|
+
const finish = (error) => { if (!settled) {
|
|
186
|
+
settled = true;
|
|
187
|
+
callback(error, stdout, stderr);
|
|
188
|
+
} };
|
|
189
|
+
child.on("error", error => finish(Object.assign(error, { cmd: [file, ...args].join(" ") })));
|
|
190
|
+
child.on("close", (code, signal) => {
|
|
191
|
+
if (code === 0 && !signal)
|
|
192
|
+
return finish(null);
|
|
193
|
+
const cmd = [file, ...args].join(" ");
|
|
194
|
+
finish(Object.assign(new Error(`Command failed: ${cmd}\n${stderr}`), { code, signal, killed: child.killed, cmd }));
|
|
195
|
+
});
|
|
196
|
+
return child;
|
|
197
|
+
}
|
|
172
198
|
function describeSlicerFailure(error, stdout, stderr, cli) {
|
|
173
199
|
const status = typeof error.signal === "string" && error.signal
|
|
174
200
|
? `crashed with ${error.signal}`
|
|
@@ -1667,11 +1693,19 @@ export class STLManipulator extends EventEmitter {
|
|
|
1667
1693
|
const launch = await prepareSlicerLaunch(slicerType, this.tempDir);
|
|
1668
1694
|
const stallSeconds = launch.stallSeconds;
|
|
1669
1695
|
let stalled = false;
|
|
1696
|
+
let cancelled = false;
|
|
1670
1697
|
// Execute the slicer
|
|
1671
1698
|
try {
|
|
1672
1699
|
await new Promise((resolve, reject) => {
|
|
1673
|
-
|
|
1674
|
-
|
|
1700
|
+
// POSIX: the slicer leads its own process group, so stopping it also stops the helpers it starts.
|
|
1701
|
+
const group = globalThis.process.platform !== 'win32';
|
|
1702
|
+
const process = execSlicer(slicerPath, args, launch.env, group, (error, stdout, stderr) => {
|
|
1703
|
+
if (cancelled) {
|
|
1704
|
+
// Settled once the slicer and every process sharing its output have gone, so its folder is removed after
|
|
1705
|
+
// nothing can write to it.
|
|
1706
|
+
reject(new Error("Slicing operation cancelled"));
|
|
1707
|
+
}
|
|
1708
|
+
else if (stalled && error) {
|
|
1675
1709
|
reject(stalledSlicerError(slicerType, stallSeconds));
|
|
1676
1710
|
}
|
|
1677
1711
|
else if (error) {
|
|
@@ -1691,29 +1725,53 @@ export class STLManipulator extends EventEmitter {
|
|
|
1691
1725
|
// Optional: Add listeners for stdout/stderr for real-time progress if slicer provides it
|
|
1692
1726
|
// process.stdout?.on('data', (data) => { console.error(`Slicer stdout: ${data}`); });
|
|
1693
1727
|
// process.stderr?.on('data', (data) => { console.error(`Slicer stderr: ${data}`); });
|
|
1694
|
-
//
|
|
1728
|
+
// Stops the slicer and, on POSIX, its whole process group (a group already gone is not an error).
|
|
1729
|
+
const stop = (signal) => {
|
|
1730
|
+
try {
|
|
1731
|
+
if (group && process.pid !== undefined)
|
|
1732
|
+
globalThis.process.kill(-process.pid, signal);
|
|
1733
|
+
else
|
|
1734
|
+
process.kill(signal);
|
|
1735
|
+
}
|
|
1736
|
+
catch (killError) {
|
|
1737
|
+
if (killError.code !== 'ESRCH')
|
|
1738
|
+
console.error(`Could not send ${signal} to the slicer:`, killError);
|
|
1739
|
+
}
|
|
1740
|
+
};
|
|
1741
|
+
// Check for cancellation periodically: the slicer is stopped, and the call settles when it has gone.
|
|
1742
|
+
let forceKill;
|
|
1743
|
+
let abandon;
|
|
1695
1744
|
const checkCancel = setInterval(() => {
|
|
1696
1745
|
if (!this.activeOperations.get(operationId)) {
|
|
1697
1746
|
clearInterval(checkCancel);
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1747
|
+
cancelled = true;
|
|
1748
|
+
stop('SIGTERM');
|
|
1749
|
+
// A slicer or helper that ignores SIGTERM is killed outright rather than waited on. A helper outside the
|
|
1750
|
+
// group (daemonized, or any helper on Windows) can still hold the output pipes, so 'close' never comes:
|
|
1751
|
+
// a second later the pipes are let go and the cancel settles.
|
|
1752
|
+
forceKill = setTimeout(() => {
|
|
1753
|
+
stop('SIGKILL');
|
|
1754
|
+
abandon = setTimeout(() => {
|
|
1755
|
+
process.stdout?.destroy();
|
|
1756
|
+
process.stderr?.destroy();
|
|
1757
|
+
reject(new Error("Slicing operation cancelled"));
|
|
1758
|
+
}, 1000);
|
|
1759
|
+
}, 5000);
|
|
1706
1760
|
}
|
|
1707
1761
|
}, 500);
|
|
1708
|
-
process.on('exit', () =>
|
|
1709
|
-
|
|
1762
|
+
process.on('exit', () => {
|
|
1763
|
+
// Exit can precede a client cancel while a helper retains output pipes; polling runs until close.
|
|
1764
|
+
// A helper that outlived the slicer still holds its output; finish it so the call can settle.
|
|
1765
|
+
if (cancelled && group)
|
|
1766
|
+
stop('SIGKILL');
|
|
1767
|
+
});
|
|
1768
|
+
// The deadline runs until every process sharing the slicer's output has let go, not only the slicer.
|
|
1769
|
+
process.on('close', () => { clearInterval(checkCancel); clearTimeout(forceKill); clearTimeout(abandon); });
|
|
1770
|
+
process.on('error', () => { clearInterval(checkCancel); clearTimeout(forceKill); clearTimeout(abandon); });
|
|
1710
1771
|
watchForStall(process, stallSeconds, () => {
|
|
1711
1772
|
stalled = true;
|
|
1712
1773
|
console.error(`${slicerType} used no CPU and wrote nothing for ${stallSeconds} s; stopping it as waiting on a dialog.`);
|
|
1713
|
-
|
|
1714
|
-
process.kill('SIGKILL');
|
|
1715
|
-
}
|
|
1716
|
-
catch { /* its exit is reported through the callback */ }
|
|
1774
|
+
stop('SIGKILL');
|
|
1717
1775
|
});
|
|
1718
1776
|
});
|
|
1719
1777
|
}
|
|
@@ -1753,8 +1811,9 @@ export class STLManipulator extends EventEmitter {
|
|
|
1753
1811
|
catch (error) {
|
|
1754
1812
|
console.error(`Slicing failed for ${stlFilePath}:`, error);
|
|
1755
1813
|
// Nothing in a failed or cancelled slice's folder is handed back (its result.json is already in the error).
|
|
1756
|
-
if (sliceDir)
|
|
1757
|
-
await fs.promises.rm(sliceDir, { recursive: true, force: true }).
|
|
1814
|
+
if (sliceDir) {
|
|
1815
|
+
await fs.promises.rm(sliceDir, { recursive: true, force: true }).then(() => console.error(`Removed the folder of the failed or cancelled slice: ${sliceDir}`), removeError => console.error(`Could not remove the folder of the failed or cancelled slice ${sliceDir}:`, removeError));
|
|
1816
|
+
}
|
|
1758
1817
|
this.emit('operationError', {
|
|
1759
1818
|
operationId,
|
|
1760
1819
|
type: 'slice',
|
package/dist/tool-annotations.js
CHANGED
|
@@ -44,6 +44,7 @@ export const TOOL_ANNOTATIONS = {
|
|
|
44
44
|
list_templates: READ_LOCAL,
|
|
45
45
|
get_slice_settings: LOCAL_OUTPUT, // a 3MF's settings are extracted to a fixed file in the temporary directory
|
|
46
46
|
counterpart_printer_info: READ_LOCAL, // configuration and capabilities; sends nothing to the printer
|
|
47
|
+
counterpart_self_check: READ_LOCAL, // loads this install's own modules; sends nothing to the printer
|
|
47
48
|
counterpart_setup_fields: READ_LOCAL, // the settings this server reads; no configured values
|
|
48
49
|
// Local outputs in the server's temporary directory
|
|
49
50
|
extend_stl_base: LOCAL_OUTPUT,
|
package/package.json
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bambu-printer-mcp",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.94",
|
|
4
4
|
"description": "MCP server for Bambu Lab 3D printers with STL manipulation, slicing, and print management",
|
|
5
|
+
"counterpart": {
|
|
6
|
+
"contract": "counterpart/1",
|
|
7
|
+
"notes": "Writes and edits multi-part, multi-colour 3MF projects and reports each plate’s parts and colours.",
|
|
8
|
+
"autoUpdate": true
|
|
9
|
+
},
|
|
5
10
|
"main": "dist/index.js",
|
|
6
11
|
"repository": {
|
|
7
12
|
"type": "git",
|
package/src/3mf_parser.ts
CHANGED
|
@@ -5,6 +5,7 @@ import * as fs from 'fs/promises';
|
|
|
5
5
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
6
6
|
import { createHash, randomUUID } from 'node:crypto';
|
|
7
7
|
import * as path from 'node:path';
|
|
8
|
+
import { readSafe3mfArchive } from './safety/archive.js';
|
|
8
9
|
|
|
9
10
|
// Parses Bambu Studio's JSON config data
|
|
10
11
|
function parseBambuJSONConfig(jsonData: any): Partial<BambuSlicerConfig> {
|
|
@@ -511,8 +512,8 @@ export async function analyze3MFPlateObjects(
|
|
|
511
512
|
filePath: string,
|
|
512
513
|
plateIndex: number = 0
|
|
513
514
|
): Promise<ThreeMFPlateObjects> {
|
|
514
|
-
|
|
515
|
-
const zip = await
|
|
515
|
+
// Bounded, with colliding or inconsistent entry names refused, as the other 3MF reads here.
|
|
516
|
+
const { zip } = await readSafe3mfArchive(filePath);
|
|
516
517
|
const plateNumber = plateIndex + 1;
|
|
517
518
|
const sliceInfo = zip.file('Metadata/slice_info.config');
|
|
518
519
|
if (!sliceInfo) {
|
package/src/cad/contracts.ts
CHANGED
|
@@ -231,6 +231,15 @@ export const CAD_TOOLS = [
|
|
|
231
231
|
description:
|
|
232
232
|
"The script's own print() output from this run, capped at 4000 characters (build.log keeps the rest). The script's words, not a measurement by the engine.",
|
|
233
233
|
},
|
|
234
|
+
three_mf: {
|
|
235
|
+
type: "string",
|
|
236
|
+
description: "When build() returned project_3mf(): the written 3MF project, ready for slice_stl.",
|
|
237
|
+
},
|
|
238
|
+
three_mf_project: {
|
|
239
|
+
type: "object",
|
|
240
|
+
description:
|
|
241
|
+
"When build() returned project_3mf(): base (the edited input alias, or null for a new project), changes, and the written file read back as list_3mf_plates reads it (plates with build_items, parts and filaments; project_filaments).",
|
|
242
|
+
},
|
|
234
243
|
seconds: { type: "number" },
|
|
235
244
|
},
|
|
236
245
|
[
|
|
@@ -385,6 +394,7 @@ Captured mesh preparation: load_scan(name, source_units="m" or "mm", up_axis="x"
|
|
|
385
394
|
Fit reference workflow: return load_scan("scan", source_units="m", up_axis="y") from build() in mode: "mesh" to export an unchanged, prepared reference STL for cad_check_fit. Declare every linked OBJ/MTL/texture asset. If you crop, simplify, fill, or otherwise alter this reference, report exactly what you excluded/changed and that the fit check proves only that reduced reference in the stated pose. A fit check against a scan is information; it must never resize or override an interface specified by measured dimensions. Keep those measured interfaces and report the discrepancy.
|
|
386
395
|
Result selection and edits: set final: true only on the result you select. cad-result.json in each immediate run folder is protected from script writes and retains final, completed_at, lineage_id (source hash), full checks and artifact paths; clients can discover the latest completed final record after restart without rebuilding. Final is a selection marker, not a replacement for valid/checks. Queued calls may expire with cad-queue-timeout before dispatch; do not automatically replay. Unchanged declared files reuse a read-only content-addressed bundle under output_dir/.cad-inputs, preserving filenames and restricting reads to that bundle. Keep this shared cache with the saved runs.
|
|
387
396
|
Mesh cleanup workflow: return a trimesh.Trimesh in mode: "mesh". Load the prepared mesh, fit needed geometry with NumPy/SciPy, rebuild regular sections/features with build123d or manifold3d CrossSection/extrusion/revolve, and combine meshes with manifold3d booleans. scikit-image supplies marching cubes for voxel/SDF work; Shapely supplies planar operations; Pillow supplies image/texture reads. Keep numeric choices in P and regenerate from declared inputs. Validate closure, winding, manifold status, dimensions and all six views using cad_run. What to regularise, infer, preserve or label comes from the caller's cleanup rules, not this engine prompt.
|
|
397
|
+
Multi-colour 3MF projects: build() may return project_3mf() instead of a shape. A new project: p = project_3mf(); p.add_part(shape, name="Lid", filament=2, object="Box", plate=1) for each part (parts that share object= are one object, printed as one piece; plates from 1), in solid mode with build123d shapes (the checks fuse each object's parts) or mode: "mesh" with trimesh parts. Editing a designer's 3MF: declare it as an input and p = project_3mf("kit") in mode: "mesh"; p.objects lists its objects (name, id, plate; p.object(id or unique name)) and their parts (name, id, filament, painted, mesh: a trimesh in the object's frame); p.add_part(shape, name=..., filament=..., object="Body") adds a part in that object's frame, p.replace_part(part, mesh) swaps a part's mesh (its painting goes with the old mesh) and p.set_part(part, name=..., filament=...) renames or recolours one; everything else in the file (print settings, painting, plates, other parts) is kept. cad_run writes <name>.3mf beside the STL and returns three_mf and three_mf_project (each plate's parts and filaments, read back from the file); slice it with slice_stl, never by rebuilding it from the STL.
|
|
388
398
|
Captured scan touch-up: t = scan_touchup(load_scan("scan", source_units="m", up_axis="y", ground=False), colour="colour", normal="normal", edge_mm=0.4) takes a textured capture (declare its OBJ, MTL and colour and normal map PNGs as inputs; pass the map aliases). It removes loose pieces and spikes, closes holes and refines to edge_mm without shrinking the body. t.regions() prints the colour regions (id, colour, area, size, flatness; 0 is the body) to build.log and saves regions.png in the run folder: read both, then name regions by id in the same scan and edge_mm. t.flatten(ids, shape="plane" or "curved"), t.bead(id, diameter_mm, proud_mm), t.cord(id, diameter_mm, proud_mm) (a cord follows its region's own curve) and t.seat(height_mm) record steps; return t.mesh(relief_gain=1.0), which adds the normal map's measured relief, applies the steps with manifold3d and prints its changes. Keep relief_gain at 1: a larger gain amplifies the map's noise, not stitches. When the caller's rules call for a textile's relief the scan missed (fabric, knit, crochet the photos show raised), t.texture_relief(height_mm, regions=None) raises its stitch pattern from the colour texture on the textile only (never flattened, beaded or corded regions); about 0.6 to 1.0 mm peak to peak prints visibly. It is off unless called: never for hard objects, printed graphics or labels.
|
|
389
399
|
The result includes paths, millimetre bounds/size, mesh and STEP volumes, solid count, watertight/manifold/winding/STEP checks, bodies (closest approach between solids, contact with the print plate at Z = 0, labelled bodies that are not one solid), problems, checked and not_checked, six orthographic renders (front, back, left, right, top, bottom), a perspective view from the front right and above, and a contact sheet with the perspective view large beside the six. Fix every entry in problems before selecting a result; an empty problems list proves nothing listed in not_checked. After every cad_run, Read its perspective view (renders.perspective, as the result's next says) before the next cad_run or any other change: a run you have not looked at tells you nothing about the form. Judge the form from the perspective view first: would a person recognise the product and want it? Then inspect all six; revise visible defects. Before the final run, list what the views show is wrong against the bought product you named (for a scan, the object in its photos), and fix each one or report it. To get a number out of a design (a spring force, a strain, a clearance you derived), print() it in the script: the result returns it as printed, with no need to make a run fail. A valid mesh or nominal parameter does not prove the requested dimension: measure the actual exported interfaces. Use cad_check_fit on a model and reference STL with an explicit rigid transform; report raw-scan interference and minimum gap. Calipers are authoritative but disagreement with a scan is unresolved measurement evidence, not permission to silently rescale it. Check assembly/insertion paths and actual articulated poses, not sums of local joint limits or reference points alone. Printing, clearance under load, supports and motion need separate evidence.
|
|
390
400
|
Fit, flexure and thread parameters: put each interface's nominal size, its source (measured, published, or assumed), the print correction, and the design fit in P as separate named values, so a fit report revises one number without resending the script. Model every dimension you claim: a parameter the geometry never uses (a wallet or case width that no cut or wall reads) is a defect; use it or remove it. Shape flexures so their bending lies in the layer plane of the exported print orientation, with the stroke, preload, and hard-stop gap as P values; build the stopped pose as well as the rest pose when checking. Model printed threads as explicit coarse geometry with the same pitch on both sides and clearance as a radial P offset; never scale a screw to clear its hole.
|