bambu-printer-mcp 1.1.84 → 1.1.86
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 +5 -0
- package/README.md +5 -2
- package/dist/cad/contracts.js +3 -1
- package/dist/design-guidance.d.ts +17 -6
- package/dist/design-guidance.js +156 -8
- package/dist/index.js +6 -2
- package/dist/printers/bambu.js +2 -2
- package/dist/safety/printer-state.d.ts +6 -2
- package/dist/safety/printer-state.js +10 -4
- package/package.json +3 -3
- package/src/cad/contracts.ts +3 -1
- package/src/design-guidance.ts +163 -11
- package/src/index.ts +6 -2
- package/src/printers/bambu.ts +2 -2
- package/src/safety/printer-state.ts +10 -4
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
|
+
| [Rowan McMahon (RowanMcMahon)](https://github.com/RowanMcMahon) | Reports A1 firmware 01.08.01.00 retaining `FAILED` after a stopped job and contributes the narrow terminal-state fix and regression tests in [#133](https://github.com/DMontgomery40/bambu-printer-mcp/pull/133). Supplies fresh MQTT evidence and reports a subsequent job reaching `FINISH`; this is contributor-reported status, not inspected physical-part verification. |
|
|
9
10
|
| [billh-hub](https://github.com/billh-hub) | Reports and isolates three official H2C time-lapse and filament-change command rejections in [#84](https://github.com/DMontgomery40/bambu-printer-mcp/issues/84), supplies emitted commands and multi-colour reproduction evidence, and distinguishes the unknown cooling parameter for source-backed investigation. The correction preserves independent safety checks; no maintainer physical printing is claimed. |
|
|
10
11
|
| [Steve Pritchard (sjpritchard)](https://github.com/sjpritchard) | Reports and diagnoses H2C per-variant first-layer temperature rejection in [#81](https://github.com/DMontgomery40/bambu-printer-mcp/issues/81), supplies the exact official preset metadata and reproduction, and identifies the upstream variant-mapping contract. Verification uses synthetic slicing and offline regressions, not physical printing. |
|
|
11
12
|
| [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. |
|
|
@@ -59,3 +60,7 @@ This is community recognition, separate from code authorship in this repository.
|
|
|
59
60
|
Thanks to the [MQTT.js contributors](https://github.com/mqttjs/MQTT.js/releases/tag/v5.16.1), [proxy-addr maintainers](https://github.com/jshttp/proxy-addr/releases/tag/v2.0.8), and [source-map-js maintainers](https://github.com/7rulnik/source-map-js) for the reconnect and security fixes incorporated in 1.1.31. This recognizes upstream dependency work separately from authorship in this repository.
|
|
60
61
|
|
|
61
62
|
Thanks to the [OrcaSlicer contributors](https://github.com/OrcaSlicer/OrcaSlicer/releases/tag/v2.5.0) for the published 2.5.0 source and macOS build used to reproduce and validate shared nozzle-flow metadata. This credits upstream software and contracts; it does not claim hardware verification or authorship of this repository’s fix.
|
|
63
|
+
|
|
64
|
+
Thanks to the [basic-ftp maintainers](https://github.com/patrickjuchli/basic-ftp/releases/tag/v6.2.6) and [MCP TypeScript SDK contributors](https://github.com/modelcontextprotocol/typescript-sdk) for compatible patch updates, including the upstream recursive-download path traversal correction.
|
|
65
|
+
|
|
66
|
+
- **David Montgomery** — reports and reproduces the macOS installed-slicer `bamboo_model` test scratch leak (#139); the regression is verified with the real isolated Bambu Studio CLI and mocked scratch cleanup.
|
package/README.md
CHANGED
|
@@ -1505,12 +1505,15 @@ Resources follow the MCP resource protocol and can be read by calling `ReadResou
|
|
|
1505
1505
|
|
|
1506
1506
|
The server carries manufacturing judgment for agents that design or edit a model to print. It is served as MCP prompts, so the client attaches each piece when it applies; the server's `instructions` tell any client they exist.
|
|
1507
1507
|
|
|
1508
|
-
- `fdm_design` -- for every design or model-editing task. Plan how the object prints as part of the design: geometry, orientation, supports, colours and assembly, using the actual printer, filaments and slice. It keeps what the person asked for and judges overhangs, bridges and supports locally, with no fixed 45-degree or bridge-length ban.
|
|
1508
|
+
- `fdm_design` -- for every design or model-editing task. Plan how the object prints as part of the design: geometry, orientation, supports, colours and assembly, using the actual printer, filaments and slice. It keeps what the person asked for and judges overhangs, bridges and supports locally, with no fixed 45-degree or bridge-length ban. It also carries the everyday judgement for sizes (look published dimensions up, keep size, print correction and fit apart), for parts that hold something (compliant first, bending in the layer plane, strain by duty), for printed fasteners, and for stating support, fit and hold claims only with the check or slice number that shows them.
|
|
1509
|
+
- `fdm_fit` -- whenever a part meets a real object or another part: choose each fit by what that interface has to do (drop in and lift out, slide, locate, grip, clamp, snap, press in), why filament prints fit the way they do, mechanisms that absorb size uncertainty, cited starting clearances, and what to report per interface.
|
|
1510
|
+
- `fdm_flexures` -- whenever a part must flex, grip, snap, clip, spring, or hold something by bending: compliant architectures, strain chosen by duty, material and layer direction, bite at the forced opening, heat and creep.
|
|
1509
1511
|
- `fdm_multicolor` -- when several colours or support materials share a print: filament transitions across layers, colour placement, plate scheduling and flushing.
|
|
1510
|
-
- `fdm_assembly` -- when a split, accent insert or
|
|
1512
|
+
- `fdm_assembly` -- when a split, accent insert, joint or printed fastener could materially improve the result.
|
|
1511
1513
|
- `fdm_after_slice` -- a separate review turn after `slice_stl`, before presenting the manufacturing recommendation: keep, revise, or validate one specific uncertainty, using the returned `slicer_result`.
|
|
1512
1514
|
- `fdm_slicing` -- for every design or model-editing task, next to `fdm_design`: how this server's configured slicer (`SLICER_TYPE`) orients a model and generates supports, and how to check a choice with a checkpoint `slice_stl`. Its text follows the slicer: Bambu Studio's auto-orient and `enable_support`, or plainly that a slicer here doesn't orient or take support settings.
|
|
1513
1515
|
- `guidance://fdm/capability-guidance` (resource) -- planning bands and sources for bridges and overhangs, for when one is consequential and there is no sufficiently specific measured capability for the printer, material and profile.
|
|
1516
|
+
- `guidance://fdm/fit-by-function` (resource) -- the same text as the `fdm_fit` prompt, in resource form for clients that read resources.
|
|
1514
1517
|
|
|
1515
1518
|
mcp-3D-printer-server serves the same guidance.
|
|
1516
1519
|
|
package/dist/cad/contracts.js
CHANGED
|
@@ -284,5 +284,7 @@ Captured mesh preparation: load_scan(name, source_units="m" or "mm", up_axis="x"
|
|
|
284
284
|
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.
|
|
285
285
|
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.
|
|
286
286
|
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.
|
|
287
|
-
The result includes paths, millimetre bounds/size, mesh and STEP volumes, solid count, watertight/manifold/winding/STEP checks, six orthographic renders (front, back, left, right, top, bottom) and contact sheet. Inspect all six; revise visible defects. 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.
|
|
287
|
+
The result includes paths, millimetre bounds/size, mesh and STEP volumes, solid count, watertight/manifold/winding/STEP checks, six orthographic renders (front, back, left, right, top, bottom) and contact sheet. Inspect all six; revise visible defects. 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.
|
|
288
|
+
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.
|
|
289
|
+
Check insertion and articulated poses with cad_check_fit against each object state that matters (the bare product, the product in its case, and the case with its attachment as its own reference envelope), including the widest section on the way in. Report interference and minimum gap per state. In your summary, attach each "fits", "holds", and "prints without supports" claim to the check or slice number that shows it; a valid flag alone shows none of them. Apply fdm_design and fdm_slicing too, with fdm_fit and fdm_flexures when they apply; never invoke a printer as part of constructing CAD.`,
|
|
288
290
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Manufacturing guidance for agents that design printable models: David Montgomery's FDM design
|
|
3
|
-
* prompt pack (3 November 2026),
|
|
4
|
-
* MCP
|
|
5
|
-
* attach each piece.
|
|
3
|
+
* prompt pack (3 November 2026), with later fit, flexure and printed-fastener guidance in the
|
|
4
|
+
* same voice. Served as MCP prompts and resources; the other printer MCP (bambu-printer-mcp /
|
|
5
|
+
* mcp-3D-printer-server) serves the same text. Clients choose when to attach each piece.
|
|
6
6
|
*/
|
|
7
7
|
export interface DesignPrompt {
|
|
8
8
|
name: string;
|
|
@@ -10,10 +10,11 @@ export interface DesignPrompt {
|
|
|
10
10
|
description: string;
|
|
11
11
|
text: string;
|
|
12
12
|
}
|
|
13
|
-
export declare const FDM_CORE = "Design the finished object the user wants, with the manufacturing plan as part of the design. Preserve its function, fit, and visual identity. Use your design ability freely to make that outcome practical through geometry, orientation, materials, color placement, supports, and assembly.\n\nUse the actual printer and material context: nozzle arrangement and filament routing, build volume, nozzle and line widths, layer profile, cooling, available filaments, and relevant successful prints or calibration. Missing information is unknown, not a capability the printer automatically has. Use reasonable, labeled assumptions for reversible choices; ask only when an unknown materially changes the result.\n\nBefore committing to detailed geometry, choose a plausible way to manufacture and assemble it. For a consequential tradeoff, compare the strongest one-piece approach with a meaningfully different orientation or split. Simple parts do not need a design tournament. Judge total effort to obtain a good finished object: printing, consumed filament, likely rework, support cleanup, assembly, and extra hardware. Respect the user's priorities instead of applying fixed numerical weights.\n\nKeep assembled orientation and print orientation distinct. Preserve critical dimensions and mating surfaces. Account for measurement uncertainty and fit clearance separately; a scan or printed measuring tool does not establish its own accuracy. Use the smallest useful fit sample when uncertainty could otherwise waste a substantial print.\n\nEvaluate printability locally. Distinguish a progressively supported overhang, a bridge anchored at both ends, and a disconnected island. State overhang angles from vertical: 0 degrees is a vertical wall; 90 degrees is a horizontal underside. Convert conventions before setting slicer angles. Use relevant measured capability ahead of generic rules. A 45-degree threshold is not a universal support requirement, and a steep surface is not automatically unprintable. Judge bridge length along the actual unsupported extrusion path, with its anchors, cooling, material, and required underside quality. A feature that survives printing may still miss a cosmetic or dimensional requirement.\n\nResolve a difficult region with the least disruptive effective change: a better orientation, local geometry, suitable process settings, accessible support, a deliberate breakaway feature, or a split. Supports are an ordinary manufacturing option. Preserve attractive curves and useful complexity when modest support or cleanup achieves them. Check support removal and tool access, especially inside cavities. Avoid changing the whole object to solve a local problem.\n\nChoose layer orientation, material, walls, and joints for the actual loads and environment. Check the load path, flexing features, fastener access, and installation sequence. A reduction in supports or color changes must not silently weaken the part or defeat its fit.\n\nOn a shared-nozzle multicolor setup, reason about filament transitions across layers, including support-interface material. Total color count alone is a poor cost estimate. Consider color placement, shallow inlays, separately printed accents, and part orientation while preserving the requested appearance. Separate bodies on one layer-printed plate can still cause repeated swaps. Use the slicer's actual schedule and estimates when available; do not invent a fixed cost per color change.\n\nUse assembly when its benefit is worth the user's additional work. Design alignment, clearance, engagement, and assembly access deliberately. Glue is a valid planned joining method for suitable materials and loads; make joints self-locating and give them useful bonding area. Use mechanical retention when loads, repeated flexing, or serviceability call for it. State needed glue, hardware, tools, and assembly effort plainly. Avoid adding parts when a modest support or a simple one-piece print is the better result.\n\nVerify the chosen geometry in its actual print orientation and inspect the slice when tools permit. Check critical fits, missing or floating features, toolpaths, supports, color assignments, total time, and material consumption. Treat a slicer prediction as a prediction, not a physical test. Fix consequential problems and re-slice relevant changes. Stop when the design meets the brief and no remaining improvement justifies its cost.\n\nKeep the user-facing result short: the recommended design, why its manufacturing approach makes sense, how it prints and assembles, and any consequential unresolved assumption. Distinguish measured dimensions, slicer estimates, and untested predictions. Keep detailed analysis in the working process.";
|
|
13
|
+
export declare const FDM_CORE = "Design the finished object the user wants, with the manufacturing plan as part of the design. Preserve its function, fit, and visual identity. Use your design ability freely to make that outcome practical through geometry, orientation, materials, color placement, supports, and assembly.\n\nUse the actual printer and material context: nozzle arrangement and filament routing, build volume, nozzle and line widths, layer profile, cooling, available filaments, and relevant successful prints or calibration. Missing information is unknown, not a capability the printer automatically has. Use reasonable, labeled assumptions for reversible choices; ask only when an unknown materially changes the result.\n\nBefore committing to detailed geometry, choose a plausible way to manufacture and assemble it. For a consequential tradeoff, compare the strongest one-piece approach with a meaningfully different orientation or split. Simple parts do not need a design tournament. Judge total effort to obtain a good finished object: printing, consumed filament, likely rework, support cleanup, assembly, and extra hardware. Respect the user's priorities instead of applying fixed numerical weights.\n\nKeep assembled orientation and print orientation distinct. Preserve critical dimensions and mating surfaces. Account for measurement uncertainty and fit clearance separately; a scan or printed measuring tool does not establish its own accuracy. Use the smallest useful fit sample when uncertainty could otherwise waste a substantial print. When the request names a product, a vehicle, or a standard part, look up its published dimensions and use them, labelled as published. A size the person confirmed without changing a prefilled number is not a measurement. If a case, cover, or attachment is mentioned, the bare product's size is not the size to design to. Ask the person only for what no source gives, and where possible shape the design so an unmeasured dimension does not decide whether it works.\n\nChoose each fit by what that interface has to do: drop in and lift out, slide, locate without rattle, grip so it does not slip or turn, snap over, or press in to stay. There is no single fit number. Keep three things apart for each interface: the object's size and how sure it is, the correction this printer and orientation need (its own observed corrections first, when the context supplies them), and the fit the function calls for. When the size's uncertainty is wider than the function tolerates, do not answer with a better number: choose a mechanism that absorbs the difference (crush ribs, a split closed by a screw, a flexure, a snap), or ask for the one measurement that settles it. The same object changes with time and use: full and nearly empty, new and worn, soft and stiff. A fit that relies on the object giving way must still work in its stiffest, largest state, and a pocket is sized to the widest section the object passes through on the way in, with support where the object actually bears, not to its bounding box.\n\nEvaluate printability locally. Distinguish a progressively supported overhang, a bridge anchored at both ends, and a disconnected island. State overhang angles from vertical: 0 degrees is a vertical wall; 90 degrees is a horizontal underside. Convert conventions before setting slicer angles. Use relevant measured capability ahead of generic rules. A 45-degree threshold is not a universal support requirement, and a steep surface is not automatically unprintable. Judge bridge length along the actual unsupported extrusion path, with its anchors, cooling, material, and required underside quality. A feature that survives printing may still miss a cosmetic or dimensional requirement.\n\nResolve a difficult region with the least disruptive effective change: a better orientation, local geometry, suitable process settings, accessible support, a deliberate breakaway feature, or a split. Supports are an ordinary manufacturing option. Preserve attractive curves and useful complexity when modest support or cleanup achieves them. Check support removal and tool access, especially inside cavities. Avoid changing the whole object to solve a local problem.\n\nChoose layer orientation, material, walls, and joints for the actual loads and environment. Check the load path, flexing features, fastener access, and installation sequence. A reduction in supports or color changes must not silently weaken the part or defeat its fit.\n\nWhen a part must flex, grip, snap, clip, spring, or hold something, consider a compliant mechanism first: one piece that bends on purpose often beats rigid jaws plus a clamp bolt, with fewer parts, no fastener to buy or lose, and a hold that follows the object. Spread the bending over a long band, leaf, or arch rather than a short stub; keep the rest of the body stiff so the stroke goes where you intend; give a hand enough leverage; design the preload in; use an over-centre or cam where a hold must lock; and give every flexing direction a hard stop so a hard pull meets solid material. Keep the bending in the layer plane, where the filament runs along the strain; bending that pulls layers apart is far weaker and fails with little warning. Choose the strain by duty (bent once to assemble, bent every day, and held bent for months are different designs) and by material and direction, using the printer's own observed values when the context supplies them. Modern PLA and PETG grades are not brittle in this role: proven printed springs work daily at strains that older moulded-plastic tables would forbid. What usually ends a flexure is not a clean snap at a magic percentage but whitening and set at a sharp root, layers parting where the bend crosses them, or a held bend creeping loose, faster when warm. In sustained heat such as a parked car, a part held bent relaxes and a sun-heated dashboard can exceed what PLA or PETG carry under load: prefer a rest state that sits unstrained, and say so when the material cannot honestly do the job. A part a hand works has to be easy to work, and that is checked like its hold: say where the fingers go, how hard they push to open it, how far it opens, and how the object goes in and comes out with one hand. A grip that meets its force and is a fight to use has failed the brief.\n\nOn a shared-nozzle multicolor setup, reason about filament transitions across layers, including support-interface material. Total color count alone is a poor cost estimate. Consider color placement, shallow inlays, separately printed accents, and part orientation while preserving the requested appearance. Separate bodies on one layer-printed plate can still cause repeated swaps. Use the slicer's actual schedule and estimates when available; do not invent a fixed cost per color change.\n\nUse assembly when its benefit is worth the user's additional work. Design alignment, clearance, engagement, and assembly access deliberately. Glue is a valid planned joining method for suitable materials and loads; make joints self-locating and give them useful bonding area. Use mechanical retention when loads, repeated flexing, or serviceability call for it. State needed glue, hardware, tools, and assembly effort plainly. Avoid adding parts when a modest support or a simple one-piece print is the better result. A printed screw, nut, or threaded hole is an ordinary choice at hand sizes (M8 and up as the usual starting point, about M6 as the floor) with a coarse profile shaped to print without supports; below that floor, under sustained preload that must not relax, in heat, or under shock, a metal screw or insert is the honest choice. Keep threads out of the main load path where a shoulder, tenon, key, or serrated face can carry shear and torque, and let the thread only hold the joint closed.\n\nVerify the chosen geometry in its actual print orientation and inspect the slice when tools permit. Check critical fits, missing or floating features, toolpaths, supports, color assignments, total time, and material consumption. Treat a slicer prediction as a prediction, not a physical test. Fix consequential problems and re-slice relevant changes. Stop when the design meets the brief and no remaining improvement justifies its cost. State \"prints without supports\", \"holds\", or \"fits\" only when the engine's own checks or the slice show it, and give the number that shows it; otherwise call it an untested prediction.\n\nKeep the user-facing result short: the recommended design, why its manufacturing approach makes sense, how it prints and assembles, and any consequential unresolved assumption. Distinguish measured dimensions, slicer estimates, and untested predictions. Say where each critical size came from (measured, published, or assumed) and what each interface is meant to do and how it fits. Keep detailed analysis in the working process.";
|
|
14
14
|
export declare const FDM_MULTICOLOR = "Apply this guidance when multiple colors or support materials share a print.\n\nPreserve the requested visual pattern. Evaluate its colors in build coordinates and across layers before committing to color geometry. On a shared nozzle, a small accent spanning many layers can create more transitions than a large region confined to a few layers. Count the slicer's actual transitions when available, including swaps back to a prior filament and support-interface swaps; color count and colored volume are only screening clues. On printers with multiple nozzles, evaluate each shared melt path; AMS slots are not independent nozzles.\n\nFor a costly pattern, consider the most promising alternatives: a different build orientation, color regions confined to fewer layers, shallow face inlays, or separately printed single-color pieces with intentional assembly. A vertical stripe in use may become a low-change feature in a different print orientation. Judge each option against load direction, surface quality, support burden, and the user's exact visual requirements. Finer layers can help an overhang while adding color-change layers; evaluate local adaptive layers and re-slice the combined plan.\n\nSeparating color bodies does not by itself eliminate swaps. Check plate scheduling. Single-color plates can remove repeated color changes; by-layer printing of different-color objects together usually cannot. Use sequential object printing only when supported and its clearance constraints are satisfied. Batch copies only when the user wants them.\n\nUse the actual directional flushing matrix and filament compatibility. Purging clears previous material; priming restores consistent extrusion. Track those separately when the slicer does. Flushing into compatible infill or supports may reduce discarded material, but it does not remove switching time, has finite capacity, and can affect appearance or strength. Do not add unnecessary infill or objects merely to hide waste.\n\nCompare the same requested quantity and finish. Report total filament and time across all plates, plus purge, tower, and support quantities only where available without double counting. Unknown metrics remain unknown. Recommend the original multicolor approach when the user values its seamless result enough to justify its cost.";
|
|
15
|
-
export declare const FDM_ASSEMBLY = "Apply this guidance when a split, insert, or joint may materially improve the result.\n\nCompare assembly against the best practical one-piece approach, including reasonable supports. A split earns its place by improving important surfaces, layer strength, fit, color efficiency, support access, repairability, or bed fit enough to justify handling and joining the pieces. Prefer a one-piece solution when its support cleanup is easier than assembly and the alternatives meet the other important requirements comparably well. Respect an explicit one-piece or no-glue requirement.\n\nPut boundaries where they are structurally sensible and visually deliberate. Use shoulders, keys, overlapping faces, tabs, or pins to locate parts and resist sliding or rotation as appropriate. Include fit clearance, lead-ins, adhesive space where needed, and a feasible insertion path. Check the assembled geometry and the order of operations, not only the separated pieces. Avoid joints whose screws, clamps, or mating faces become inaccessible during assembly.\n\nFor suitable lightly loaded rigid details, a locating pocket plus a compatible adhesive can be the simplest reliable solution. For a loaded clamp, a joint under peel or repeated bending, or a serviceable assembly, consider fasteners or mechanically captured geometry. Do not assume a tiny glued butt joint can carry the same load as an intact printed section. Select adhesive from evidence for the actual materials and conditions; superglue is an option, not a universal material property.\n\nState the practical consequence directly: which parts print in which orientations and colors, how they locate, how they are retained, which supplies are needed, and the estimated hands-on work. Keep hands-on time separate from adhesive cure time. Check a small joint sample only when its uncertain fit or strength would change the design decision.";
|
|
16
|
-
export declare const FDM_AFTER_SLICE = "Review this slice against the user's brief and the selected manufacturing plan. Use the returned slice, geometry, profile, and calibration evidence; do not assume missing metrics are zero.\n\nCheck that the actual toolpaths preserve critical features, fit, connected material, intended colors, and load-bearing sections. Inspect consequential first layers, bridges, islands, supported undersides, and removal access. Compare expected total print time, total material across all plates, and manual work with the best credible alternative. Keep purge, prime-tower, support, and model quantities distinct only when the data provides a non-overlapping breakdown.\n\nIf the plan is unexpectedly costly or fragile, identify the dominant cause and make the smallest change that preserves the brief. Re-slice after a relevant geometry, orientation, material, or process change. Do not optimize a minor imperfection at the expense of function or appearance, and do not invent a redesign simply to produce criticism.\n\nReturn a concise decision: keep, revise, or validate one specific uncertainty. Include the decisive evidence and the exact next action. A clean slice supports a printability prediction; it does not verify physical fit, strength, or bridge quality.";
|
|
15
|
+
export declare const FDM_ASSEMBLY = "Apply this guidance when a split, insert, or joint may materially improve the result.\n\nCompare assembly against the best practical one-piece approach, including reasonable supports. A split earns its place by improving important surfaces, layer strength, fit, color efficiency, support access, repairability, or bed fit enough to justify handling and joining the pieces. Prefer a one-piece solution when its support cleanup is easier than assembly and the alternatives meet the other important requirements comparably well. Respect an explicit one-piece or no-glue requirement.\n\nPut boundaries where they are structurally sensible and visually deliberate. Use shoulders, keys, overlapping faces, tabs, or pins to locate parts and resist sliding or rotation as appropriate. Include fit clearance, lead-ins, adhesive space where needed, and a feasible insertion path. Check the assembled geometry and the order of operations, not only the separated pieces. Avoid joints whose screws, clamps, or mating faces become inaccessible during assembly.\n\nFor suitable lightly loaded rigid details, a locating pocket plus a compatible adhesive can be the simplest reliable solution. For a loaded clamp, a joint under peel or repeated bending, or a serviceable assembly, consider fasteners or mechanically captured geometry. Do not assume a tiny glued butt joint can carry the same load as an intact printed section. Select adhesive from evidence for the actual materials and conditions; superglue is an option, not a universal material property.\n\nState the practical consequence directly: which parts print in which orientations and colors, how they locate, how they are retained, which supplies are needed, and the estimated hands-on work. Keep hands-on time separate from adhesive cure time. Check a small joint sample only when its uncertain fit or strength would change the design decision.\n\nPrinted threads need a profile made for printing, not a copy of a metal V-thread. A coarse, truncated thread whose flanks sit within the printer's proven overhang (one widely printed all-plastic kit uses about a 96-degree included angle, 42 degrees from vertical, at pitches of roughly 2-3 mm for M8-M12 sizes, cleared by roughly two tenths of a millimetre per side at the pitch line) prints upright without supports and keeps its teeth in solid wall loops. Keep the pitch exactly the same on screw and hole; make clearance by shifting the profile radially, never by scaling the screw, which changes the pitch and wedges after a few turns. Give a hand screw several full turns of engagement and a knob that limits how hard it can be torqued. A long, slender screw that must pull or bend is better printed flat or split so filament runs along its length than stood upright across its layers. Where preload must survive months, heat, or shock, or the size is below about M6-M8, use a metal screw or heat-set insert and say so. When the context supplies this printer's own thread fit observation, use it ahead of any generic allowance.";
|
|
16
|
+
export declare const FDM_AFTER_SLICE = "Review this slice against the user's brief and the selected manufacturing plan. Use the returned slice, geometry, profile, and calibration evidence; do not assume missing metrics are zero.\n\nCheck that the actual toolpaths preserve critical features, fit, connected material, intended colors, and load-bearing sections. Inspect consequential first layers, bridges, islands, supported undersides, and removal access. Compare expected total print time, total material across all plates, and manual work with the best credible alternative. Keep purge, prime-tower, support, and model quantities distinct only when the data provides a non-overlapping breakdown.\n\nIf the plan is unexpectedly costly or fragile, identify the dominant cause and make the smallest change that preserves the brief. Re-slice after a relevant geometry, orientation, material, or process change. Do not optimize a minor imperfection at the expense of function or appearance, and do not invent a redesign simply to produce criticism. Check every support, fit, and hold claim in the summary against a number from the slice or the engine's checks (support area and worst overhang, engagement and gap, estimated bite at the forced opening). A claim without its number comes out or is labelled a prediction.\n\nReturn a concise decision: keep, revise, or validate one specific uncertainty. Include the decisive evidence and the exact next action. A clean slice supports a printability prediction; it does not verify physical fit, strength, or bridge quality.";
|
|
17
|
+
export declare const FDM_FLEXURES = "Apply this guidance when a part must flex, grip, snap, clip, spring, or hold something by bending. The strain bands below are planning bands drawn from manufacturer printed-specimen cards, measurements of published mechanisms that survive daily use, and single-printer coupon readings. They are not guarantees and not rejection thresholds. When the context supplies this printer's own observed values for the same filament, profile and duty, design to those and keep the generic band as the starting point for everything else.\n\nA compliant design earns its place when one bending piece replaces rigid jaws, a hinge and a clamp bolt: fewer parts, nothing to buy or lose, one print, and a hold that follows the object as it varies. Prefer it for holders, clips, snaps, lids and latches a hand operates. Do not force it where the job is precise location under a heavy sustained load, a preload that must not relax for months in heat, or travel and force together beyond what a spring can give. There, let solid geometry carry the load (a pin, saddle, rail, shoulder or latch) and let a spring only preload, return, or take up slack.\n\nChoose the architecture before the dimensions. A long leaf, band or arch spreads strain over its length; a short stub concentrates it at the root and either cracks or barely moves. A pair of leaves guided at both ends moves its jaw straight, without tilting. Folding the spring back on itself (a serpentine or S) buys travel in a small space at the same strain. A thick curved arch gives a strong bite over a short opening. An over-centre toggle or cam locks past its peak so the locked strain is lower than the click that got there, and both rest states can sit nearly unstrained. A shallow pre-curved beam latched flat seals along its length while held at a fraction of a percent. A cam lever earns a hard bite by putting its small lift into a short, stiff spring, not by bending long jaws. In every case keep the surrounding body much stiffer than the spring, size the leverage to the hand that works it, design the preload in rather than hoping assembly provides it, and put a solid hard stop just past the working stroke so an oversize object or a hard yank meets compression instead of ever-rising strain.\n\nJudge bite at the opening the object actually forces, where the force is taken. The same clip is several times stiffer when a flat rigid object holds its jaws from turning than when a round finger lets them turn; one measured clip changed about fivefold between those contacts. Grip that must not slip is force times friction; feel and marking are pressure. A narrow ridge concentrates a modest force into a high pressure that seals, grips and, on skin, hurts; a broad flat jaw needs roughly an order of magnitude more force for the same pressure. State the opening, the contact you assumed, and the friction you used. Published dry static friction for printed PLA on itself spans roughly 0.12-0.38 (one printer read 0.25-0.31 on both faces) and PETG on itself roughly 0.13-0.21: use the low end when checking that a hold retains, the high end when checking that a hand can still insert it. Friction against the held object (a phone case, glass, paint) is unknown unless the context gives it; do not substitute the self-contact range for it.\n\nKeep the bending in the layer plane. Filament laid along the strained length carries the bend; a bend that pulls layers apart works at a fraction of that strength (across-layer tensile strength is roughly half to nine-tenths of in-plane depending on grade and test) and parts with little warning. Turn the part, split it, or reshape the spring so its length lies in the layers. If a bend across layers is truly unavoidable, keep its strain well below the in-plane bands, give it generous roots, and bring its hard stop close. Make the spring from continuous wall loops: choose its thickness as whole extrusion widths and enough walls that no sparse infill sits inside the neck. Taper toward the tip where travel allows, fillet every root or curve continuously through it, and never hang a spring from a sharp internal corner.\n\nChoose strain by duty first, then material. In the layer plane, as planning bands: held bent for months at room temperature, keep PLA to about 0.5% or less and PETG to about 1.4% or less, and prefer a shape whose rest state is unstrained so holding costs nothing; bent every day for hundreds to thousands of cycles, proven mechanisms commonly work at about 1.5-2.6% in PLA and about 2-3.4% in PETG; bent once to assemble, or touched only at the hard stop, PLA on one coupon-tested printer survived 3.3% once and ten times in both orientations without cracking, and proven PETG designs peak at about 4-4.3%. Treat those peaks as no-crack evidence, not proof of full spring-back: past roughly 3.3-3.4% PLA begins to whiten and take set in published printed-specimen testing, long before its published break elongation (about 12% in-plane for one current PLA grade), because break includes permanent deformation a spring cannot use. Older moulded-plastic snap allowances near 1-1.7% are not printed fracture limits; designing every spring to them produces weak, timid parts. Grade matters as much as polymer family: current cards put one PETG grade's tensile modulus near 2780 MPa and another's near 1810 MPa, so size force from the actual grade's card or an observed deflection (one printer's PLA measured about 2600 MPa, close to its 2580 MPa card), never from the family name alone.\n\nExpect, in order: a sharp root whitens, yields and takes set; a bend across layers delaminates; a held bend creeps and its force fades; only then does a well-shaped in-plane spring crack. Design so the first failure you would meet is harmless and visible, and so the hard stop prevents the rest.\n\nHeat changes the answer before it melts anything. PLA grades soften under load from roughly the mid-50s C (heat deflection about 54-57 C, glass transition about 60 C) and PETG grades from roughly the low 60s to about 70 C depending on grade and load (glass transition about 66-69 C); published creep tests already move faster after brief warming near 46 C. A sun-parked dashboard has been documented around 70 C within an hour. Judge by exposure and load together: a shaded, unloaded trim piece is not a loaded spring on a dashboard. For sun-exposed parts that must stay bent or carry load, neither PLA nor PETG is an honest default; prefer a higher-temperature filament the printer actually has, a rest state at zero strain while parked empty, and positive capture (lips, shelves, a latch) so friction alone never decides whether the object stays. Say plainly when the loaded filaments cannot do the thermal job instead of silently printing it anyway.\n\nIn the result, give the duty you designed for, how a hand operates it (where the fingers go and the force to open it at the tabs), the working and hard-stop strains and how you estimated them, the bite or spring force at the stated opening with its contact and friction assumptions, the rest strain, and the heat verdict. A force without its opening, or a strain without its duty, is not yet a claim.";
|
|
17
18
|
export declare const FDM_CAPABILITY_GUIDANCE = "# Bridges and overhangs: useful capability without arbitrary bans\n\nLoad this reference only when the feature matters to the manufacturing decision. These are proposed planning bands, not manufacturer guarantees, support-generation settings, or automatic acceptance/rejection rules.\n\n## Scope and terminology\n\nThe provisional baseline is an ordinary modern Bambu P-series-class FDM setup, a 0.4 mm nozzle, a suitable PLA profile, normal planar toolpaths, and effective part cooling. Actual printer/material/profile evidence takes priority. Do not transfer the same expectations unchanged to PETG, flexible materials, a different layer height, or a different cooling arrangement.\n\nAngles in the proposed review bands are measured **from vertical**: a vertical wall is 0 degrees; a horizontal underside is 90 degrees. Source values retain their stated or unresolved convention as noted. Slicer controls and test models can use a different convention. Establish their convention before comparing or entering a value. For a simple planar slope, the angle from the build plate is 90 degrees minus the angle from vertical.\n\nAn overhang grows sideways from material below. A conventional bridge has extruded paths anchored at both ends. A disconnected island begins with no suitable underlying material or anchorage. They require different decisions.\n\n## What the retrieved evidence establishes\n\n- Prusa's current modeling documentation gives a general 45\u201360 degree range depending on nozzle/settings, and describes up to 75 degrees for its specifically named Nextruder/360-degree-cooling machines. That is evidence against a universal 45-degree limit. It does not certify 75 degrees on every Bambu printer. [C1]\n- A Fab Academy 2026 hands-on comparison of Bambu P2S and H2S used matte-white PLA and reported 50 mm unsupported bridge strands without a visible problem. It also reported some drooping above 60 degrees on the overhang test. This is a useful documented result on particular geometry, not a population benchmark or proof of flat mating-surface accuracy. [C2]\n- An MIT HTMAA 2025 P1S characterization reported no noticeable defects on its longest tested bridge, 20 mm, and explicitly left the actual maximum unmeasured. A largest passing sample is not the machine's limit. [C3]\n- Bambu's PETG Basic V3.0 data sheet lists approximately 30 mm maximum bridging length and approximately 70 degrees maximum overhang; its PLA Tough+ V3.0 sheet lists 30 mm and 55 degrees. These are material-specific reference values. The retrieved sheets do not define the overhang angle convention or a bridge sag/finish acceptance criterion, so keep the angle values as reported rather than silently normalizing them. Do not assume the mechanical-specimen print conditions also describe these feature tests. [C4, C5]\n\nThe material sheets provide useful 30 mm reference points; the firsthand longer prints show why a published or configured maximum should not become a universal geometric prohibition. Filament formulation matters. Avoid a rule that all PLA must outperform all PETG.\n\n## Proposed review bands\n\nThese bands decide how much attention to give a feature. They never force a flat design, a split, supports, or a calibration print by themselves.\n\n| Feature on the provisional PLA setup | Working stance |\n| --- | --- |\n| Progressively supported overhang around 45\u201360 degrees | Keep an unsupported version as an ordinary candidate. Inspect local curvature, overlap, cooling, and required finish. |\n| Overhang around 60\u201370 degrees | Retain the shape as a candidate; examine local layer height, geometry, cooling, and relevant prior results more closely. Modest support is also an ordinary option. |\n| Overhang around 70 degrees or more | Require a stronger process/geometry justification to rely on a clean unsupported result. Consider a representative sample when its result would decide between substantially different plans. |\n| Conventional bridge up to about 20 mm | Treat as a plausible ordinary candidate when anchors, toolpaths, and underside requirements are suitable. |\n| Bridge roughly 20\u201350 mm | Keep bridging as a real design option. Pay more attention to actual unsupported path length, anchorage, width, cooling, and sag acceptance. |\n| Bridge beyond about 50 mm | Keep it in the design space; seek relevant prior evidence or a small representative test before depending on its quality for an expensive or precise part. |\n\nThe 60\u201370-degree and 20\u201350-mm bands are deliberate engineering priors for this app. They are not claims that a manufacturer has validated the whole interval. A 12 mm bridge can be unacceptable for a tight sliding surface; a much longer one may be adequate above a noncritical cavity. Avoid turning these bands into a hidden `max_bridge` or `max_overhang` rejection threshold.\n\n## A useful geometric check\n\nFor an idealized straight overhang at angle alpha from vertical, layer height h produces a lateral step:\n\n`step = h * tan(alpha)`\n\nUsing a nominal extrusion width w, a simple projected overlap estimate is:\n\n`overlap_fraction = max(0, 1 - step / w)`\n\nFor a 60-degree overhang and a 0.45 mm line width:\n\n| Layer height | Lateral step | Nominal overlap |\n| --- | --- | --- |\n| 0.20 mm | 0.346 mm | About 23% |\n| 0.12 mm | 0.208 mm | About 54% |\n\nThese values follow from geometry, not a printer test. The model omits bead shape, curved toolpaths, cooling, adhesion, and other effects. It explains why layer height can change the outlook; it cannot prove a print will succeed. Use the actual extrusion widths when known.\n\nOrdinary overhang-layer reasoning does not prescribe the best bridge extrusion. OrcaSlicer's documented thick-bridge mode uses a line height equal to nozzle diameter and trades a rougher surface for stronger, more reliable bridges and potentially longer spans. Inspect the actual selected mode instead of assuming bridge height equals ordinary layer height. [C6]\n\nReducing layer height throughout a multicolor part can also increase the number of color-change layers. Prefer a local intervention when appropriate and re-slice the whole manufacturing plan to see the tradeoff.\n\n## Local interventions to consider\n\nKeep the intervention proportionate to the specific problem. Useful candidates include changing build orientation, adjusting only a hidden underside, replacing the top of a horizontal hole with a suitable printable roof while preserving its necessary clearance, using local adaptive layers, improving a bridge's anchors or extrusion direction, adding a small removable sacrificial feature, placing accessible support, or splitting at a sensible joint.\n\nPreserve roundness where a mating shaft genuinely needs it. Preserve curves where they matter visually. An unremovable support inside a duct is not a valid plan. Do not trade away layer bonding to improve cooling without considering the part's mechanical job.\n\nTreat the slicer's support-generation thresholds as policy settings, not measured capability. For example, OrcaSlicer's `max_bridge_length` decides which anchored spans tree supports leave unsupported. Its configured value does not establish what the machine can physically bridge. [C7]\n\n## What to learn from physical prints\n\nRecord the feature and its conditions, not merely a global pass/fail label. Useful evidence includes:\n\n- Largest tested span or angle, plus known failures and untested regions.\n- Actual printer, filament identity, nozzle, layer/line profile, cooling, and build orientation.\n- Bridge direction, width, anchors, and nearby geometry.\n- Whether the criterion was survival, cosmetic quality, measured sag, fit, or load performance.\n\nA small combined coupon at onboarding can complement the printed measuring tool, but it should be optional. Later, print a targeted sample when an important unknown would otherwise put a much larger print at risk. Routine geometry should not repeatedly trigger calibration work.\n\n## Primary sources\n\n[C1] Prusa, Modeling with 3D printing in mind:\n\nhttps://help.prusa3d.com/article/modeling-with-3d-printing-in-mind_164135\n\n[C2] FabLab Nagoya, Fab Academy 2026 Week 05, firsthand P2S/H2S characterization:\n\nhttps://fabacademy.org/2026/labs/nagoya/assignments/week05/\n\n[C3] Ryan Hoffman, MIT HTMAA 2025, firsthand P1S characterization:\n\nhttps://fab.cba.mit.edu/classes/863.25/people/RyanHoffman/week3.html\n\n[C4] Bambu PETG Basic Technical Data Sheet V3.0:\n\nhttps://store.bblcdn.com/s1/default/cb94589bf7994fdcbfa833badefae9cd/Bambu_PETG_Basic_Technical_Data_Sheet.pdf\n\n[C5] Bambu PLA Tough+ Technical Data Sheet V3.0:\n\nhttps://store.bblcdn.com/s7/default/80a85371db2e40bda97069d283fed76c/BambuPLA_Tough_TechnicalData_Sheet_%282%29.pdf\n\n[C6] OrcaSlicer bridge settings:\n\nhttps://github.com/OrcaSlicer/OrcaSlicer/wiki/quality_settings_bridging\n\n[C7] OrcaSlicer advanced support settings:\n\nhttps://github.com/OrcaSlicer/OrcaSlicer/wiki/support_settings_advanced\n\nAll sources inspected 3 November 2026.";
|
|
18
19
|
export declare const FDM_CAPABILITY_URI = "guidance://fdm/capability-guidance";
|
|
19
20
|
export declare const FDM_CAPABILITY_RESOURCE: {
|
|
@@ -22,6 +23,16 @@ export declare const FDM_CAPABILITY_RESOURCE: {
|
|
|
22
23
|
mimeType: string;
|
|
23
24
|
description: string;
|
|
24
25
|
};
|
|
26
|
+
/** How to choose each fit by what the interface has to do on a filament printer (Nov 10: 0.5 mm a side was right for a
|
|
27
|
+
* drop-in bottle holder and would ruin a mic clamp). Sources are cited inline; the bands and the slot span are app priors. Served as the fdm_fit prompt and the fit-by-function resource so prompt-only workers read the same text. */
|
|
28
|
+
export declare const FDM_FIT_GUIDANCE = "# Choosing a fit by function on a filament printer\n\nRead this whenever a printed part meets a real object or another part. It covers how to choose each fit and why it prints the way it does. The ranges here are starting points tied to a function, a feature size and a 0.4 mm nozzle. The person's result (\"did it fit?\") corrects them. There is no single fit number.\n\n## Three things, kept apart per interface\n\n1. **The object's true size**, how it was measured (calipers, a published dimension, a scan, a photo estimate), and how sure that size is.\n2. **The print correction** for this printer, material and orientation. Pockets and holes print undersize, and walls stepped by layers differ from walls drawn in one layer.\n3. **The design fit**, which comes only from what the interface has to do.\n\nIf the three fold into one number, a result like \"0.5 mm per side and it was loose\" teaches nothing reusable. Say which of the three the result corrects.\n\n## Say what each interface has to do\n\nName the function in plain words, and infer it first from the object and how the part mounts. A wall holder that opens upward is a drop-in. A mount on a pole must not turn. A person will not say \"grips\". When the function is unclear and the answer changes the design, ask about behaviour: should it stay in when turned upside down, lift out with one hand, ever turn?\n\n| Function | Band it tolerates (app prior) | What usually works |\n| --- | --- | --- |\n| Rests in, or drops in and lifts out | Forgiving: a few tenths of a millimetre either way | Plain clearance, a lead-in at the mouth |\n| Slides | Moderate | Clearance plus enough engagement length that it does not rock |\n| Locates without rattle | Tight | Small clearance with a chamfer or taper, or a flexure that takes up the slack |\n| Grips so it does not slip or turn | Very tight: a few hundredths | Crush ribs, a split with a pinch screw, or a flexure. Never a bare number |\n| Clamps closed with a screw | The clamp's travel | A split with a screw, sized so the screw's range covers the size's uncertainty |\n| Snaps over | The snap's deflection | A snap whose arm flexes within its layers |\n| Presses in to stay | Very tight, and it creeps | Crush ribs or a screw. A pure press is for light or short-lived loads |\n\nThe bands are deliberate priors for this app, not values from a cited source. When the size's uncertainty is wider than the function's band (for example, a scan or photo estimate for a grip), do not answer with a better number. Choose a mechanism that absorbs the difference, or ask for the one caliper measurement that settles it.\n\n## Why filament prints fit the way they do\n\n- **Holes print undersize.** Protolabs Network: \"FDM often prints undersized vertical-axis holes.\" Each new layer is pressed onto the ones below. \"The amount of undersize depends on the printer, slicing software, hole size and material.\" [F1] HydraRaptor gives two more causes. A hole drawn as a polygon has sides inside the circle, \"shrinking it by cos(\u03C0 / n)\". And filament dragged round a corner \"likes to take a short-cut\", which its author judged the dominant effect on their own machines. [F6] Small holes suffer most, relative to their size. The slicer can correct holes and outer contours separately (OrcaSlicer's X-Y hole and contour compensation) and can rebuild round holes as polyholes. [F5] Check what the active profile applies before adding your own allowance, so it is not applied twice.\n- **First layers flare.** The first layer spreads into an \"elephant's foot\" that \"can impact the ability to assemble FDM parts\". Protolabs Network suggests a 45\u00B0 chamfer or radius on edges that touch the build plate. [F1] OrcaSlicer's elephant-foot compensation shrinks the first layers, and only when the object sits directly on the plate. [F5] A pocket's mouth or a rim that prints on the plate needs either the chamfer or that setting.\n- **A hole lying on its side differs from one standing upright.** A vertical-axis hole is drawn as a circle in every layer and carries only the undersize above. A horizontal-axis hole cuts across the layers. Its top is an overhang that ends in a bridge: Protolabs Network notes that bridges \"most often occur in horizontal-axis holes\". [F1] So it sags, comes out short from top to bottom, and is stepped on its sides. For a round fit on its side, give the hole a teardrop or flat roof and keep the bearing faces at the sides, or turn the part. Any overhang guidance applies to that roof.\n- **Engagement length matters.** A longer engagement keeps a slide from rocking and spreads a grip. A short one concentrates the load on a few layers and lets a part tilt within its clearance. This is design reasoning, not a sourced value.\n- **Plastic creeps under a constant load.** Dogan (2022) found that printed polymers, PLA among them, \"undergo significant changes in their dimensions under continuous loading conditions\", and that material type, temperature and load level all mattered. [F9] A pure press fit or a constant clamp therefore loosens over weeks, and faster when warm. Where a part must hold for months, prefer a screw you can re-tighten or a snap that carries load only during assembly.\n- **How the object yields matters too.** A squeezable bottle, a rigid pole and a rubber-sleeved cable want different fits. A soft object can take some interference. A rigid one makes the print take all of it. The same object is not one size for its whole life: a bottle full and nearly empty, a case new and worn, a strap stretched and relaxed present different sizes and stiffnesses. A fit that relies on the object giving way must work in its stiffest, largest state, and a fit that must retain must still retain in its smallest, softest state. This is design reasoning, not a sourced value.\n\n## Mechanisms that absorb uncertainty\n\n- **Crush ribs.** Small ribs inside a bore deform as the part is pressed in, so the part touches only the ribs. Hackaday calls them \"far easier (and more forgiving)\" than a full-bore press, and notes that \"a 0.1 mm difference can have a noticeable effect\" on a plain fit. [F7] In molding practice, three or more ribs along the hole deform at their narrow tips \"without creating a lot of stress on the part\". [F8] A crushed rib does not recover, so use ribs for parts assembled once, with light loads.\n- **A split with a pinch screw.** A slot through one side of the bore with a screw across it. The screw's travel covers a range of sizes, and a screw can be re-tightened after creep. Use it for a pole, a tube or a handle whose size is a scan or photo estimate, and say the range it holds.\n- **A flexure.** A thin arm or a sprung finger presses on the object. Use it to locate without rattle or to hold a soft object, where an exact size is unknown.\n- **A snap.** Protolabs Network gives these rules for 3D-printed snaps:\n - Taper the beam toward the tip, because a constant-thickness beam strains most at the root.\n - Make the root fillet at least 0.5 times the base thickness, and the beam at least 5 mm wide.\n - Avoid cantilevers built vertically in the Z direction.\n - Deflect the snap only during assembly, not in service.\n - Leave 0.5 mm of tolerance for FDM snap-fit connectors. The page does not say whether that is per side. [F2]\n\n In short, a snap arm flexes within its layers, never across them.\n\n## Starting clearances for a plain fit\n\nThe sources disagree, and none gives the nozzle, material or whether a value is per side:\n- Prusa says an Original Prusa \"will be accurate to at least 0.2 mm\". Its first value for movable parts is \"at least 0.3 mm\", and it says there is no universal value. [F3]\n- The University of Florida makerspace's rule of thumb for parts printed separately on Prusa MK4 and XL printers is:\n - 0.30\u20130.40 mm for loose parts such as covers;\n - 0.20\u20130.25 mm for standard sliding fits (tabs, rails, enclosures);\n - 0.15\u20130.20 mm for snug or alignment fits, \"very dependent on surface qualities\". [F4]\n\nRead these as gaps between facing surfaces on a 0.4 mm nozzle, and treat that reading as an assumption. Use them only where a plain clearance is the right mechanism: loose or sliding fits, and locating fits with a chamfer. A larger feature, a hole on its side or an uncorrected first layer needs more. For a grip or a press, these numbers are not the answer. Use a mechanism above.\n\n## This printer's own readings come first\n\nWhen the context supplies fit observations from this printer, filament and orientation, they override the starting points above for the same kind of feature. Keep their scope: an observation about one pin and hole printed together measures the pair, not the hole alone. For scale only (one 0.4 mm-nozzle PLA setup, not a rule for other printers): crush ribs at 0.15 mm per side pressed in and stayed for good while 0.30 mm per side would not go in by hand on a 20 mm pin; an 8 mm printed pin turned firmly in a hole drawn at 8.10 mm; and across the layers a 0.4 mm total gap was firm while 0.6 mm was free. Another printer starts from the cited values and its own first result.\n\n## Getting in and staying\n\n- Size a pocket to the widest section the object passes through on the way in, not to its bounding box or the scan's average.\n- Derive a pocket's outline by offsetting the object's own outline outward by the clearance, so each pocket corner radius is the object's plus the clearance. A pocket corner rounder than that cuts into the object's corner even when the width and length clear; a sharper one is safe, or relieve the corner. Check the clearance at the corners, not only across the flats.\n- Put a lead-in chamfer at the mouth. Prusa notes that a chamfer on edges that slot together saves effort when assembling. [F3]\n- Over a span of more than about 150 mm, make wall-screw holes slots so the part can be placed despite measuring error. This is an app prior, not a sourced value.\n\n## Report each interface\n\nIn the result, give each interface its function, the size used and its source and uncertainty, the print correction assumed, and the fit chosen (a clearance or interference per side, or the mechanism and the range of sizes it holds), with why. When the person reports how it fitted, change the value their result corrects, and say which one.\n\n## Sources\n\n[F1] Protolabs Network (Hubs), How to design parts for FDM 3D printing:\n\nhttps://www.hubs.com/knowledge-base/how-design-parts-fdm-3d-printing/\n\n[F2] Protolabs Network (Hubs), How do you design snap-fit joints for 3D printing?:\n\nhttps://www.hubs.com/knowledge-base/how-design-snap-fit-joints-3d-printing/\n\n[F3] Prusa Knowledge Base, Modeling with 3D printing in mind:\n\nhttps://help.prusa3d.com/article/modeling-with-3d-printing-in-mind_164135\n\n[F4] Marston Makerspace, University of Florida, Designing for 3D Printing Tolerances on the MK4 and XL:\n\nhttps://makerspace.uflib.ufl.edu/services/3dprocess/recommended-software-for-3d-printing/designing-for-3d-printing-tolerances-on-the-mk4-and-xl/\n\n[F5] OrcaSlicer wiki, Precision (X-Y hole and contour compensation, elephant foot compensation, polyholes):\n\nhttps://www.orcaslicer.com/wiki/print_settings/quality/quality_settings_precision\n\n[F6] nophead, HydraRaptor: Polyholes (5 February 2011):\n\nhttps://hydraraptor.blogspot.com/2011/02/polyholes.html\n\n[F7] Donald Papp, Hackaday, Adding Crush Ribs To 3D Printed Parts For A Better Press Fit (15 October 2020):\n\nhttps://hackaday.com/2020/10/15/adding-crush-ribs-to-3d-printed-parts-for-a-better-press-fit/\n\n[F8] Protolabs, Crush Rib Design Guidelines for Injection Molding:\n\nhttps://www.protolabs.com/resources/design-tips/adding-crush-ribs-to-molded-parts/\n\n[F9] O. Dogan, Short-term Creep Behaviour of Different Polymers Used in Additive Manufacturing under Different Thermal and Loading Conditions, Strojni\u0161ki vestnik \u2013 Journal of Mechanical Engineering 68 (7\u20138), 2022, 451\u2013460, doi:10.5545/sv-jme.2022.191 (abstract):\n\nhttps://ojs30.sv-jme.eu/index.php/sv-jme/article/view/191\n\nAll sources inspected 10 November 2026.";
|
|
29
|
+
export declare const FDM_FIT_URI = "guidance://fdm/fit-by-function";
|
|
30
|
+
export declare const FDM_FIT_RESOURCE: {
|
|
31
|
+
uri: string;
|
|
32
|
+
name: string;
|
|
33
|
+
mimeType: string;
|
|
34
|
+
description: string;
|
|
35
|
+
};
|
|
25
36
|
export declare const DESIGN_PROMPTS: DesignPrompt[];
|
|
26
37
|
/**
|
|
27
38
|
* How this server's configured slicer orients, makes supports and checks a slice: the slicer-specific half of a
|
package/dist/design-guidance.js
CHANGED
|
@@ -5,7 +5,9 @@ Use the actual printer and material context: nozzle arrangement and filament rou
|
|
|
5
5
|
|
|
6
6
|
Before committing to detailed geometry, choose a plausible way to manufacture and assemble it. For a consequential tradeoff, compare the strongest one-piece approach with a meaningfully different orientation or split. Simple parts do not need a design tournament. Judge total effort to obtain a good finished object: printing, consumed filament, likely rework, support cleanup, assembly, and extra hardware. Respect the user's priorities instead of applying fixed numerical weights.
|
|
7
7
|
|
|
8
|
-
Keep assembled orientation and print orientation distinct. Preserve critical dimensions and mating surfaces. Account for measurement uncertainty and fit clearance separately; a scan or printed measuring tool does not establish its own accuracy. Use the smallest useful fit sample when uncertainty could otherwise waste a substantial print.
|
|
8
|
+
Keep assembled orientation and print orientation distinct. Preserve critical dimensions and mating surfaces. Account for measurement uncertainty and fit clearance separately; a scan or printed measuring tool does not establish its own accuracy. Use the smallest useful fit sample when uncertainty could otherwise waste a substantial print. When the request names a product, a vehicle, or a standard part, look up its published dimensions and use them, labelled as published. A size the person confirmed without changing a prefilled number is not a measurement. If a case, cover, or attachment is mentioned, the bare product's size is not the size to design to. Ask the person only for what no source gives, and where possible shape the design so an unmeasured dimension does not decide whether it works.
|
|
9
|
+
|
|
10
|
+
Choose each fit by what that interface has to do: drop in and lift out, slide, locate without rattle, grip so it does not slip or turn, snap over, or press in to stay. There is no single fit number. Keep three things apart for each interface: the object's size and how sure it is, the correction this printer and orientation need (its own observed corrections first, when the context supplies them), and the fit the function calls for. When the size's uncertainty is wider than the function tolerates, do not answer with a better number: choose a mechanism that absorbs the difference (crush ribs, a split closed by a screw, a flexure, a snap), or ask for the one measurement that settles it. The same object changes with time and use: full and nearly empty, new and worn, soft and stiff. A fit that relies on the object giving way must still work in its stiffest, largest state, and a pocket is sized to the widest section the object passes through on the way in, with support where the object actually bears, not to its bounding box.
|
|
9
11
|
|
|
10
12
|
Evaluate printability locally. Distinguish a progressively supported overhang, a bridge anchored at both ends, and a disconnected island. State overhang angles from vertical: 0 degrees is a vertical wall; 90 degrees is a horizontal underside. Convert conventions before setting slicer angles. Use relevant measured capability ahead of generic rules. A 45-degree threshold is not a universal support requirement, and a steep surface is not automatically unprintable. Judge bridge length along the actual unsupported extrusion path, with its anchors, cooling, material, and required underside quality. A feature that survives printing may still miss a cosmetic or dimensional requirement.
|
|
11
13
|
|
|
@@ -13,13 +15,15 @@ Resolve a difficult region with the least disruptive effective change: a better
|
|
|
13
15
|
|
|
14
16
|
Choose layer orientation, material, walls, and joints for the actual loads and environment. Check the load path, flexing features, fastener access, and installation sequence. A reduction in supports or color changes must not silently weaken the part or defeat its fit.
|
|
15
17
|
|
|
18
|
+
When a part must flex, grip, snap, clip, spring, or hold something, consider a compliant mechanism first: one piece that bends on purpose often beats rigid jaws plus a clamp bolt, with fewer parts, no fastener to buy or lose, and a hold that follows the object. Spread the bending over a long band, leaf, or arch rather than a short stub; keep the rest of the body stiff so the stroke goes where you intend; give a hand enough leverage; design the preload in; use an over-centre or cam where a hold must lock; and give every flexing direction a hard stop so a hard pull meets solid material. Keep the bending in the layer plane, where the filament runs along the strain; bending that pulls layers apart is far weaker and fails with little warning. Choose the strain by duty (bent once to assemble, bent every day, and held bent for months are different designs) and by material and direction, using the printer's own observed values when the context supplies them. Modern PLA and PETG grades are not brittle in this role: proven printed springs work daily at strains that older moulded-plastic tables would forbid. What usually ends a flexure is not a clean snap at a magic percentage but whitening and set at a sharp root, layers parting where the bend crosses them, or a held bend creeping loose, faster when warm. In sustained heat such as a parked car, a part held bent relaxes and a sun-heated dashboard can exceed what PLA or PETG carry under load: prefer a rest state that sits unstrained, and say so when the material cannot honestly do the job. A part a hand works has to be easy to work, and that is checked like its hold: say where the fingers go, how hard they push to open it, how far it opens, and how the object goes in and comes out with one hand. A grip that meets its force and is a fight to use has failed the brief.
|
|
19
|
+
|
|
16
20
|
On a shared-nozzle multicolor setup, reason about filament transitions across layers, including support-interface material. Total color count alone is a poor cost estimate. Consider color placement, shallow inlays, separately printed accents, and part orientation while preserving the requested appearance. Separate bodies on one layer-printed plate can still cause repeated swaps. Use the slicer's actual schedule and estimates when available; do not invent a fixed cost per color change.
|
|
17
21
|
|
|
18
|
-
Use assembly when its benefit is worth the user's additional work. Design alignment, clearance, engagement, and assembly access deliberately. Glue is a valid planned joining method for suitable materials and loads; make joints self-locating and give them useful bonding area. Use mechanical retention when loads, repeated flexing, or serviceability call for it. State needed glue, hardware, tools, and assembly effort plainly. Avoid adding parts when a modest support or a simple one-piece print is the better result.
|
|
22
|
+
Use assembly when its benefit is worth the user's additional work. Design alignment, clearance, engagement, and assembly access deliberately. Glue is a valid planned joining method for suitable materials and loads; make joints self-locating and give them useful bonding area. Use mechanical retention when loads, repeated flexing, or serviceability call for it. State needed glue, hardware, tools, and assembly effort plainly. Avoid adding parts when a modest support or a simple one-piece print is the better result. A printed screw, nut, or threaded hole is an ordinary choice at hand sizes (M8 and up as the usual starting point, about M6 as the floor) with a coarse profile shaped to print without supports; below that floor, under sustained preload that must not relax, in heat, or under shock, a metal screw or insert is the honest choice. Keep threads out of the main load path where a shoulder, tenon, key, or serrated face can carry shear and torque, and let the thread only hold the joint closed.
|
|
19
23
|
|
|
20
|
-
Verify the chosen geometry in its actual print orientation and inspect the slice when tools permit. Check critical fits, missing or floating features, toolpaths, supports, color assignments, total time, and material consumption. Treat a slicer prediction as a prediction, not a physical test. Fix consequential problems and re-slice relevant changes. Stop when the design meets the brief and no remaining improvement justifies its cost.
|
|
24
|
+
Verify the chosen geometry in its actual print orientation and inspect the slice when tools permit. Check critical fits, missing or floating features, toolpaths, supports, color assignments, total time, and material consumption. Treat a slicer prediction as a prediction, not a physical test. Fix consequential problems and re-slice relevant changes. Stop when the design meets the brief and no remaining improvement justifies its cost. State "prints without supports", "holds", or "fits" only when the engine's own checks or the slice show it, and give the number that shows it; otherwise call it an untested prediction.
|
|
21
25
|
|
|
22
|
-
Keep the user-facing result short: the recommended design, why its manufacturing approach makes sense, how it prints and assembles, and any consequential unresolved assumption. Distinguish measured dimensions, slicer estimates, and untested predictions. Keep detailed analysis in the working process.`;
|
|
26
|
+
Keep the user-facing result short: the recommended design, why its manufacturing approach makes sense, how it prints and assembles, and any consequential unresolved assumption. Distinguish measured dimensions, slicer estimates, and untested predictions. Say where each critical size came from (measured, published, or assumed) and what each interface is meant to do and how it fits. Keep detailed analysis in the working process.`;
|
|
23
27
|
export const FDM_MULTICOLOR = `Apply this guidance when multiple colors or support materials share a print.
|
|
24
28
|
|
|
25
29
|
Preserve the requested visual pattern. Evaluate its colors in build coordinates and across layers before committing to color geometry. On a shared nozzle, a small accent spanning many layers can create more transitions than a large region confined to a few layers. Count the slicer's actual transitions when available, including swaps back to a prior filament and support-interface swaps; color count and colored volume are only screening clues. On printers with multiple nozzles, evaluate each shared melt path; AMS slots are not independent nozzles.
|
|
@@ -39,14 +43,33 @@ Put boundaries where they are structurally sensible and visually deliberate. Use
|
|
|
39
43
|
|
|
40
44
|
For suitable lightly loaded rigid details, a locating pocket plus a compatible adhesive can be the simplest reliable solution. For a loaded clamp, a joint under peel or repeated bending, or a serviceable assembly, consider fasteners or mechanically captured geometry. Do not assume a tiny glued butt joint can carry the same load as an intact printed section. Select adhesive from evidence for the actual materials and conditions; superglue is an option, not a universal material property.
|
|
41
45
|
|
|
42
|
-
State the practical consequence directly: which parts print in which orientations and colors, how they locate, how they are retained, which supplies are needed, and the estimated hands-on work. Keep hands-on time separate from adhesive cure time. Check a small joint sample only when its uncertain fit or strength would change the design decision
|
|
46
|
+
State the practical consequence directly: which parts print in which orientations and colors, how they locate, how they are retained, which supplies are needed, and the estimated hands-on work. Keep hands-on time separate from adhesive cure time. Check a small joint sample only when its uncertain fit or strength would change the design decision.
|
|
47
|
+
|
|
48
|
+
Printed threads need a profile made for printing, not a copy of a metal V-thread. A coarse, truncated thread whose flanks sit within the printer's proven overhang (one widely printed all-plastic kit uses about a 96-degree included angle, 42 degrees from vertical, at pitches of roughly 2-3 mm for M8-M12 sizes, cleared by roughly two tenths of a millimetre per side at the pitch line) prints upright without supports and keeps its teeth in solid wall loops. Keep the pitch exactly the same on screw and hole; make clearance by shifting the profile radially, never by scaling the screw, which changes the pitch and wedges after a few turns. Give a hand screw several full turns of engagement and a knob that limits how hard it can be torqued. A long, slender screw that must pull or bend is better printed flat or split so filament runs along its length than stood upright across its layers. Where preload must survive months, heat, or shock, or the size is below about M6-M8, use a metal screw or heat-set insert and say so. When the context supplies this printer's own thread fit observation, use it ahead of any generic allowance.`;
|
|
43
49
|
export const FDM_AFTER_SLICE = `Review this slice against the user's brief and the selected manufacturing plan. Use the returned slice, geometry, profile, and calibration evidence; do not assume missing metrics are zero.
|
|
44
50
|
|
|
45
51
|
Check that the actual toolpaths preserve critical features, fit, connected material, intended colors, and load-bearing sections. Inspect consequential first layers, bridges, islands, supported undersides, and removal access. Compare expected total print time, total material across all plates, and manual work with the best credible alternative. Keep purge, prime-tower, support, and model quantities distinct only when the data provides a non-overlapping breakdown.
|
|
46
52
|
|
|
47
|
-
If the plan is unexpectedly costly or fragile, identify the dominant cause and make the smallest change that preserves the brief. Re-slice after a relevant geometry, orientation, material, or process change. Do not optimize a minor imperfection at the expense of function or appearance, and do not invent a redesign simply to produce criticism.
|
|
53
|
+
If the plan is unexpectedly costly or fragile, identify the dominant cause and make the smallest change that preserves the brief. Re-slice after a relevant geometry, orientation, material, or process change. Do not optimize a minor imperfection at the expense of function or appearance, and do not invent a redesign simply to produce criticism. Check every support, fit, and hold claim in the summary against a number from the slice or the engine's checks (support area and worst overhang, engagement and gap, estimated bite at the forced opening). A claim without its number comes out or is labelled a prediction.
|
|
48
54
|
|
|
49
55
|
Return a concise decision: keep, revise, or validate one specific uncertainty. Include the decisive evidence and the exact next action. A clean slice supports a printability prediction; it does not verify physical fit, strength, or bridge quality.`;
|
|
56
|
+
export const FDM_FLEXURES = `Apply this guidance when a part must flex, grip, snap, clip, spring, or hold something by bending. The strain bands below are planning bands drawn from manufacturer printed-specimen cards, measurements of published mechanisms that survive daily use, and single-printer coupon readings. They are not guarantees and not rejection thresholds. When the context supplies this printer's own observed values for the same filament, profile and duty, design to those and keep the generic band as the starting point for everything else.
|
|
57
|
+
|
|
58
|
+
A compliant design earns its place when one bending piece replaces rigid jaws, a hinge and a clamp bolt: fewer parts, nothing to buy or lose, one print, and a hold that follows the object as it varies. Prefer it for holders, clips, snaps, lids and latches a hand operates. Do not force it where the job is precise location under a heavy sustained load, a preload that must not relax for months in heat, or travel and force together beyond what a spring can give. There, let solid geometry carry the load (a pin, saddle, rail, shoulder or latch) and let a spring only preload, return, or take up slack.
|
|
59
|
+
|
|
60
|
+
Choose the architecture before the dimensions. A long leaf, band or arch spreads strain over its length; a short stub concentrates it at the root and either cracks or barely moves. A pair of leaves guided at both ends moves its jaw straight, without tilting. Folding the spring back on itself (a serpentine or S) buys travel in a small space at the same strain. A thick curved arch gives a strong bite over a short opening. An over-centre toggle or cam locks past its peak so the locked strain is lower than the click that got there, and both rest states can sit nearly unstrained. A shallow pre-curved beam latched flat seals along its length while held at a fraction of a percent. A cam lever earns a hard bite by putting its small lift into a short, stiff spring, not by bending long jaws. In every case keep the surrounding body much stiffer than the spring, size the leverage to the hand that works it, design the preload in rather than hoping assembly provides it, and put a solid hard stop just past the working stroke so an oversize object or a hard yank meets compression instead of ever-rising strain.
|
|
61
|
+
|
|
62
|
+
Judge bite at the opening the object actually forces, where the force is taken. The same clip is several times stiffer when a flat rigid object holds its jaws from turning than when a round finger lets them turn; one measured clip changed about fivefold between those contacts. Grip that must not slip is force times friction; feel and marking are pressure. A narrow ridge concentrates a modest force into a high pressure that seals, grips and, on skin, hurts; a broad flat jaw needs roughly an order of magnitude more force for the same pressure. State the opening, the contact you assumed, and the friction you used. Published dry static friction for printed PLA on itself spans roughly 0.12-0.38 (one printer read 0.25-0.31 on both faces) and PETG on itself roughly 0.13-0.21: use the low end when checking that a hold retains, the high end when checking that a hand can still insert it. Friction against the held object (a phone case, glass, paint) is unknown unless the context gives it; do not substitute the self-contact range for it.
|
|
63
|
+
|
|
64
|
+
Keep the bending in the layer plane. Filament laid along the strained length carries the bend; a bend that pulls layers apart works at a fraction of that strength (across-layer tensile strength is roughly half to nine-tenths of in-plane depending on grade and test) and parts with little warning. Turn the part, split it, or reshape the spring so its length lies in the layers. If a bend across layers is truly unavoidable, keep its strain well below the in-plane bands, give it generous roots, and bring its hard stop close. Make the spring from continuous wall loops: choose its thickness as whole extrusion widths and enough walls that no sparse infill sits inside the neck. Taper toward the tip where travel allows, fillet every root or curve continuously through it, and never hang a spring from a sharp internal corner.
|
|
65
|
+
|
|
66
|
+
Choose strain by duty first, then material. In the layer plane, as planning bands: held bent for months at room temperature, keep PLA to about 0.5% or less and PETG to about 1.4% or less, and prefer a shape whose rest state is unstrained so holding costs nothing; bent every day for hundreds to thousands of cycles, proven mechanisms commonly work at about 1.5-2.6% in PLA and about 2-3.4% in PETG; bent once to assemble, or touched only at the hard stop, PLA on one coupon-tested printer survived 3.3% once and ten times in both orientations without cracking, and proven PETG designs peak at about 4-4.3%. Treat those peaks as no-crack evidence, not proof of full spring-back: past roughly 3.3-3.4% PLA begins to whiten and take set in published printed-specimen testing, long before its published break elongation (about 12% in-plane for one current PLA grade), because break includes permanent deformation a spring cannot use. Older moulded-plastic snap allowances near 1-1.7% are not printed fracture limits; designing every spring to them produces weak, timid parts. Grade matters as much as polymer family: current cards put one PETG grade's tensile modulus near 2780 MPa and another's near 1810 MPa, so size force from the actual grade's card or an observed deflection (one printer's PLA measured about 2600 MPa, close to its 2580 MPa card), never from the family name alone.
|
|
67
|
+
|
|
68
|
+
Expect, in order: a sharp root whitens, yields and takes set; a bend across layers delaminates; a held bend creeps and its force fades; only then does a well-shaped in-plane spring crack. Design so the first failure you would meet is harmless and visible, and so the hard stop prevents the rest.
|
|
69
|
+
|
|
70
|
+
Heat changes the answer before it melts anything. PLA grades soften under load from roughly the mid-50s C (heat deflection about 54-57 C, glass transition about 60 C) and PETG grades from roughly the low 60s to about 70 C depending on grade and load (glass transition about 66-69 C); published creep tests already move faster after brief warming near 46 C. A sun-parked dashboard has been documented around 70 C within an hour. Judge by exposure and load together: a shaded, unloaded trim piece is not a loaded spring on a dashboard. For sun-exposed parts that must stay bent or carry load, neither PLA nor PETG is an honest default; prefer a higher-temperature filament the printer actually has, a rest state at zero strain while parked empty, and positive capture (lips, shelves, a latch) so friction alone never decides whether the object stays. Say plainly when the loaded filaments cannot do the thermal job instead of silently printing it anyway.
|
|
71
|
+
|
|
72
|
+
In the result, give the duty you designed for, how a hand operates it (where the fingers go and the force to open it at the tabs), the working and hard-stop strains and how you estimated them, the bite or spring force at the stated opening with its contact and friction assumptions, the rest strain, and the heat verdict. A force without its opening, or a strain without its duty, is not yet a claim.`;
|
|
50
73
|
export const FDM_CAPABILITY_GUIDANCE = `# Bridges and overhangs: useful capability without arbitrary bans
|
|
51
74
|
|
|
52
75
|
Load this reference only when the feature matters to the manufacturing decision. These are proposed planning bands, not manufacturer guarantees, support-generation settings, or automatic acceptance/rejection rules.
|
|
@@ -159,14 +182,139 @@ All sources inspected 3 November 2026.`;
|
|
|
159
182
|
export const FDM_CAPABILITY_URI = "guidance://fdm/capability-guidance";
|
|
160
183
|
export const FDM_CAPABILITY_RESOURCE = { uri: FDM_CAPABILITY_URI, name: "FDM bridge and overhang guidance", mimeType: "text/markdown",
|
|
161
184
|
description: "Planning bands and evidence for bridges and overhangs, for when one is consequential and there is no sufficiently specific measured capability available" };
|
|
185
|
+
/** How to choose each fit by what the interface has to do on a filament printer (Nov 10: 0.5 mm a side was right for a
|
|
186
|
+
* drop-in bottle holder and would ruin a mic clamp). Sources are cited inline; the bands and the slot span are app priors. Served as the fdm_fit prompt and the fit-by-function resource so prompt-only workers read the same text. */
|
|
187
|
+
export const FDM_FIT_GUIDANCE = `# Choosing a fit by function on a filament printer
|
|
188
|
+
|
|
189
|
+
Read this whenever a printed part meets a real object or another part. It covers how to choose each fit and why it prints the way it does. The ranges here are starting points tied to a function, a feature size and a 0.4 mm nozzle. The person's result ("did it fit?") corrects them. There is no single fit number.
|
|
190
|
+
|
|
191
|
+
## Three things, kept apart per interface
|
|
192
|
+
|
|
193
|
+
1. **The object's true size**, how it was measured (calipers, a published dimension, a scan, a photo estimate), and how sure that size is.
|
|
194
|
+
2. **The print correction** for this printer, material and orientation. Pockets and holes print undersize, and walls stepped by layers differ from walls drawn in one layer.
|
|
195
|
+
3. **The design fit**, which comes only from what the interface has to do.
|
|
196
|
+
|
|
197
|
+
If the three fold into one number, a result like "0.5 mm per side and it was loose" teaches nothing reusable. Say which of the three the result corrects.
|
|
198
|
+
|
|
199
|
+
## Say what each interface has to do
|
|
200
|
+
|
|
201
|
+
Name the function in plain words, and infer it first from the object and how the part mounts. A wall holder that opens upward is a drop-in. A mount on a pole must not turn. A person will not say "grips". When the function is unclear and the answer changes the design, ask about behaviour: should it stay in when turned upside down, lift out with one hand, ever turn?
|
|
202
|
+
|
|
203
|
+
| Function | Band it tolerates (app prior) | What usually works |
|
|
204
|
+
| --- | --- | --- |
|
|
205
|
+
| Rests in, or drops in and lifts out | Forgiving: a few tenths of a millimetre either way | Plain clearance, a lead-in at the mouth |
|
|
206
|
+
| Slides | Moderate | Clearance plus enough engagement length that it does not rock |
|
|
207
|
+
| Locates without rattle | Tight | Small clearance with a chamfer or taper, or a flexure that takes up the slack |
|
|
208
|
+
| Grips so it does not slip or turn | Very tight: a few hundredths | Crush ribs, a split with a pinch screw, or a flexure. Never a bare number |
|
|
209
|
+
| Clamps closed with a screw | The clamp's travel | A split with a screw, sized so the screw's range covers the size's uncertainty |
|
|
210
|
+
| Snaps over | The snap's deflection | A snap whose arm flexes within its layers |
|
|
211
|
+
| Presses in to stay | Very tight, and it creeps | Crush ribs or a screw. A pure press is for light or short-lived loads |
|
|
212
|
+
|
|
213
|
+
The bands are deliberate priors for this app, not values from a cited source. When the size's uncertainty is wider than the function's band (for example, a scan or photo estimate for a grip), do not answer with a better number. Choose a mechanism that absorbs the difference, or ask for the one caliper measurement that settles it.
|
|
214
|
+
|
|
215
|
+
## Why filament prints fit the way they do
|
|
216
|
+
|
|
217
|
+
- **Holes print undersize.** Protolabs Network: "FDM often prints undersized vertical-axis holes." Each new layer is pressed onto the ones below. "The amount of undersize depends on the printer, slicing software, hole size and material." [F1] HydraRaptor gives two more causes. A hole drawn as a polygon has sides inside the circle, "shrinking it by cos(π / n)". And filament dragged round a corner "likes to take a short-cut", which its author judged the dominant effect on their own machines. [F6] Small holes suffer most, relative to their size. The slicer can correct holes and outer contours separately (OrcaSlicer's X-Y hole and contour compensation) and can rebuild round holes as polyholes. [F5] Check what the active profile applies before adding your own allowance, so it is not applied twice.
|
|
218
|
+
- **First layers flare.** The first layer spreads into an "elephant's foot" that "can impact the ability to assemble FDM parts". Protolabs Network suggests a 45° chamfer or radius on edges that touch the build plate. [F1] OrcaSlicer's elephant-foot compensation shrinks the first layers, and only when the object sits directly on the plate. [F5] A pocket's mouth or a rim that prints on the plate needs either the chamfer or that setting.
|
|
219
|
+
- **A hole lying on its side differs from one standing upright.** A vertical-axis hole is drawn as a circle in every layer and carries only the undersize above. A horizontal-axis hole cuts across the layers. Its top is an overhang that ends in a bridge: Protolabs Network notes that bridges "most often occur in horizontal-axis holes". [F1] So it sags, comes out short from top to bottom, and is stepped on its sides. For a round fit on its side, give the hole a teardrop or flat roof and keep the bearing faces at the sides, or turn the part. Any overhang guidance applies to that roof.
|
|
220
|
+
- **Engagement length matters.** A longer engagement keeps a slide from rocking and spreads a grip. A short one concentrates the load on a few layers and lets a part tilt within its clearance. This is design reasoning, not a sourced value.
|
|
221
|
+
- **Plastic creeps under a constant load.** Dogan (2022) found that printed polymers, PLA among them, "undergo significant changes in their dimensions under continuous loading conditions", and that material type, temperature and load level all mattered. [F9] A pure press fit or a constant clamp therefore loosens over weeks, and faster when warm. Where a part must hold for months, prefer a screw you can re-tighten or a snap that carries load only during assembly.
|
|
222
|
+
- **How the object yields matters too.** A squeezable bottle, a rigid pole and a rubber-sleeved cable want different fits. A soft object can take some interference. A rigid one makes the print take all of it. The same object is not one size for its whole life: a bottle full and nearly empty, a case new and worn, a strap stretched and relaxed present different sizes and stiffnesses. A fit that relies on the object giving way must work in its stiffest, largest state, and a fit that must retain must still retain in its smallest, softest state. This is design reasoning, not a sourced value.
|
|
223
|
+
|
|
224
|
+
## Mechanisms that absorb uncertainty
|
|
225
|
+
|
|
226
|
+
- **Crush ribs.** Small ribs inside a bore deform as the part is pressed in, so the part touches only the ribs. Hackaday calls them "far easier (and more forgiving)" than a full-bore press, and notes that "a 0.1 mm difference can have a noticeable effect" on a plain fit. [F7] In molding practice, three or more ribs along the hole deform at their narrow tips "without creating a lot of stress on the part". [F8] A crushed rib does not recover, so use ribs for parts assembled once, with light loads.
|
|
227
|
+
- **A split with a pinch screw.** A slot through one side of the bore with a screw across it. The screw's travel covers a range of sizes, and a screw can be re-tightened after creep. Use it for a pole, a tube or a handle whose size is a scan or photo estimate, and say the range it holds.
|
|
228
|
+
- **A flexure.** A thin arm or a sprung finger presses on the object. Use it to locate without rattle or to hold a soft object, where an exact size is unknown.
|
|
229
|
+
- **A snap.** Protolabs Network gives these rules for 3D-printed snaps:
|
|
230
|
+
- Taper the beam toward the tip, because a constant-thickness beam strains most at the root.
|
|
231
|
+
- Make the root fillet at least 0.5 times the base thickness, and the beam at least 5 mm wide.
|
|
232
|
+
- Avoid cantilevers built vertically in the Z direction.
|
|
233
|
+
- Deflect the snap only during assembly, not in service.
|
|
234
|
+
- Leave 0.5 mm of tolerance for FDM snap-fit connectors. The page does not say whether that is per side. [F2]
|
|
235
|
+
|
|
236
|
+
In short, a snap arm flexes within its layers, never across them.
|
|
237
|
+
|
|
238
|
+
## Starting clearances for a plain fit
|
|
239
|
+
|
|
240
|
+
The sources disagree, and none gives the nozzle, material or whether a value is per side:
|
|
241
|
+
- Prusa says an Original Prusa "will be accurate to at least 0.2 mm". Its first value for movable parts is "at least 0.3 mm", and it says there is no universal value. [F3]
|
|
242
|
+
- The University of Florida makerspace's rule of thumb for parts printed separately on Prusa MK4 and XL printers is:
|
|
243
|
+
- 0.30–0.40 mm for loose parts such as covers;
|
|
244
|
+
- 0.20–0.25 mm for standard sliding fits (tabs, rails, enclosures);
|
|
245
|
+
- 0.15–0.20 mm for snug or alignment fits, "very dependent on surface qualities". [F4]
|
|
246
|
+
|
|
247
|
+
Read these as gaps between facing surfaces on a 0.4 mm nozzle, and treat that reading as an assumption. Use them only where a plain clearance is the right mechanism: loose or sliding fits, and locating fits with a chamfer. A larger feature, a hole on its side or an uncorrected first layer needs more. For a grip or a press, these numbers are not the answer. Use a mechanism above.
|
|
248
|
+
|
|
249
|
+
## This printer's own readings come first
|
|
250
|
+
|
|
251
|
+
When the context supplies fit observations from this printer, filament and orientation, they override the starting points above for the same kind of feature. Keep their scope: an observation about one pin and hole printed together measures the pair, not the hole alone. For scale only (one 0.4 mm-nozzle PLA setup, not a rule for other printers): crush ribs at 0.15 mm per side pressed in and stayed for good while 0.30 mm per side would not go in by hand on a 20 mm pin; an 8 mm printed pin turned firmly in a hole drawn at 8.10 mm; and across the layers a 0.4 mm total gap was firm while 0.6 mm was free. Another printer starts from the cited values and its own first result.
|
|
252
|
+
|
|
253
|
+
## Getting in and staying
|
|
254
|
+
|
|
255
|
+
- Size a pocket to the widest section the object passes through on the way in, not to its bounding box or the scan's average.
|
|
256
|
+
- Derive a pocket's outline by offsetting the object's own outline outward by the clearance, so each pocket corner radius is the object's plus the clearance. A pocket corner rounder than that cuts into the object's corner even when the width and length clear; a sharper one is safe, or relieve the corner. Check the clearance at the corners, not only across the flats.
|
|
257
|
+
- Put a lead-in chamfer at the mouth. Prusa notes that a chamfer on edges that slot together saves effort when assembling. [F3]
|
|
258
|
+
- Over a span of more than about 150 mm, make wall-screw holes slots so the part can be placed despite measuring error. This is an app prior, not a sourced value.
|
|
259
|
+
|
|
260
|
+
## Report each interface
|
|
261
|
+
|
|
262
|
+
In the result, give each interface its function, the size used and its source and uncertainty, the print correction assumed, and the fit chosen (a clearance or interference per side, or the mechanism and the range of sizes it holds), with why. When the person reports how it fitted, change the value their result corrects, and say which one.
|
|
263
|
+
|
|
264
|
+
## Sources
|
|
265
|
+
|
|
266
|
+
[F1] Protolabs Network (Hubs), How to design parts for FDM 3D printing:
|
|
267
|
+
|
|
268
|
+
https://www.hubs.com/knowledge-base/how-design-parts-fdm-3d-printing/
|
|
269
|
+
|
|
270
|
+
[F2] Protolabs Network (Hubs), How do you design snap-fit joints for 3D printing?:
|
|
271
|
+
|
|
272
|
+
https://www.hubs.com/knowledge-base/how-design-snap-fit-joints-3d-printing/
|
|
273
|
+
|
|
274
|
+
[F3] Prusa Knowledge Base, Modeling with 3D printing in mind:
|
|
275
|
+
|
|
276
|
+
https://help.prusa3d.com/article/modeling-with-3d-printing-in-mind_164135
|
|
277
|
+
|
|
278
|
+
[F4] Marston Makerspace, University of Florida, Designing for 3D Printing Tolerances on the MK4 and XL:
|
|
279
|
+
|
|
280
|
+
https://makerspace.uflib.ufl.edu/services/3dprocess/recommended-software-for-3d-printing/designing-for-3d-printing-tolerances-on-the-mk4-and-xl/
|
|
281
|
+
|
|
282
|
+
[F5] OrcaSlicer wiki, Precision (X-Y hole and contour compensation, elephant foot compensation, polyholes):
|
|
283
|
+
|
|
284
|
+
https://www.orcaslicer.com/wiki/print_settings/quality/quality_settings_precision
|
|
285
|
+
|
|
286
|
+
[F6] nophead, HydraRaptor: Polyholes (5 February 2011):
|
|
287
|
+
|
|
288
|
+
https://hydraraptor.blogspot.com/2011/02/polyholes.html
|
|
289
|
+
|
|
290
|
+
[F7] Donald Papp, Hackaday, Adding Crush Ribs To 3D Printed Parts For A Better Press Fit (15 October 2020):
|
|
291
|
+
|
|
292
|
+
https://hackaday.com/2020/10/15/adding-crush-ribs-to-3d-printed-parts-for-a-better-press-fit/
|
|
293
|
+
|
|
294
|
+
[F8] Protolabs, Crush Rib Design Guidelines for Injection Molding:
|
|
295
|
+
|
|
296
|
+
https://www.protolabs.com/resources/design-tips/adding-crush-ribs-to-molded-parts/
|
|
297
|
+
|
|
298
|
+
[F9] O. Dogan, Short-term Creep Behaviour of Different Polymers Used in Additive Manufacturing under Different Thermal and Loading Conditions, Strojniški vestnik – Journal of Mechanical Engineering 68 (7–8), 2022, 451–460, doi:10.5545/sv-jme.2022.191 (abstract):
|
|
299
|
+
|
|
300
|
+
https://ojs30.sv-jme.eu/index.php/sv-jme/article/view/191
|
|
301
|
+
|
|
302
|
+
All sources inspected 10 November 2026.`;
|
|
303
|
+
export const FDM_FIT_URI = "guidance://fdm/fit-by-function";
|
|
304
|
+
export const FDM_FIT_RESOURCE = { uri: FDM_FIT_URI, name: "FDM fit by function", mimeType: "text/markdown",
|
|
305
|
+
description: "How to choose each fit where a printed part meets a real object or another part: by what the interface has to do, with why filament prints fit the way they do, mechanisms that absorb size uncertainty, and cited starting points" };
|
|
162
306
|
export const DESIGN_PROMPTS = [
|
|
163
307
|
CAD_DESIGN_PROMPT,
|
|
164
308
|
{ name: "fdm_design", title: "Design for FDM printing", text: FDM_CORE,
|
|
165
309
|
description: "Persistent instructions for every design or model-editing task: plan how the object prints as part of the design, using the actual printer, filaments and slice." },
|
|
310
|
+
{ name: "fdm_fit", title: "Choosing a fit by function", text: FDM_FIT_GUIDANCE,
|
|
311
|
+
description: "Add whenever a part meets a real object or another part: choose each fit by what that interface has to do, with why filament prints fit the way they do, mechanisms that absorb size uncertainty, and cited starting points. The same text is the fit-by-function resource." },
|
|
312
|
+
{ name: "fdm_flexures", title: "Parts that flex, grip and snap", text: FDM_FLEXURES,
|
|
313
|
+
description: "Add whenever a part must flex, grip, snap, clip, spring, or hold something by bending: compliant architectures, strain chosen by duty, material and layer direction, bite, heat and creep." },
|
|
166
314
|
{ name: "fdm_multicolor", title: "Multicolour and support materials", text: FDM_MULTICOLOR,
|
|
167
315
|
description: "Add when several colours or support materials share a print: filament transitions, colour placement, plate scheduling and flushing." },
|
|
168
316
|
{ name: "fdm_assembly", title: "Splits, inserts and joints", text: FDM_ASSEMBLY,
|
|
169
|
-
description: "Add when a split, accent insert or
|
|
317
|
+
description: "Add when a split, accent insert, joint or printed fastener could materially improve the result." },
|
|
170
318
|
{ name: "fdm_after_slice", title: "Review a slice", text: FDM_AFTER_SLICE,
|
|
171
319
|
description: "A separate review turn after a candidate has been sliced, before presenting the manufacturing recommendation: keep, revise, or validate one specific uncertainty." },
|
|
172
320
|
];
|
|
@@ -196,4 +344,4 @@ export function slicingGuidance(slicerType, capabilities) {
|
|
|
196
344
|
}
|
|
197
345
|
export const FDM_SLICING_PROMPT = { name: "fdm_slicing", title: "How this MCP slices",
|
|
198
346
|
description: "Add to every design or model-editing task: how this server's slicer orients a model and generates supports, and how to check a choice with a checkpoint slice." };
|
|
199
|
-
export const SERVER_INSTRUCTIONS = "When designing or editing a model to print, apply the fdm_design prompt and the fdm_slicing prompt. Add fdm_multicolor when several colours or support materials share a print, fdm_assembly when a split or
|
|
347
|
+
export const SERVER_INSTRUCTIONS = "When designing or editing a model to print, apply the fdm_design prompt and the fdm_slicing prompt. Add fdm_fit whenever a part meets a real object or another part, to choose each fit by what that interface has to do. Add fdm_flexures whenever a part must flex, grip, snap, clip, spring, or hold something by bending. Add fdm_multicolor when several colours or support materials share a print, fdm_assembly when a split, joint or printed fastener could help, and fdm_after_slice as a separate review turn after a candidate has been sliced, before presenting the manufacturing recommendation. Read " + FDM_CAPABILITY_URI + " when a bridge or overhang is consequential and there is no sufficiently specific measured capability available. Read " + FDM_FIT_URI + " for the same fit guidance as the fdm_fit prompt, in resource form.";
|
package/dist/index.js
CHANGED
|
@@ -48,7 +48,7 @@ import { bambuPrinterInfo, bambuSliceCapabilities } from "./counterpart/info.js"
|
|
|
48
48
|
import { DISCOVER_OUTPUT_SCHEMA, discoverBambu } from "./counterpart/discovery.js";
|
|
49
49
|
import { SETUP_FIELDS_OUTPUT_SCHEMA, bambuSetupFields, slicerSetup } from "./counterpart/setup.js";
|
|
50
50
|
import { PROPOSE_FILAMENTS_INPUT_PROPERTIES, PROPOSE_FILAMENTS_OUTPUT_SCHEMA, NO_COLOUR_NAMES, bambuTrayLabel, loadColourNames, proposeFilaments, spoolName } from "./counterpart/filaments.js";
|
|
51
|
-
import { DESIGN_PROMPTS, FDM_CAPABILITY_GUIDANCE, FDM_CAPABILITY_RESOURCE, FDM_CAPABILITY_URI, FDM_SLICING_PROMPT, SERVER_INSTRUCTIONS, slicingGuidance } from "./design-guidance.js";
|
|
51
|
+
import { DESIGN_PROMPTS, FDM_CAPABILITY_GUIDANCE, FDM_CAPABILITY_RESOURCE, FDM_CAPABILITY_URI, FDM_FIT_GUIDANCE, FDM_FIT_RESOURCE, FDM_FIT_URI, FDM_SLICING_PROMPT, SERVER_INSTRUCTIONS, slicingGuidance } from "./design-guidance.js";
|
|
52
52
|
import { bambuProgress, offlineProgress } from "./counterpart/progress.js";
|
|
53
53
|
import { makeCounterpart3mf } from "./counterpart/make-3mf.js";
|
|
54
54
|
import { MAKE_3MF_OUTPUT_SCHEMA, PRINT_PROGRESS_OUTPUT_SCHEMA, PRINTER_INFO_OUTPUT_SCHEMA } from "./counterpart/schemas.js";
|
|
@@ -1922,7 +1922,8 @@ class BambuPrinterMCPServer {
|
|
|
1922
1922
|
mimeType: "application/json",
|
|
1923
1923
|
description: "HMS and error-related fields from the latest printer status"
|
|
1924
1924
|
},
|
|
1925
|
-
FDM_CAPABILITY_RESOURCE
|
|
1925
|
+
FDM_CAPABILITY_RESOURCE,
|
|
1926
|
+
FDM_FIT_RESOURCE
|
|
1926
1927
|
],
|
|
1927
1928
|
templates: [
|
|
1928
1929
|
{
|
|
@@ -1948,6 +1949,9 @@ class BambuPrinterMCPServer {
|
|
|
1948
1949
|
if (uri === FDM_CAPABILITY_URI) {
|
|
1949
1950
|
return { contents: [{ uri, mimeType: FDM_CAPABILITY_RESOURCE.mimeType, text: FDM_CAPABILITY_GUIDANCE }] };
|
|
1950
1951
|
}
|
|
1952
|
+
if (uri === FDM_FIT_URI) {
|
|
1953
|
+
return { contents: [{ uri, mimeType: FDM_FIT_RESOURCE.mimeType, text: FDM_FIT_GUIDANCE }] };
|
|
1954
|
+
}
|
|
1951
1955
|
const match = uri.match(/^printer:\/\/([^\/]+)\/(.+)$/);
|
|
1952
1956
|
if (!match) {
|
|
1953
1957
|
throw new McpError(ErrorCode.InvalidRequest, `Invalid resource URI: ${uri}`);
|
package/dist/printers/bambu.js
CHANGED
|
@@ -5,7 +5,7 @@ import { cameraNumber } from "./camera-tools.js";
|
|
|
5
5
|
import { cameraFrameParser, cameraAuth } from "./camera-wire.js";
|
|
6
6
|
import { createHash } from "node:crypto";
|
|
7
7
|
import { controlReply, refusedControlMessage } from "../control-reply.js";
|
|
8
|
-
import {
|
|
8
|
+
import { isFinishedIdleJob, isCancelledX2DJob, readFreshPrinterStatus } from "../safety/printer-state.js";
|
|
9
9
|
import fs from "node:fs/promises";
|
|
10
10
|
import { createReadStream, readFileSync, existsSync, mkdirSync, writeFileSync, renameSync, rmSync } from "node:fs";
|
|
11
11
|
import path from "node:path";
|
|
@@ -659,7 +659,7 @@ export class BambuImplementation {
|
|
|
659
659
|
}
|
|
660
660
|
finishedJobIdentity(status) {
|
|
661
661
|
const raw = status.raw;
|
|
662
|
-
return raw.gcode_state === "FINISH" || (isCancelledX2DJob(raw, String(status.model ?? "")) ||
|
|
662
|
+
return raw.gcode_state === "FINISH" || (isCancelledX2DJob(raw, String(status.model ?? "")) || isFinishedIdleJob(raw, String(status.model ?? "")))
|
|
663
663
|
? printJobIdentity(raw)
|
|
664
664
|
: undefined;
|
|
665
665
|
}
|
|
@@ -51,10 +51,14 @@ export declare function finiteNumber(value: unknown): number | undefined;
|
|
|
51
51
|
* and print dispatch rechecks the identity of the observed job.
|
|
52
52
|
*/
|
|
53
53
|
export declare function isCancelledX2DJob(raw: Record<string, any>, model: string): boolean;
|
|
54
|
-
/**
|
|
54
|
+
/** Models observed retaining FAILED for a named prior job while explicitly reporting
|
|
55
|
+
* idle with no print error and no HMS: P1S (#87) and A1 firmware 01.08.01.00 after a
|
|
56
|
+
* user-stopped job. Add a model only with that hardware evidence. */
|
|
57
|
+
export declare const FINISHED_WHEN_FAILED_IDLE_MODELS: ReadonlySet<string>;
|
|
58
|
+
/** Bambu Studio 2.8.2.61 marks FAILED as finished. Limit recovery to the models above and
|
|
55
59
|
* a named prior job explicitly reporting idle, no print error and no HMS.
|
|
56
60
|
* Dispatch rechecks the observed job identity. */
|
|
57
|
-
export declare function
|
|
61
|
+
export declare function isFinishedIdleJob(raw: Record<string, any>, model: string): boolean;
|
|
58
62
|
/** Nozzles whose reported diameter and type are configured settings rather than chip readings. */
|
|
59
63
|
export declare function unchippedNozzles(raw: unknown): number[];
|
|
60
64
|
export type HmsEntry = {
|
|
@@ -131,11 +131,17 @@ export function isCancelledX2DJob(raw, model) {
|
|
|
131
131
|
finiteNumber(raw.print_error) === 0 && finiteNumber(raw.fail_reason) === 0x0300400c &&
|
|
132
132
|
[raw.gcode_file, raw.subtask_name].some(value => typeof value === "string" && value.trim().length > 0);
|
|
133
133
|
}
|
|
134
|
-
/**
|
|
134
|
+
/** Models observed retaining FAILED for a named prior job while explicitly reporting
|
|
135
|
+
* idle with no print error and no HMS: P1S (#87) and A1 firmware 01.08.01.00 after a
|
|
136
|
+
* user-stopped job. Add a model only with that hardware evidence. */
|
|
137
|
+
export const FINISHED_WHEN_FAILED_IDLE_MODELS = new Set(["p1s", "a1"]);
|
|
138
|
+
/** Bambu Studio 2.8.2.61 marks FAILED as finished. Limit recovery to the models above and
|
|
135
139
|
* a named prior job explicitly reporting idle, no print error and no HMS.
|
|
136
140
|
* Dispatch rechecks the observed job identity. */
|
|
137
|
-
export function
|
|
138
|
-
|
|
141
|
+
export function isFinishedIdleJob(raw, model) {
|
|
142
|
+
const normalized = normalizeModel(model);
|
|
143
|
+
return normalized !== undefined && FINISHED_WHEN_FAILED_IDLE_MODELS.has(normalized) &&
|
|
144
|
+
raw.gcode_state === "FAILED" && raw.print_type === "idle" &&
|
|
139
145
|
finiteNumber(raw.print_error) === 0 && Array.isArray(raw.hms) && raw.hms.length === 0 &&
|
|
140
146
|
[raw.gcode_file, raw.subtask_name].some(value => typeof value === "string" && value.trim().length > 0);
|
|
141
147
|
}
|
|
@@ -329,7 +335,7 @@ export function isPauseNotice(raw, requireIdle) {
|
|
|
329
335
|
}
|
|
330
336
|
function validateErrors(raw, requireIdle, serial, model) {
|
|
331
337
|
const state = typeof raw.gcode_state === "string" ? raw.gcode_state.toUpperCase() : "UNKNOWN";
|
|
332
|
-
const terminal = isCancelledX2DJob(raw, model) ||
|
|
338
|
+
const terminal = isCancelledX2DJob(raw, model) || isFinishedIdleJob(raw, model);
|
|
333
339
|
if (requireIdle && !["IDLE", "FINISH"].includes(state) && !terminal)
|
|
334
340
|
throw new PrinterRefusal("printer-not-ready", `Printer state ${state} is not safely idle.`);
|
|
335
341
|
if (!requireIdle && !["IDLE", "FINISH", "RUNNING", "PAUSE"].includes(state) && !terminal)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bambu-printer-mcp",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.86",
|
|
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": {
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"author": "David Montgomery",
|
|
49
49
|
"license": "GPL-2.0",
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@modelcontextprotocol/sdk": "^1.32.
|
|
51
|
+
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
52
52
|
"bambu-node": "3.22.21",
|
|
53
|
-
"basic-ftp": "^6.2.
|
|
53
|
+
"basic-ftp": "^6.2.6",
|
|
54
54
|
"dotenv": "^16.3.1",
|
|
55
55
|
"jszip": "^3.10.2",
|
|
56
56
|
"mqtt": "^5.16.1",
|
package/src/cad/contracts.ts
CHANGED
|
@@ -313,5 +313,7 @@ Captured mesh preparation: load_scan(name, source_units="m" or "mm", up_axis="x"
|
|
|
313
313
|
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.
|
|
314
314
|
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.
|
|
315
315
|
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.
|
|
316
|
-
The result includes paths, millimetre bounds/size, mesh and STEP volumes, solid count, watertight/manifold/winding/STEP checks, six orthographic renders (front, back, left, right, top, bottom) and contact sheet. Inspect all six; revise visible defects. 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.
|
|
316
|
+
The result includes paths, millimetre bounds/size, mesh and STEP volumes, solid count, watertight/manifold/winding/STEP checks, six orthographic renders (front, back, left, right, top, bottom) and contact sheet. Inspect all six; revise visible defects. 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.
|
|
317
|
+
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.
|
|
318
|
+
Check insertion and articulated poses with cad_check_fit against each object state that matters (the bare product, the product in its case, and the case with its attachment as its own reference envelope), including the widest section on the way in. Report interference and minimum gap per state. In your summary, attach each "fits", "holds", and "prints without supports" claim to the check or slice number that shows it; a valid flag alone shows none of them. Apply fdm_design and fdm_slicing too, with fdm_fit and fdm_flexures when they apply; never invoke a printer as part of constructing CAD.`,
|
|
317
319
|
};
|
package/src/design-guidance.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CAD_DESIGN_PROMPT } from "./cad/contracts.js";
|
|
2
2
|
/**
|
|
3
3
|
* Manufacturing guidance for agents that design printable models: David Montgomery's FDM design
|
|
4
|
-
* prompt pack (3 November 2026),
|
|
5
|
-
* MCP
|
|
6
|
-
* attach each piece.
|
|
4
|
+
* prompt pack (3 November 2026), with later fit, flexure and printed-fastener guidance in the
|
|
5
|
+
* same voice. Served as MCP prompts and resources; the other printer MCP (bambu-printer-mcp /
|
|
6
|
+
* mcp-3D-printer-server) serves the same text. Clients choose when to attach each piece.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
export interface DesignPrompt { name: string; title: string; description: string; text: string }
|
|
@@ -14,7 +14,9 @@ Use the actual printer and material context: nozzle arrangement and filament rou
|
|
|
14
14
|
|
|
15
15
|
Before committing to detailed geometry, choose a plausible way to manufacture and assemble it. For a consequential tradeoff, compare the strongest one-piece approach with a meaningfully different orientation or split. Simple parts do not need a design tournament. Judge total effort to obtain a good finished object: printing, consumed filament, likely rework, support cleanup, assembly, and extra hardware. Respect the user's priorities instead of applying fixed numerical weights.
|
|
16
16
|
|
|
17
|
-
Keep assembled orientation and print orientation distinct. Preserve critical dimensions and mating surfaces. Account for measurement uncertainty and fit clearance separately; a scan or printed measuring tool does not establish its own accuracy. Use the smallest useful fit sample when uncertainty could otherwise waste a substantial print.
|
|
17
|
+
Keep assembled orientation and print orientation distinct. Preserve critical dimensions and mating surfaces. Account for measurement uncertainty and fit clearance separately; a scan or printed measuring tool does not establish its own accuracy. Use the smallest useful fit sample when uncertainty could otherwise waste a substantial print. When the request names a product, a vehicle, or a standard part, look up its published dimensions and use them, labelled as published. A size the person confirmed without changing a prefilled number is not a measurement. If a case, cover, or attachment is mentioned, the bare product's size is not the size to design to. Ask the person only for what no source gives, and where possible shape the design so an unmeasured dimension does not decide whether it works.
|
|
18
|
+
|
|
19
|
+
Choose each fit by what that interface has to do: drop in and lift out, slide, locate without rattle, grip so it does not slip or turn, snap over, or press in to stay. There is no single fit number. Keep three things apart for each interface: the object's size and how sure it is, the correction this printer and orientation need (its own observed corrections first, when the context supplies them), and the fit the function calls for. When the size's uncertainty is wider than the function tolerates, do not answer with a better number: choose a mechanism that absorbs the difference (crush ribs, a split closed by a screw, a flexure, a snap), or ask for the one measurement that settles it. The same object changes with time and use: full and nearly empty, new and worn, soft and stiff. A fit that relies on the object giving way must still work in its stiffest, largest state, and a pocket is sized to the widest section the object passes through on the way in, with support where the object actually bears, not to its bounding box.
|
|
18
20
|
|
|
19
21
|
Evaluate printability locally. Distinguish a progressively supported overhang, a bridge anchored at both ends, and a disconnected island. State overhang angles from vertical: 0 degrees is a vertical wall; 90 degrees is a horizontal underside. Convert conventions before setting slicer angles. Use relevant measured capability ahead of generic rules. A 45-degree threshold is not a universal support requirement, and a steep surface is not automatically unprintable. Judge bridge length along the actual unsupported extrusion path, with its anchors, cooling, material, and required underside quality. A feature that survives printing may still miss a cosmetic or dimensional requirement.
|
|
20
22
|
|
|
@@ -22,13 +24,15 @@ Resolve a difficult region with the least disruptive effective change: a better
|
|
|
22
24
|
|
|
23
25
|
Choose layer orientation, material, walls, and joints for the actual loads and environment. Check the load path, flexing features, fastener access, and installation sequence. A reduction in supports or color changes must not silently weaken the part or defeat its fit.
|
|
24
26
|
|
|
27
|
+
When a part must flex, grip, snap, clip, spring, or hold something, consider a compliant mechanism first: one piece that bends on purpose often beats rigid jaws plus a clamp bolt, with fewer parts, no fastener to buy or lose, and a hold that follows the object. Spread the bending over a long band, leaf, or arch rather than a short stub; keep the rest of the body stiff so the stroke goes where you intend; give a hand enough leverage; design the preload in; use an over-centre or cam where a hold must lock; and give every flexing direction a hard stop so a hard pull meets solid material. Keep the bending in the layer plane, where the filament runs along the strain; bending that pulls layers apart is far weaker and fails with little warning. Choose the strain by duty (bent once to assemble, bent every day, and held bent for months are different designs) and by material and direction, using the printer's own observed values when the context supplies them. Modern PLA and PETG grades are not brittle in this role: proven printed springs work daily at strains that older moulded-plastic tables would forbid. What usually ends a flexure is not a clean snap at a magic percentage but whitening and set at a sharp root, layers parting where the bend crosses them, or a held bend creeping loose, faster when warm. In sustained heat such as a parked car, a part held bent relaxes and a sun-heated dashboard can exceed what PLA or PETG carry under load: prefer a rest state that sits unstrained, and say so when the material cannot honestly do the job. A part a hand works has to be easy to work, and that is checked like its hold: say where the fingers go, how hard they push to open it, how far it opens, and how the object goes in and comes out with one hand. A grip that meets its force and is a fight to use has failed the brief.
|
|
28
|
+
|
|
25
29
|
On a shared-nozzle multicolor setup, reason about filament transitions across layers, including support-interface material. Total color count alone is a poor cost estimate. Consider color placement, shallow inlays, separately printed accents, and part orientation while preserving the requested appearance. Separate bodies on one layer-printed plate can still cause repeated swaps. Use the slicer's actual schedule and estimates when available; do not invent a fixed cost per color change.
|
|
26
30
|
|
|
27
|
-
Use assembly when its benefit is worth the user's additional work. Design alignment, clearance, engagement, and assembly access deliberately. Glue is a valid planned joining method for suitable materials and loads; make joints self-locating and give them useful bonding area. Use mechanical retention when loads, repeated flexing, or serviceability call for it. State needed glue, hardware, tools, and assembly effort plainly. Avoid adding parts when a modest support or a simple one-piece print is the better result.
|
|
31
|
+
Use assembly when its benefit is worth the user's additional work. Design alignment, clearance, engagement, and assembly access deliberately. Glue is a valid planned joining method for suitable materials and loads; make joints self-locating and give them useful bonding area. Use mechanical retention when loads, repeated flexing, or serviceability call for it. State needed glue, hardware, tools, and assembly effort plainly. Avoid adding parts when a modest support or a simple one-piece print is the better result. A printed screw, nut, or threaded hole is an ordinary choice at hand sizes (M8 and up as the usual starting point, about M6 as the floor) with a coarse profile shaped to print without supports; below that floor, under sustained preload that must not relax, in heat, or under shock, a metal screw or insert is the honest choice. Keep threads out of the main load path where a shoulder, tenon, key, or serrated face can carry shear and torque, and let the thread only hold the joint closed.
|
|
28
32
|
|
|
29
|
-
Verify the chosen geometry in its actual print orientation and inspect the slice when tools permit. Check critical fits, missing or floating features, toolpaths, supports, color assignments, total time, and material consumption. Treat a slicer prediction as a prediction, not a physical test. Fix consequential problems and re-slice relevant changes. Stop when the design meets the brief and no remaining improvement justifies its cost.
|
|
33
|
+
Verify the chosen geometry in its actual print orientation and inspect the slice when tools permit. Check critical fits, missing or floating features, toolpaths, supports, color assignments, total time, and material consumption. Treat a slicer prediction as a prediction, not a physical test. Fix consequential problems and re-slice relevant changes. Stop when the design meets the brief and no remaining improvement justifies its cost. State "prints without supports", "holds", or "fits" only when the engine's own checks or the slice show it, and give the number that shows it; otherwise call it an untested prediction.
|
|
30
34
|
|
|
31
|
-
Keep the user-facing result short: the recommended design, why its manufacturing approach makes sense, how it prints and assembles, and any consequential unresolved assumption. Distinguish measured dimensions, slicer estimates, and untested predictions. Keep detailed analysis in the working process.`;
|
|
35
|
+
Keep the user-facing result short: the recommended design, why its manufacturing approach makes sense, how it prints and assembles, and any consequential unresolved assumption. Distinguish measured dimensions, slicer estimates, and untested predictions. Say where each critical size came from (measured, published, or assumed) and what each interface is meant to do and how it fits. Keep detailed analysis in the working process.`;
|
|
32
36
|
|
|
33
37
|
export const FDM_MULTICOLOR = `Apply this guidance when multiple colors or support materials share a print.
|
|
34
38
|
|
|
@@ -50,16 +54,36 @@ Put boundaries where they are structurally sensible and visually deliberate. Use
|
|
|
50
54
|
|
|
51
55
|
For suitable lightly loaded rigid details, a locating pocket plus a compatible adhesive can be the simplest reliable solution. For a loaded clamp, a joint under peel or repeated bending, or a serviceable assembly, consider fasteners or mechanically captured geometry. Do not assume a tiny glued butt joint can carry the same load as an intact printed section. Select adhesive from evidence for the actual materials and conditions; superglue is an option, not a universal material property.
|
|
52
56
|
|
|
53
|
-
State the practical consequence directly: which parts print in which orientations and colors, how they locate, how they are retained, which supplies are needed, and the estimated hands-on work. Keep hands-on time separate from adhesive cure time. Check a small joint sample only when its uncertain fit or strength would change the design decision
|
|
57
|
+
State the practical consequence directly: which parts print in which orientations and colors, how they locate, how they are retained, which supplies are needed, and the estimated hands-on work. Keep hands-on time separate from adhesive cure time. Check a small joint sample only when its uncertain fit or strength would change the design decision.
|
|
58
|
+
|
|
59
|
+
Printed threads need a profile made for printing, not a copy of a metal V-thread. A coarse, truncated thread whose flanks sit within the printer's proven overhang (one widely printed all-plastic kit uses about a 96-degree included angle, 42 degrees from vertical, at pitches of roughly 2-3 mm for M8-M12 sizes, cleared by roughly two tenths of a millimetre per side at the pitch line) prints upright without supports and keeps its teeth in solid wall loops. Keep the pitch exactly the same on screw and hole; make clearance by shifting the profile radially, never by scaling the screw, which changes the pitch and wedges after a few turns. Give a hand screw several full turns of engagement and a knob that limits how hard it can be torqued. A long, slender screw that must pull or bend is better printed flat or split so filament runs along its length than stood upright across its layers. Where preload must survive months, heat, or shock, or the size is below about M6-M8, use a metal screw or heat-set insert and say so. When the context supplies this printer's own thread fit observation, use it ahead of any generic allowance.`;
|
|
54
60
|
|
|
55
61
|
export const FDM_AFTER_SLICE = `Review this slice against the user's brief and the selected manufacturing plan. Use the returned slice, geometry, profile, and calibration evidence; do not assume missing metrics are zero.
|
|
56
62
|
|
|
57
63
|
Check that the actual toolpaths preserve critical features, fit, connected material, intended colors, and load-bearing sections. Inspect consequential first layers, bridges, islands, supported undersides, and removal access. Compare expected total print time, total material across all plates, and manual work with the best credible alternative. Keep purge, prime-tower, support, and model quantities distinct only when the data provides a non-overlapping breakdown.
|
|
58
64
|
|
|
59
|
-
If the plan is unexpectedly costly or fragile, identify the dominant cause and make the smallest change that preserves the brief. Re-slice after a relevant geometry, orientation, material, or process change. Do not optimize a minor imperfection at the expense of function or appearance, and do not invent a redesign simply to produce criticism.
|
|
65
|
+
If the plan is unexpectedly costly or fragile, identify the dominant cause and make the smallest change that preserves the brief. Re-slice after a relevant geometry, orientation, material, or process change. Do not optimize a minor imperfection at the expense of function or appearance, and do not invent a redesign simply to produce criticism. Check every support, fit, and hold claim in the summary against a number from the slice or the engine's checks (support area and worst overhang, engagement and gap, estimated bite at the forced opening). A claim without its number comes out or is labelled a prediction.
|
|
60
66
|
|
|
61
67
|
Return a concise decision: keep, revise, or validate one specific uncertainty. Include the decisive evidence and the exact next action. A clean slice supports a printability prediction; it does not verify physical fit, strength, or bridge quality.`;
|
|
62
68
|
|
|
69
|
+
export const FDM_FLEXURES = `Apply this guidance when a part must flex, grip, snap, clip, spring, or hold something by bending. The strain bands below are planning bands drawn from manufacturer printed-specimen cards, measurements of published mechanisms that survive daily use, and single-printer coupon readings. They are not guarantees and not rejection thresholds. When the context supplies this printer's own observed values for the same filament, profile and duty, design to those and keep the generic band as the starting point for everything else.
|
|
70
|
+
|
|
71
|
+
A compliant design earns its place when one bending piece replaces rigid jaws, a hinge and a clamp bolt: fewer parts, nothing to buy or lose, one print, and a hold that follows the object as it varies. Prefer it for holders, clips, snaps, lids and latches a hand operates. Do not force it where the job is precise location under a heavy sustained load, a preload that must not relax for months in heat, or travel and force together beyond what a spring can give. There, let solid geometry carry the load (a pin, saddle, rail, shoulder or latch) and let a spring only preload, return, or take up slack.
|
|
72
|
+
|
|
73
|
+
Choose the architecture before the dimensions. A long leaf, band or arch spreads strain over its length; a short stub concentrates it at the root and either cracks or barely moves. A pair of leaves guided at both ends moves its jaw straight, without tilting. Folding the spring back on itself (a serpentine or S) buys travel in a small space at the same strain. A thick curved arch gives a strong bite over a short opening. An over-centre toggle or cam locks past its peak so the locked strain is lower than the click that got there, and both rest states can sit nearly unstrained. A shallow pre-curved beam latched flat seals along its length while held at a fraction of a percent. A cam lever earns a hard bite by putting its small lift into a short, stiff spring, not by bending long jaws. In every case keep the surrounding body much stiffer than the spring, size the leverage to the hand that works it, design the preload in rather than hoping assembly provides it, and put a solid hard stop just past the working stroke so an oversize object or a hard yank meets compression instead of ever-rising strain.
|
|
74
|
+
|
|
75
|
+
Judge bite at the opening the object actually forces, where the force is taken. The same clip is several times stiffer when a flat rigid object holds its jaws from turning than when a round finger lets them turn; one measured clip changed about fivefold between those contacts. Grip that must not slip is force times friction; feel and marking are pressure. A narrow ridge concentrates a modest force into a high pressure that seals, grips and, on skin, hurts; a broad flat jaw needs roughly an order of magnitude more force for the same pressure. State the opening, the contact you assumed, and the friction you used. Published dry static friction for printed PLA on itself spans roughly 0.12-0.38 (one printer read 0.25-0.31 on both faces) and PETG on itself roughly 0.13-0.21: use the low end when checking that a hold retains, the high end when checking that a hand can still insert it. Friction against the held object (a phone case, glass, paint) is unknown unless the context gives it; do not substitute the self-contact range for it.
|
|
76
|
+
|
|
77
|
+
Keep the bending in the layer plane. Filament laid along the strained length carries the bend; a bend that pulls layers apart works at a fraction of that strength (across-layer tensile strength is roughly half to nine-tenths of in-plane depending on grade and test) and parts with little warning. Turn the part, split it, or reshape the spring so its length lies in the layers. If a bend across layers is truly unavoidable, keep its strain well below the in-plane bands, give it generous roots, and bring its hard stop close. Make the spring from continuous wall loops: choose its thickness as whole extrusion widths and enough walls that no sparse infill sits inside the neck. Taper toward the tip where travel allows, fillet every root or curve continuously through it, and never hang a spring from a sharp internal corner.
|
|
78
|
+
|
|
79
|
+
Choose strain by duty first, then material. In the layer plane, as planning bands: held bent for months at room temperature, keep PLA to about 0.5% or less and PETG to about 1.4% or less, and prefer a shape whose rest state is unstrained so holding costs nothing; bent every day for hundreds to thousands of cycles, proven mechanisms commonly work at about 1.5-2.6% in PLA and about 2-3.4% in PETG; bent once to assemble, or touched only at the hard stop, PLA on one coupon-tested printer survived 3.3% once and ten times in both orientations without cracking, and proven PETG designs peak at about 4-4.3%. Treat those peaks as no-crack evidence, not proof of full spring-back: past roughly 3.3-3.4% PLA begins to whiten and take set in published printed-specimen testing, long before its published break elongation (about 12% in-plane for one current PLA grade), because break includes permanent deformation a spring cannot use. Older moulded-plastic snap allowances near 1-1.7% are not printed fracture limits; designing every spring to them produces weak, timid parts. Grade matters as much as polymer family: current cards put one PETG grade's tensile modulus near 2780 MPa and another's near 1810 MPa, so size force from the actual grade's card or an observed deflection (one printer's PLA measured about 2600 MPa, close to its 2580 MPa card), never from the family name alone.
|
|
80
|
+
|
|
81
|
+
Expect, in order: a sharp root whitens, yields and takes set; a bend across layers delaminates; a held bend creeps and its force fades; only then does a well-shaped in-plane spring crack. Design so the first failure you would meet is harmless and visible, and so the hard stop prevents the rest.
|
|
82
|
+
|
|
83
|
+
Heat changes the answer before it melts anything. PLA grades soften under load from roughly the mid-50s C (heat deflection about 54-57 C, glass transition about 60 C) and PETG grades from roughly the low 60s to about 70 C depending on grade and load (glass transition about 66-69 C); published creep tests already move faster after brief warming near 46 C. A sun-parked dashboard has been documented around 70 C within an hour. Judge by exposure and load together: a shaded, unloaded trim piece is not a loaded spring on a dashboard. For sun-exposed parts that must stay bent or carry load, neither PLA nor PETG is an honest default; prefer a higher-temperature filament the printer actually has, a rest state at zero strain while parked empty, and positive capture (lips, shelves, a latch) so friction alone never decides whether the object stays. Say plainly when the loaded filaments cannot do the thermal job instead of silently printing it anyway.
|
|
84
|
+
|
|
85
|
+
In the result, give the duty you designed for, how a hand operates it (where the fingers go and the force to open it at the tabs), the working and hard-stop strains and how you estimated them, the bite or spring force at the stated opening with its contact and friction assumptions, the rest strain, and the heat verdict. A force without its opening, or a strain without its duty, is not yet a claim.`;
|
|
86
|
+
|
|
63
87
|
export const FDM_CAPABILITY_GUIDANCE = `# Bridges and overhangs: useful capability without arbitrary bans
|
|
64
88
|
|
|
65
89
|
Load this reference only when the feature matters to the manufacturing decision. These are proposed planning bands, not manufacturer guarantees, support-generation settings, or automatic acceptance/rejection rules.
|
|
@@ -175,14 +199,142 @@ export const FDM_CAPABILITY_URI = "guidance://fdm/capability-guidance";
|
|
|
175
199
|
export const FDM_CAPABILITY_RESOURCE = { uri: FDM_CAPABILITY_URI, name: "FDM bridge and overhang guidance", mimeType: "text/markdown",
|
|
176
200
|
description: "Planning bands and evidence for bridges and overhangs, for when one is consequential and there is no sufficiently specific measured capability available" };
|
|
177
201
|
|
|
202
|
+
/** How to choose each fit by what the interface has to do on a filament printer (Nov 10: 0.5 mm a side was right for a
|
|
203
|
+
* drop-in bottle holder and would ruin a mic clamp). Sources are cited inline; the bands and the slot span are app priors. Served as the fdm_fit prompt and the fit-by-function resource so prompt-only workers read the same text. */
|
|
204
|
+
export const FDM_FIT_GUIDANCE = `# Choosing a fit by function on a filament printer
|
|
205
|
+
|
|
206
|
+
Read this whenever a printed part meets a real object or another part. It covers how to choose each fit and why it prints the way it does. The ranges here are starting points tied to a function, a feature size and a 0.4 mm nozzle. The person's result ("did it fit?") corrects them. There is no single fit number.
|
|
207
|
+
|
|
208
|
+
## Three things, kept apart per interface
|
|
209
|
+
|
|
210
|
+
1. **The object's true size**, how it was measured (calipers, a published dimension, a scan, a photo estimate), and how sure that size is.
|
|
211
|
+
2. **The print correction** for this printer, material and orientation. Pockets and holes print undersize, and walls stepped by layers differ from walls drawn in one layer.
|
|
212
|
+
3. **The design fit**, which comes only from what the interface has to do.
|
|
213
|
+
|
|
214
|
+
If the three fold into one number, a result like "0.5 mm per side and it was loose" teaches nothing reusable. Say which of the three the result corrects.
|
|
215
|
+
|
|
216
|
+
## Say what each interface has to do
|
|
217
|
+
|
|
218
|
+
Name the function in plain words, and infer it first from the object and how the part mounts. A wall holder that opens upward is a drop-in. A mount on a pole must not turn. A person will not say "grips". When the function is unclear and the answer changes the design, ask about behaviour: should it stay in when turned upside down, lift out with one hand, ever turn?
|
|
219
|
+
|
|
220
|
+
| Function | Band it tolerates (app prior) | What usually works |
|
|
221
|
+
| --- | --- | --- |
|
|
222
|
+
| Rests in, or drops in and lifts out | Forgiving: a few tenths of a millimetre either way | Plain clearance, a lead-in at the mouth |
|
|
223
|
+
| Slides | Moderate | Clearance plus enough engagement length that it does not rock |
|
|
224
|
+
| Locates without rattle | Tight | Small clearance with a chamfer or taper, or a flexure that takes up the slack |
|
|
225
|
+
| Grips so it does not slip or turn | Very tight: a few hundredths | Crush ribs, a split with a pinch screw, or a flexure. Never a bare number |
|
|
226
|
+
| Clamps closed with a screw | The clamp's travel | A split with a screw, sized so the screw's range covers the size's uncertainty |
|
|
227
|
+
| Snaps over | The snap's deflection | A snap whose arm flexes within its layers |
|
|
228
|
+
| Presses in to stay | Very tight, and it creeps | Crush ribs or a screw. A pure press is for light or short-lived loads |
|
|
229
|
+
|
|
230
|
+
The bands are deliberate priors for this app, not values from a cited source. When the size's uncertainty is wider than the function's band (for example, a scan or photo estimate for a grip), do not answer with a better number. Choose a mechanism that absorbs the difference, or ask for the one caliper measurement that settles it.
|
|
231
|
+
|
|
232
|
+
## Why filament prints fit the way they do
|
|
233
|
+
|
|
234
|
+
- **Holes print undersize.** Protolabs Network: "FDM often prints undersized vertical-axis holes." Each new layer is pressed onto the ones below. "The amount of undersize depends on the printer, slicing software, hole size and material." [F1] HydraRaptor gives two more causes. A hole drawn as a polygon has sides inside the circle, "shrinking it by cos(π / n)". And filament dragged round a corner "likes to take a short-cut", which its author judged the dominant effect on their own machines. [F6] Small holes suffer most, relative to their size. The slicer can correct holes and outer contours separately (OrcaSlicer's X-Y hole and contour compensation) and can rebuild round holes as polyholes. [F5] Check what the active profile applies before adding your own allowance, so it is not applied twice.
|
|
235
|
+
- **First layers flare.** The first layer spreads into an "elephant's foot" that "can impact the ability to assemble FDM parts". Protolabs Network suggests a 45° chamfer or radius on edges that touch the build plate. [F1] OrcaSlicer's elephant-foot compensation shrinks the first layers, and only when the object sits directly on the plate. [F5] A pocket's mouth or a rim that prints on the plate needs either the chamfer or that setting.
|
|
236
|
+
- **A hole lying on its side differs from one standing upright.** A vertical-axis hole is drawn as a circle in every layer and carries only the undersize above. A horizontal-axis hole cuts across the layers. Its top is an overhang that ends in a bridge: Protolabs Network notes that bridges "most often occur in horizontal-axis holes". [F1] So it sags, comes out short from top to bottom, and is stepped on its sides. For a round fit on its side, give the hole a teardrop or flat roof and keep the bearing faces at the sides, or turn the part. Any overhang guidance applies to that roof.
|
|
237
|
+
- **Engagement length matters.** A longer engagement keeps a slide from rocking and spreads a grip. A short one concentrates the load on a few layers and lets a part tilt within its clearance. This is design reasoning, not a sourced value.
|
|
238
|
+
- **Plastic creeps under a constant load.** Dogan (2022) found that printed polymers, PLA among them, "undergo significant changes in their dimensions under continuous loading conditions", and that material type, temperature and load level all mattered. [F9] A pure press fit or a constant clamp therefore loosens over weeks, and faster when warm. Where a part must hold for months, prefer a screw you can re-tighten or a snap that carries load only during assembly.
|
|
239
|
+
- **How the object yields matters too.** A squeezable bottle, a rigid pole and a rubber-sleeved cable want different fits. A soft object can take some interference. A rigid one makes the print take all of it. The same object is not one size for its whole life: a bottle full and nearly empty, a case new and worn, a strap stretched and relaxed present different sizes and stiffnesses. A fit that relies on the object giving way must work in its stiffest, largest state, and a fit that must retain must still retain in its smallest, softest state. This is design reasoning, not a sourced value.
|
|
240
|
+
|
|
241
|
+
## Mechanisms that absorb uncertainty
|
|
242
|
+
|
|
243
|
+
- **Crush ribs.** Small ribs inside a bore deform as the part is pressed in, so the part touches only the ribs. Hackaday calls them "far easier (and more forgiving)" than a full-bore press, and notes that "a 0.1 mm difference can have a noticeable effect" on a plain fit. [F7] In molding practice, three or more ribs along the hole deform at their narrow tips "without creating a lot of stress on the part". [F8] A crushed rib does not recover, so use ribs for parts assembled once, with light loads.
|
|
244
|
+
- **A split with a pinch screw.** A slot through one side of the bore with a screw across it. The screw's travel covers a range of sizes, and a screw can be re-tightened after creep. Use it for a pole, a tube or a handle whose size is a scan or photo estimate, and say the range it holds.
|
|
245
|
+
- **A flexure.** A thin arm or a sprung finger presses on the object. Use it to locate without rattle or to hold a soft object, where an exact size is unknown.
|
|
246
|
+
- **A snap.** Protolabs Network gives these rules for 3D-printed snaps:
|
|
247
|
+
- Taper the beam toward the tip, because a constant-thickness beam strains most at the root.
|
|
248
|
+
- Make the root fillet at least 0.5 times the base thickness, and the beam at least 5 mm wide.
|
|
249
|
+
- Avoid cantilevers built vertically in the Z direction.
|
|
250
|
+
- Deflect the snap only during assembly, not in service.
|
|
251
|
+
- Leave 0.5 mm of tolerance for FDM snap-fit connectors. The page does not say whether that is per side. [F2]
|
|
252
|
+
|
|
253
|
+
In short, a snap arm flexes within its layers, never across them.
|
|
254
|
+
|
|
255
|
+
## Starting clearances for a plain fit
|
|
256
|
+
|
|
257
|
+
The sources disagree, and none gives the nozzle, material or whether a value is per side:
|
|
258
|
+
- Prusa says an Original Prusa "will be accurate to at least 0.2 mm". Its first value for movable parts is "at least 0.3 mm", and it says there is no universal value. [F3]
|
|
259
|
+
- The University of Florida makerspace's rule of thumb for parts printed separately on Prusa MK4 and XL printers is:
|
|
260
|
+
- 0.30–0.40 mm for loose parts such as covers;
|
|
261
|
+
- 0.20–0.25 mm for standard sliding fits (tabs, rails, enclosures);
|
|
262
|
+
- 0.15–0.20 mm for snug or alignment fits, "very dependent on surface qualities". [F4]
|
|
263
|
+
|
|
264
|
+
Read these as gaps between facing surfaces on a 0.4 mm nozzle, and treat that reading as an assumption. Use them only where a plain clearance is the right mechanism: loose or sliding fits, and locating fits with a chamfer. A larger feature, a hole on its side or an uncorrected first layer needs more. For a grip or a press, these numbers are not the answer. Use a mechanism above.
|
|
265
|
+
|
|
266
|
+
## This printer's own readings come first
|
|
267
|
+
|
|
268
|
+
When the context supplies fit observations from this printer, filament and orientation, they override the starting points above for the same kind of feature. Keep their scope: an observation about one pin and hole printed together measures the pair, not the hole alone. For scale only (one 0.4 mm-nozzle PLA setup, not a rule for other printers): crush ribs at 0.15 mm per side pressed in and stayed for good while 0.30 mm per side would not go in by hand on a 20 mm pin; an 8 mm printed pin turned firmly in a hole drawn at 8.10 mm; and across the layers a 0.4 mm total gap was firm while 0.6 mm was free. Another printer starts from the cited values and its own first result.
|
|
269
|
+
|
|
270
|
+
## Getting in and staying
|
|
271
|
+
|
|
272
|
+
- Size a pocket to the widest section the object passes through on the way in, not to its bounding box or the scan's average.
|
|
273
|
+
- Derive a pocket's outline by offsetting the object's own outline outward by the clearance, so each pocket corner radius is the object's plus the clearance. A pocket corner rounder than that cuts into the object's corner even when the width and length clear; a sharper one is safe, or relieve the corner. Check the clearance at the corners, not only across the flats.
|
|
274
|
+
- Put a lead-in chamfer at the mouth. Prusa notes that a chamfer on edges that slot together saves effort when assembling. [F3]
|
|
275
|
+
- Over a span of more than about 150 mm, make wall-screw holes slots so the part can be placed despite measuring error. This is an app prior, not a sourced value.
|
|
276
|
+
|
|
277
|
+
## Report each interface
|
|
278
|
+
|
|
279
|
+
In the result, give each interface its function, the size used and its source and uncertainty, the print correction assumed, and the fit chosen (a clearance or interference per side, or the mechanism and the range of sizes it holds), with why. When the person reports how it fitted, change the value their result corrects, and say which one.
|
|
280
|
+
|
|
281
|
+
## Sources
|
|
282
|
+
|
|
283
|
+
[F1] Protolabs Network (Hubs), How to design parts for FDM 3D printing:
|
|
284
|
+
|
|
285
|
+
https://www.hubs.com/knowledge-base/how-design-parts-fdm-3d-printing/
|
|
286
|
+
|
|
287
|
+
[F2] Protolabs Network (Hubs), How do you design snap-fit joints for 3D printing?:
|
|
288
|
+
|
|
289
|
+
https://www.hubs.com/knowledge-base/how-design-snap-fit-joints-3d-printing/
|
|
290
|
+
|
|
291
|
+
[F3] Prusa Knowledge Base, Modeling with 3D printing in mind:
|
|
292
|
+
|
|
293
|
+
https://help.prusa3d.com/article/modeling-with-3d-printing-in-mind_164135
|
|
294
|
+
|
|
295
|
+
[F4] Marston Makerspace, University of Florida, Designing for 3D Printing Tolerances on the MK4 and XL:
|
|
296
|
+
|
|
297
|
+
https://makerspace.uflib.ufl.edu/services/3dprocess/recommended-software-for-3d-printing/designing-for-3d-printing-tolerances-on-the-mk4-and-xl/
|
|
298
|
+
|
|
299
|
+
[F5] OrcaSlicer wiki, Precision (X-Y hole and contour compensation, elephant foot compensation, polyholes):
|
|
300
|
+
|
|
301
|
+
https://www.orcaslicer.com/wiki/print_settings/quality/quality_settings_precision
|
|
302
|
+
|
|
303
|
+
[F6] nophead, HydraRaptor: Polyholes (5 February 2011):
|
|
304
|
+
|
|
305
|
+
https://hydraraptor.blogspot.com/2011/02/polyholes.html
|
|
306
|
+
|
|
307
|
+
[F7] Donald Papp, Hackaday, Adding Crush Ribs To 3D Printed Parts For A Better Press Fit (15 October 2020):
|
|
308
|
+
|
|
309
|
+
https://hackaday.com/2020/10/15/adding-crush-ribs-to-3d-printed-parts-for-a-better-press-fit/
|
|
310
|
+
|
|
311
|
+
[F8] Protolabs, Crush Rib Design Guidelines for Injection Molding:
|
|
312
|
+
|
|
313
|
+
https://www.protolabs.com/resources/design-tips/adding-crush-ribs-to-molded-parts/
|
|
314
|
+
|
|
315
|
+
[F9] O. Dogan, Short-term Creep Behaviour of Different Polymers Used in Additive Manufacturing under Different Thermal and Loading Conditions, Strojniški vestnik – Journal of Mechanical Engineering 68 (7–8), 2022, 451–460, doi:10.5545/sv-jme.2022.191 (abstract):
|
|
316
|
+
|
|
317
|
+
https://ojs30.sv-jme.eu/index.php/sv-jme/article/view/191
|
|
318
|
+
|
|
319
|
+
All sources inspected 10 November 2026.`;
|
|
320
|
+
|
|
321
|
+
export const FDM_FIT_URI = "guidance://fdm/fit-by-function";
|
|
322
|
+
|
|
323
|
+
export const FDM_FIT_RESOURCE = { uri: FDM_FIT_URI, name: "FDM fit by function", mimeType: "text/markdown",
|
|
324
|
+
description: "How to choose each fit where a printed part meets a real object or another part: by what the interface has to do, with why filament prints fit the way they do, mechanisms that absorb size uncertainty, and cited starting points" };
|
|
325
|
+
|
|
178
326
|
export const DESIGN_PROMPTS: DesignPrompt[] = [
|
|
179
327
|
CAD_DESIGN_PROMPT,
|
|
180
328
|
{ name: "fdm_design", title: "Design for FDM printing", text: FDM_CORE,
|
|
181
329
|
description: "Persistent instructions for every design or model-editing task: plan how the object prints as part of the design, using the actual printer, filaments and slice." },
|
|
330
|
+
{ name: "fdm_fit", title: "Choosing a fit by function", text: FDM_FIT_GUIDANCE,
|
|
331
|
+
description: "Add whenever a part meets a real object or another part: choose each fit by what that interface has to do, with why filament prints fit the way they do, mechanisms that absorb size uncertainty, and cited starting points. The same text is the fit-by-function resource." },
|
|
332
|
+
{ name: "fdm_flexures", title: "Parts that flex, grip and snap", text: FDM_FLEXURES,
|
|
333
|
+
description: "Add whenever a part must flex, grip, snap, clip, spring, or hold something by bending: compliant architectures, strain chosen by duty, material and layer direction, bite, heat and creep." },
|
|
182
334
|
{ name: "fdm_multicolor", title: "Multicolour and support materials", text: FDM_MULTICOLOR,
|
|
183
335
|
description: "Add when several colours or support materials share a print: filament transitions, colour placement, plate scheduling and flushing." },
|
|
184
336
|
{ name: "fdm_assembly", title: "Splits, inserts and joints", text: FDM_ASSEMBLY,
|
|
185
|
-
description: "Add when a split, accent insert or
|
|
337
|
+
description: "Add when a split, accent insert, joint or printed fastener could materially improve the result." },
|
|
186
338
|
{ name: "fdm_after_slice", title: "Review a slice", text: FDM_AFTER_SLICE,
|
|
187
339
|
description: "A separate review turn after a candidate has been sliced, before presenting the manufacturing recommendation: keep, revise, or validate one specific uncertainty." },
|
|
188
340
|
];
|
|
@@ -216,4 +368,4 @@ export function slicingGuidance(slicerType: string, capabilities: { supports: bo
|
|
|
216
368
|
export const FDM_SLICING_PROMPT = { name: "fdm_slicing", title: "How this MCP slices",
|
|
217
369
|
description: "Add to every design or model-editing task: how this server's slicer orients a model and generates supports, and how to check a choice with a checkpoint slice." };
|
|
218
370
|
|
|
219
|
-
export const SERVER_INSTRUCTIONS = "When designing or editing a model to print, apply the fdm_design prompt and the fdm_slicing prompt. Add fdm_multicolor when several colours or support materials share a print, fdm_assembly when a split or
|
|
371
|
+
export const SERVER_INSTRUCTIONS = "When designing or editing a model to print, apply the fdm_design prompt and the fdm_slicing prompt. Add fdm_fit whenever a part meets a real object or another part, to choose each fit by what that interface has to do. Add fdm_flexures whenever a part must flex, grip, snap, clip, spring, or hold something by bending. Add fdm_multicolor when several colours or support materials share a print, fdm_assembly when a split, joint or printed fastener could help, and fdm_after_slice as a separate review turn after a candidate has been sliced, before presenting the manufacturing recommendation. Read " + FDM_CAPABILITY_URI + " when a bridge or overhang is consequential and there is no sufficiently specific measured capability available. Read " + FDM_FIT_URI + " for the same fit guidance as the fdm_fit prompt, in resource form.";
|
package/src/index.ts
CHANGED
|
@@ -79,7 +79,7 @@ import { bambuPrinterInfo, bambuSliceCapabilities } from "./counterpart/info.js"
|
|
|
79
79
|
import { DISCOVER_OUTPUT_SCHEMA, discoverBambu } from "./counterpart/discovery.js";
|
|
80
80
|
import { SETUP_FIELDS_OUTPUT_SCHEMA, bambuSetupFields, slicerSetup, type SlicerSetup } from "./counterpart/setup.js";
|
|
81
81
|
import { PROPOSE_FILAMENTS_INPUT_PROPERTIES, PROPOSE_FILAMENTS_OUTPUT_SCHEMA, NO_COLOUR_NAMES, bambuTrayLabel, loadColourNames, proposeFilaments, spoolName, type ColourNames, type ProposalTray } from "./counterpart/filaments.js";
|
|
82
|
-
import { DESIGN_PROMPTS, FDM_CAPABILITY_GUIDANCE, FDM_CAPABILITY_RESOURCE, FDM_CAPABILITY_URI, FDM_SLICING_PROMPT, SERVER_INSTRUCTIONS, slicingGuidance } from "./design-guidance.js";
|
|
82
|
+
import { DESIGN_PROMPTS, FDM_CAPABILITY_GUIDANCE, FDM_CAPABILITY_RESOURCE, FDM_CAPABILITY_URI, FDM_FIT_GUIDANCE, FDM_FIT_RESOURCE, FDM_FIT_URI, FDM_SLICING_PROMPT, SERVER_INSTRUCTIONS, slicingGuidance } from "./design-guidance.js";
|
|
83
83
|
import { bambuProgress, offlineProgress } from "./counterpart/progress.js";
|
|
84
84
|
import { makeCounterpart3mf } from "./counterpart/make-3mf.js";
|
|
85
85
|
import { MAKE_3MF_OUTPUT_SCHEMA, PRINT_PROGRESS_OUTPUT_SCHEMA, PRINTER_INFO_OUTPUT_SCHEMA } from "./counterpart/schemas.js";
|
|
@@ -2428,7 +2428,8 @@ class BambuPrinterMCPServer {
|
|
|
2428
2428
|
mimeType: "application/json",
|
|
2429
2429
|
description: "HMS and error-related fields from the latest printer status"
|
|
2430
2430
|
},
|
|
2431
|
-
FDM_CAPABILITY_RESOURCE
|
|
2431
|
+
FDM_CAPABILITY_RESOURCE,
|
|
2432
|
+
FDM_FIT_RESOURCE
|
|
2432
2433
|
],
|
|
2433
2434
|
templates: [
|
|
2434
2435
|
{
|
|
@@ -2455,6 +2456,9 @@ class BambuPrinterMCPServer {
|
|
|
2455
2456
|
if (uri === FDM_CAPABILITY_URI) {
|
|
2456
2457
|
return { contents: [{ uri, mimeType: FDM_CAPABILITY_RESOURCE.mimeType, text: FDM_CAPABILITY_GUIDANCE }] };
|
|
2457
2458
|
}
|
|
2459
|
+
if (uri === FDM_FIT_URI) {
|
|
2460
|
+
return { contents: [{ uri, mimeType: FDM_FIT_RESOURCE.mimeType, text: FDM_FIT_GUIDANCE }] };
|
|
2461
|
+
}
|
|
2458
2462
|
const match = uri.match(/^printer:\/\/([^\/]+)\/(.+)$/);
|
|
2459
2463
|
|
|
2460
2464
|
if (!match) {
|
package/src/printers/bambu.ts
CHANGED
|
@@ -5,7 +5,7 @@ import {cameraNumber} from "./camera-tools.js";
|
|
|
5
5
|
import {cameraFrameParser, cameraAuth} from "./camera-wire.js";
|
|
6
6
|
import { createHash } from "node:crypto";
|
|
7
7
|
import { controlReply, refusedControlMessage, type ControlReply } from "../control-reply.js";
|
|
8
|
-
import {
|
|
8
|
+
import { isFinishedIdleJob, isCancelledX2DJob, readFreshPrinterStatus } from "../safety/printer-state.js";
|
|
9
9
|
import fs from "node:fs/promises";
|
|
10
10
|
import { createReadStream, readFileSync, existsSync, mkdirSync, writeFileSync, renameSync, rmSync } from "node:fs";
|
|
11
11
|
import path from "node:path";
|
|
@@ -790,7 +790,7 @@ export class BambuImplementation {
|
|
|
790
790
|
|
|
791
791
|
private finishedJobIdentity(status: any): string | undefined {
|
|
792
792
|
const raw = status.raw;
|
|
793
|
-
return raw.gcode_state === "FINISH" || (isCancelledX2DJob(raw, String(status.model ?? "")) ||
|
|
793
|
+
return raw.gcode_state === "FINISH" || (isCancelledX2DJob(raw, String(status.model ?? "")) || isFinishedIdleJob(raw, String(status.model ?? "")))
|
|
794
794
|
? printJobIdentity(raw)
|
|
795
795
|
: undefined;
|
|
796
796
|
}
|
|
@@ -142,11 +142,17 @@ export function isCancelledX2DJob(raw: Record<string, any>, model: string): bool
|
|
|
142
142
|
finiteNumber(raw.print_error) === 0 && finiteNumber(raw.fail_reason) === 0x0300400c &&
|
|
143
143
|
[raw.gcode_file, raw.subtask_name].some(value => typeof value === "string" && value.trim().length > 0);
|
|
144
144
|
}
|
|
145
|
-
/**
|
|
145
|
+
/** Models observed retaining FAILED for a named prior job while explicitly reporting
|
|
146
|
+
* idle with no print error and no HMS: P1S (#87) and A1 firmware 01.08.01.00 after a
|
|
147
|
+
* user-stopped job. Add a model only with that hardware evidence. */
|
|
148
|
+
export const FINISHED_WHEN_FAILED_IDLE_MODELS: ReadonlySet<string> = new Set(["p1s", "a1"]);
|
|
149
|
+
/** Bambu Studio 2.8.2.61 marks FAILED as finished. Limit recovery to the models above and
|
|
146
150
|
* a named prior job explicitly reporting idle, no print error and no HMS.
|
|
147
151
|
* Dispatch rechecks the observed job identity. */
|
|
148
|
-
export function
|
|
149
|
-
|
|
152
|
+
export function isFinishedIdleJob(raw: Record<string, any>, model: string): boolean {
|
|
153
|
+
const normalized = normalizeModel(model);
|
|
154
|
+
return normalized !== undefined && FINISHED_WHEN_FAILED_IDLE_MODELS.has(normalized) &&
|
|
155
|
+
raw.gcode_state === "FAILED" && raw.print_type === "idle" &&
|
|
150
156
|
finiteNumber(raw.print_error) === 0 && Array.isArray(raw.hms) && raw.hms.length === 0 &&
|
|
151
157
|
[raw.gcode_file, raw.subtask_name].some(value => typeof value === "string" && value.trim().length > 0);
|
|
152
158
|
}
|
|
@@ -338,7 +344,7 @@ export function isPauseNotice(raw: Record<string, any>, requireIdle: boolean): b
|
|
|
338
344
|
}
|
|
339
345
|
function validateErrors(raw: Record<string,any>, requireIdle: boolean, serial: string, model: string) {
|
|
340
346
|
const state = typeof raw.gcode_state === "string" ? raw.gcode_state.toUpperCase() : "UNKNOWN";
|
|
341
|
-
const terminal = isCancelledX2DJob(raw, model) ||
|
|
347
|
+
const terminal = isCancelledX2DJob(raw, model) || isFinishedIdleJob(raw, model);
|
|
342
348
|
if (requireIdle && !["IDLE","FINISH"].includes(state) && !terminal) throw new PrinterRefusal("printer-not-ready", `Printer state ${state} is not safely idle.`);
|
|
343
349
|
if (!requireIdle && !["IDLE","FINISH","RUNNING","PAUSE"].includes(state) && !terminal) throw new Error(`Printer state ${state} is unknown or failed.`);
|
|
344
350
|
if (finiteNumber(raw.print_error) !== 0 && !isPauseNotice(raw, requireIdle)) throw new Error("Printer reports a print error or did not report its error state.");
|