bambu-printer-mcp 1.1.96 → 1.1.97

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.
Files changed (46) hide show
  1. package/dist/cad/contracts.js +7 -5
  2. package/dist/cad-engine.js +1 -0
  3. package/dist/counterpart/info.js +1 -0
  4. package/dist/counterpart/make-3mf.d.ts +1 -0
  5. package/dist/counterpart/make-3mf.js +37 -5
  6. package/dist/counterpart/model-plates.d.ts +2 -0
  7. package/dist/counterpart/model-plates.js +3 -0
  8. package/dist/counterpart/part-meshes.d.ts +114 -0
  9. package/dist/counterpart/part-meshes.js +323 -0
  10. package/dist/counterpart/plate-filaments.d.ts +3 -0
  11. package/dist/counterpart/plate-filaments.js +31 -10
  12. package/dist/counterpart/remote.js +1 -0
  13. package/dist/counterpart/schemas.d.ts +10 -0
  14. package/dist/counterpart/schemas.js +2 -0
  15. package/dist/design-app-setup.d.ts +9 -0
  16. package/dist/design-app-setup.js +5 -2
  17. package/dist/design-guidance.d.ts +3 -3
  18. package/dist/design-guidance.js +8 -4
  19. package/dist/index.js +37 -6
  20. package/dist/refusal.d.ts +15 -1
  21. package/dist/refusal.js +19 -1
  22. package/dist/slicer/floating-regions.d.ts +54 -0
  23. package/dist/slicer/floating-regions.js +198 -0
  24. package/dist/slicer/profile-flatten.js +4 -0
  25. package/dist/tool-annotations.js +2 -0
  26. package/package.json +2 -2
  27. package/src/cad/contracts.ts +7 -5
  28. package/src/cad/project3mf.py +9 -4
  29. package/src/cad/scan_measure.py +207 -0
  30. package/src/cad/scan_touchup.py +4 -1
  31. package/src/cad/worker.py +2 -1
  32. package/src/cad-engine.ts +1 -0
  33. package/src/counterpart/info.ts +1 -0
  34. package/src/counterpart/make-3mf.ts +33 -7
  35. package/src/counterpart/model-plates.ts +4 -0
  36. package/src/counterpart/part-meshes.ts +304 -0
  37. package/src/counterpart/plate-filaments.ts +25 -9
  38. package/src/counterpart/remote.ts +1 -0
  39. package/src/counterpart/schemas.ts +4 -0
  40. package/src/design-app-setup.ts +7 -2
  41. package/src/design-guidance.ts +8 -4
  42. package/src/index.ts +38 -6
  43. package/src/refusal.ts +19 -1
  44. package/src/slicer/floating-regions.ts +187 -0
  45. package/src/slicer/profile-flatten.ts +3 -0
  46. package/src/tool-annotations.ts +2 -0
@@ -10,10 +10,10 @@ 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. 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.\n\nFind out before you design, and before you ask. Research whenever the request names something that exists outside the person's hands (a product, a vehicle and its year, a phone, a case, a tool, an appliance, a standard part, a material, the place the part mounts) or a decision turns on a fact about the world (how hot it gets there, what the surface is made of, what adhesive holds on it, where the buttons, ports, vents or airbags are). Do not research what exists only with the person: which of their own things, how something felt, what they prefer, an object they measured or scanned. This takes a few minutes, not an hour, and it works the same with any model that has web tools:\n1. Write down the few facts that decide this design, usually three to seven: each interface's size, where the part mounts and what surrounds that spot, what the surface is made of, the environment, the load.\n2. Search each fact by the exact name, model and year or generation plus the fact itself (\"dimensions mm\", \"technical drawing\", \"accessory design guidelines\", \"spec sheet\", \"parts diagram\", \"teardown\", \"material\"). Run the searches together when the tools allow. Makers of fitted accessories for the same object (mounts, cases, installation kits, replacement panels) publish where things go and how big the openings are; owners publish photos with a tape measure; parts catalogues show each panel's outline. Look there, not only at the maker of the object.\n3. Open the page and read the number. A search-result snippet is not a source. Prefer, in order: the maker's drawing or specification, a standard, a fitted-accessory maker, a reviewer's or owner's measurement, a retailer's listing. Two independent sources that agree beat one.\n4. When a first search finds nothing, rephrase before concluding anything: the generation or chassis code, the part number, another market's name for it, the accessory that fits it instead of the thing itself. \"Not found\" is true only after that, and you say where you looked.\n5. Keep each fact with its value, its source and its kind (maker, standard, accessory maker, measurement, listing), labelled as published, and design to it.\n6. For what is still unknown after about two rounds per fact, shape the design so that fact does not decide whether it works (an adjustable or sprung interface, a foot that suits more than one surface), or state a bounded assumption as an assumption. Ask the person only as the last resort, one short question, and only for what exists nowhere but with them. Never ask for something a search answers: a photo of their car's dashboard, the size of a named product, what a named surface is made of.\nWithout web tools, say so in the result, use what you recall labelled as recalled rather than published, and lean harder on step 6.\n\nWrite the concept down before any geometry, in a few lines: the bought product you are following, its mechanism, the load path, and how it will print. Before choosing a mechanism, establish what every working bought or published version of the thing has, and keep all of it. For example, a car phone holder turns and tilts to face the driver; a mount's base is sized by the moment of what it holds, not just its weight; an adhesive mount uses a full pad of the tape's grade, not a strip, on a surface the tape suits. Start from the complete product a capable designer would describe at once, then make it printable. A design that leaves out a feature they all have says what it lost and why that is acceptable for this person.\n\nGive it the product's form as well as its function. The bought thing's shape is evidence: a handle swells where the palm closes, a hook's arm thickens towards its root, a knob is round and knurled, a clip's jaws wrap what they hold. Do not reduce a product to a flat profile pushed up, or a box with holes, because that is quick to model and prints without thought: that is a bracket, and people can tell. Put curves where hands and objects touch and where load turns a corner. A flat, in-plane layout is right only for the element that needs it (a spring that must bend in the layer plane, a print-in-place hinge or chain), and then say so; the rest of the product keeps its form, split or turned for printing if need be. When the engine renders the model, look at a three-quarter view and ask whether a person would recognise the thing and want it.\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. Judge a connection (tape, screws, a snap) against products that demonstrably work. If a check says a bought product that holds for years would fail, the check is wrong: correct it, then apply it to your design. 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. That choice is for the element that grips, clips or springs, not for the product: it is never a reason to make the whole thing one piece or to drop a joint, adjustment or base the bought versions have. 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\nFit and flexure guidance is longer than this text and is read when it applies: fdm_fit whenever a part meets a real object or another part, fdm_flexures whenever a part must flex, grip, snap, clip or spring. If your host did not attach them, read them with this MCP's design_guidance tool before you choose that fit or size that spring. Where the MCP's code engine is in use, its cad_examples tool lists worked designs to start from.\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
- 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.";
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. Decide it in a few lines and build a rough model of it early: the first geometry is how you check a plan, not the reward for finishing one. 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. 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.\n\nFind out before you design, and before you ask. Research whenever the request names something that exists outside the person's hands (a product, a vehicle and its year, a phone, a case, a tool, an appliance, a standard part, a material, the place the part mounts) or a decision turns on a fact about the world (how hot it gets there, what the surface is made of, what adhesive holds on it, where the buttons, ports, vents or airbags are). Do not research what exists only with the person: which of their own things, how something felt, what they prefer, an object they measured or scanned. This takes a few minutes, not an hour, and it works the same with any model that has web tools:\n1. Write down the few facts that decide this design, usually three to seven: each interface's size, where the part mounts and what surrounds that spot, what the surface is made of, the environment, the load.\n2. Search each fact by the exact name, model and year or generation plus the fact itself (\"dimensions mm\", \"technical drawing\", \"accessory design guidelines\", \"spec sheet\", \"parts diagram\", \"teardown\", \"material\"). Run the searches together when the tools allow. Makers of fitted accessories for the same object (mounts, cases, installation kits, replacement panels) publish where things go and how big the openings are; owners publish photos with a tape measure; parts catalogues show each panel's outline. Look there, not only at the maker of the object.\n3. Open the page and read the number. A search-result snippet is not a source. Prefer, in order: the maker's drawing or specification, a standard, a fitted-accessory maker, a reviewer's or owner's measurement, a retailer's listing. Two independent sources that agree beat one.\n4. When a first search finds nothing, rephrase before concluding anything: the generation or chassis code, the part number, another market's name for it, the accessory that fits it instead of the thing itself. \"Not found\" is true only after that, and you say where you looked.\n5. Keep each fact with its value, its source and its kind (maker, standard, accessory maker, measurement, listing), labelled as published, and design to it.\n6. For what is still unknown after about two rounds per fact, shape the design so that fact does not decide whether it works (an adjustable or sprung interface, a foot that suits more than one surface), or state a bounded assumption as an assumption. Ask the person only as the last resort, one short question, and only for what exists nowhere but with them. Never ask for something a search answers: a photo of their car's dashboard, the size of a named product, what a named surface is made of.\nWithout web tools, say so in the result, use what you recall labelled as recalled rather than published, and lean harder on step 6.\n\nWrite the concept down in a few lines, with the first build rather than as a plan before it: the bought product you are following, its mechanism, the load path, and how it will print. Before choosing a mechanism, establish what every working bought or published version of the thing has, and keep all of it. For example, a car phone holder turns and tilts to face the driver; a mount's base is sized by the moment of what it holds, not just its weight; an adhesive mount uses a full pad of the tape's grade, not a strip, on a surface the tape suits. Start from the complete product a capable designer would describe at once, then make it printable. A design that leaves out a feature they all have says what it lost and why that is acceptable for this person.\n\nGive it the product's form as well as its function. The bought thing's shape is evidence: a handle swells where the palm closes, a hook's arm thickens towards its root, a knob is round and knurled, a clip's jaws wrap what they hold. Do not reduce a product to a flat profile pushed up, or a box with holes, because that is quick to model and prints without thought: that is a bracket, and people can tell. Put curves where hands and objects touch and where load turns a corner. A flat, in-plane layout is right only for the element that needs it (a spring that must bend in the layer plane, a print-in-place hinge or chain), and then say so; the rest of the product keeps its form, split or turned for printing if need be. When the engine renders the model, look at a three-quarter view and ask whether a person would recognise the thing and want it.\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. Judge a connection (tape, screws, a snap) against products that demonstrably work. If a check says a bought product that holds for years would fail, the check is wrong: correct it, then apply it to your design. 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. That choice is for the element that grips, clips or springs, not for the product: it is never a reason to make the whole thing one piece or to drop a joint, adjustment or base the bought versions have. 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. A cosmetic slicer warning (floating regions, small islands) gets one targeted fix and one re-slice, then stops: report what remains, or slice with supports on. 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\nFit and flexure guidance is longer than this text and is read when it applies: fdm_fit whenever a part meets a real object or another part, fdm_flexures whenever a part must flex, grip, snap, clip or spring. If your host did not attach them, read them with this MCP's design_guidance tool before you choose that fit or size that spring. Where the MCP's code engine is in use, its cad_examples tool lists worked designs to start from.\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
+ 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\nWhen this MCP's code engine makes the model, its colour parts come from the same cad_run as the model (build() returns project_3mf(), one part per colour), never from re-running the whole script once per colour.\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
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.";
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. A cosmetic warning (floating regions, small islands) gets one targeted fix and one re-slice, then stops: report what remains, or slice with supports on; never loop rebuild and re-slice to chase it. 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
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, as the element that grips or latches, never in place of a joint, adjustment or base the bought versions have. 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.";
18
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.";
19
19
  export declare const FDM_CAPABILITY_URI = "guidance://fdm/capability-guidance";
@@ -1,9 +1,10 @@
1
1
  import { CAD_DESIGN_PROMPT } from "./cad/contracts.js";
2
+ import { SLICE_WARNING_RULE } from "./slicer/floating-regions.js";
2
3
  export 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.
3
4
 
4
5
  Use 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.
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
+ 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. Decide it in a few lines and build a rough model of it early: the first geometry is how you check a plan, not the reward for finishing one. 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
8
 
8
9
  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. 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.
9
10
 
@@ -16,7 +17,7 @@ Find out before you design, and before you ask. Research whenever the request na
16
17
  6. For what is still unknown after about two rounds per fact, shape the design so that fact does not decide whether it works (an adjustable or sprung interface, a foot that suits more than one surface), or state a bounded assumption as an assumption. Ask the person only as the last resort, one short question, and only for what exists nowhere but with them. Never ask for something a search answers: a photo of their car's dashboard, the size of a named product, what a named surface is made of.
17
18
  Without web tools, say so in the result, use what you recall labelled as recalled rather than published, and lean harder on step 6.
18
19
 
19
- Write the concept down before any geometry, in a few lines: the bought product you are following, its mechanism, the load path, and how it will print. Before choosing a mechanism, establish what every working bought or published version of the thing has, and keep all of it. For example, a car phone holder turns and tilts to face the driver; a mount's base is sized by the moment of what it holds, not just its weight; an adhesive mount uses a full pad of the tape's grade, not a strip, on a surface the tape suits. Start from the complete product a capable designer would describe at once, then make it printable. A design that leaves out a feature they all have says what it lost and why that is acceptable for this person.
20
+ Write the concept down in a few lines, with the first build rather than as a plan before it: the bought product you are following, its mechanism, the load path, and how it will print. Before choosing a mechanism, establish what every working bought or published version of the thing has, and keep all of it. For example, a car phone holder turns and tilts to face the driver; a mount's base is sized by the moment of what it holds, not just its weight; an adhesive mount uses a full pad of the tape's grade, not a strip, on a surface the tape suits. Start from the complete product a capable designer would describe at once, then make it printable. A design that leaves out a feature they all have says what it lost and why that is acceptable for this person.
20
21
 
21
22
  Give it the product's form as well as its function. The bought thing's shape is evidence: a handle swells where the palm closes, a hook's arm thickens towards its root, a knob is round and knurled, a clip's jaws wrap what they hold. Do not reduce a product to a flat profile pushed up, or a box with holes, because that is quick to model and prints without thought: that is a bracket, and people can tell. Put curves where hands and objects touch and where load turns a corner. A flat, in-plane layout is right only for the element that needs it (a spring that must bend in the layer plane, a print-in-place hinge or chain), and then say so; the rest of the product keeps its form, split or turned for printing if need be. When the engine renders the model, look at a three-quarter view and ask whether a person would recognise the thing and want it.
22
23
 
@@ -34,7 +35,7 @@ On a shared-nozzle multicolor setup, reason about filament transitions across la
34
35
 
35
36
  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.
36
37
 
37
- 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.
38
+ 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. A cosmetic slicer warning (floating regions, small islands) gets one targeted fix and one re-slice, then stops: report what remains, or slice with supports on. 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.
38
39
 
39
40
  Fit and flexure guidance is longer than this text and is read when it applies: fdm_fit whenever a part meets a real object or another part, fdm_flexures whenever a part must flex, grip, snap, clip or spring. If your host did not attach them, read them with this MCP's design_guidance tool before you choose that fit or size that spring. Where the MCP's code engine is in use, its cad_examples tool lists worked designs to start from.
40
41
 
@@ -45,6 +46,8 @@ Preserve the requested visual pattern. Evaluate its colors in build coordinates
45
46
 
46
47
  For 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.
47
48
 
49
+ When this MCP's code engine makes the model, its colour parts come from the same cad_run as the model (build() returns project_3mf(), one part per colour), never from re-running the whole script once per colour.
50
+
48
51
  Separating 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.
49
52
 
50
53
  Use 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.
@@ -65,7 +68,7 @@ export const FDM_AFTER_SLICE = `Review this slice against the user's brief and t
65
68
 
66
69
  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.
67
70
 
68
- 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.
71
+ 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. A cosmetic warning (floating regions, small islands) gets one targeted fix and one re-slice, then stops: report what remains, or slice with supports on; never loop rebuild and re-slice to chase it. 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.
69
72
 
70
73
  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.`;
71
74
  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.
@@ -377,6 +380,7 @@ export function slicingGuidance(slicerType, capabilities) {
377
380
  `How this printer MCP slices. Its slicer is ${slicer}.`,
378
381
  "- When they could change a decision, read the printer's loaded filaments with get_printer_filaments and its slicing settings with get_slice_settings.",
379
382
  "- To check a consequential choice, slice a checkpoint with slice_stl and read its structured slicer_result (return code, error and each plate's warning), not only the file path. A checkpoint is only a check: the print slices the exported model again.",
383
+ `- Warnings: ${SLICE_WARNING_RULE} For floating regions, slice_stl's result lists where they are (floating_regions: each one's z, depth and box), so aim the one fix there.`,
380
384
  capabilities.orient
381
385
  ? `- Orientation: slice_stl with orient true lets ${slicer}'s own auto-orient choose how an STL sits on the bed. It keeps overhang area low; it does not check cantilevers. To see what it chooses, slice the checkpoint with orient true. When a print is oriented this way, don't promise a particular orientation on the bed: the slicer chooses it.`
382
386
  : `- Orientation: ${slicer} doesn't auto-orient here. An STL prints in the orientation it's exported in.`,
package/dist/index.js CHANGED
@@ -7,6 +7,7 @@ import { withAnnotations } from "./tool-annotations.js";
7
7
  import { withRemote } from "./counterpart/remote.js";
8
8
  import { refusalReport, slicedFileFacts, slicerReport } from "./counterpart/sliced-file.js";
9
9
  import { listModelPlates } from "./counterpart/model-plates.js";
10
+ import { floatingWarningFacts } from "./slicer/floating-regions.js";
10
11
  /** The slicer's verdict beside its result.json (`slicer_report`). */
11
12
  function reportOf(result) {
12
13
  const report = slicerReport(result);
@@ -56,12 +57,13 @@ import { PROPOSE_FILAMENTS_INPUT_PROPERTIES, PROPOSE_FILAMENTS_OUTPUT_SCHEMA, NO
56
57
  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";
57
58
  import { bambuProgress, offlineProgress } from "./counterpart/progress.js";
58
59
  import { makeCounterpart3mf } from "./counterpart/make-3mf.js";
60
+ import { partMeshes, PART_MESHES_OUTPUT_SCHEMA } from "./counterpart/part-meshes.js";
59
61
  import { MAKE_3MF_OUTPUT_SCHEMA, PRINT_PROGRESS_OUTPUT_SCHEMA, PRINTER_INFO_OUTPUT_SCHEMA } from "./counterpart/schemas.js";
60
62
  import { SELF_CHECK_OUTPUT_SCHEMA, selfCheck } from "./counterpart/self-check.js";
61
63
  import { DIAGNOSTICS_INPUT_PROPERTIES, DIAGNOSTICS_OUTPUT_SCHEMA, appVersion, buildDiagnostics, captureServerLog, diagnosticsBudget, jsonText, recordToolError, rememberSecretArguments, serverLogText, settingsSnapshot, toolErrorsText } from "./counterpart/diagnostics.js";
62
64
  import { parseProcessOverrides } from "./slicer/process-overrides.js";
63
65
  import { PRINT_QUALITY_PROPERTIES, withPrintQuality } from "./slicer/print-quality.js";
64
- import { PrinterRefusal, withPrintDispatch, markPrintCommandSent, printOutcome } from "./refusal.js";
66
+ import { FilamentSlotsError, PrinterRefusal, withPrintDispatch, markPrintCommandSent, printOutcome } from "./refusal.js";
65
67
  import { uploadProgressReporter } from "./upload-progress.js";
66
68
  import { machinePauseGcode, parsePauseLayers, pausedLayers, readPlateGcode } from "./slicer/layer-pauses.js";
67
69
  dotenv.config();
@@ -131,7 +133,7 @@ const SERVER_INFO = {
131
133
  /** Tools that declare an outputSchema: they always return structuredContent, and errors carry none. */
132
134
  const OUTPUT_SCHEMA_TOOLS = new Set([
133
135
  "cad_status", "cad_setup", "cad_run", "cad_check_fit", "cad_examples",
134
- "counterpart_printer_info", "counterpart_self_check", "counterpart_diagnostics", "counterpart_print_progress", "counterpart_make_3mf",
136
+ "counterpart_printer_info", "counterpart_self_check", "counterpart_diagnostics", "counterpart_print_progress", "counterpart_make_3mf", "counterpart_part_meshes",
135
137
  "counterpart_discover_printers", "counterpart_setup_fields", "counterpart_propose_filaments",
136
138
  "fusion_mcp_status", "fusion_mcp_new_design", "fusion_mcp_export",
137
139
  "camera_stream_start", "camera_frame", "camera_stream_stop",
@@ -2299,7 +2301,7 @@ class BambuPrinterMCPServer {
2299
2301
  },
2300
2302
  {
2301
2303
  name: "slice_stl",
2302
- description: "Slice an STL or 3MF file using a slicer to generate printable G-code or sliced 3MF. IMPORTANT: bambu_model must be specified to ensure the slicer generates safe G-code for the correct printer. The text result is the sliced file's path. When Bambu Studio or OrcaSlicer writes a result.json, structuredContent.slicer_result carries it verbatim, success or error: error_string, return_code and each sliced_plates[].warning_message, such as a floating cantilever. structuredContent.slicer_report says whether it failed; for a failure, its message is a plain sentence for a person and slicer_message keeps the slicer's words, which a failed slice's text gives after that sentence. A 3MF that carries its own process settings (a designer's Bambu Studio or Orca project) slices with them unless slicer_profile, template_name or template_3mf_path is given; the machine still comes from bambu_model. quality and strength adjust that process, and strength never lowers its walls or infill.",
2304
+ description: "Slice an STL or 3MF file using a slicer to generate printable G-code or sliced 3MF. IMPORTANT: bambu_model must be specified to ensure the slicer generates safe G-code for the correct printer. The text result is the sliced file's path. When Bambu Studio or OrcaSlicer writes a result.json, structuredContent.slicer_result carries it verbatim, success or error: error_string, return_code and each sliced_plates[].warning_message, such as a floating cantilever. structuredContent.slicer_report says whether it failed; for a failure, its message is a plain sentence for a person and slicer_message keeps the slicer's words, which a failed slice's text gives after that sentence. When a slice that worked warns of floating regions, next carries the stop rule (one targeted fix and one re-slice, then report it or slice with supports on) and, for an STL the slicer did not turn, structuredContent.floating_regions lists where they are: x and y in the STL's own millimetres, z above its lowest point, and depth_mm, how far each hangs below where it joins the rest. A 3MF that carries its own process settings (a designer's Bambu Studio or Orca project) slices with them unless slicer_profile, template_name or template_3mf_path is given; the machine still comes from bambu_model. quality and strength adjust that process, and strength never lowers its walls or infill.",
2303
2305
  inputSchema: {
2304
2306
  type: "object",
2305
2307
  properties: {
@@ -3165,7 +3167,8 @@ class BambuPrinterMCPServer {
3165
3167
  properties: {
3166
3168
  stl_path: { type: "string", description: "Path to the part's STL file." },
3167
3169
  name: { type: "string", description: "The part's name, shown in the slicer." },
3168
- filament: { type: "integer", minimum: 1, maximum: 64, description: "1-based project filament for this part; defaults to the part's position (1, 2, ...)." }
3170
+ filament: { type: "integer", minimum: 1, maximum: 64, description: "1-based project filament for this part; defaults to the part's position (1, 2, ...)." },
3171
+ color: { type: "string", pattern: "^#[0-9A-Fa-f]{6}$", description: "The part's colour as #RRGGBB. Give every part one, or none: the 3MF then declares each filament's colour (project_settings.config filament_colour), as Bambu Studio does, and parts on one filament share it." }
3169
3172
  },
3170
3173
  required: ["stl_path", "name"],
3171
3174
  additionalProperties: false
@@ -3178,6 +3181,20 @@ class BambuPrinterMCPServer {
3178
3181
  },
3179
3182
  outputSchema: MAKE_3MF_OUTPUT_SCHEMA
3180
3183
  },
3184
+ {
3185
+ name: "counterpart_part_meshes",
3186
+ description: "Counterpart contract (counterpart/1): one STL per printable part of any 3MF (a pass's, counterpart_make_3mf's, cad_run's project_3mf, or a designer's Bambu Studio, OrcaSlicer or plain 3MF), so a client draws each part in its colour or shows the design in AR. Writes into a new folder it creates inside out_dir and never overwrites. Returns units (mm), folder and parts: [{id, name, plate?, color?, filament?, painted?, stl_path, triangles, size_mm}], one per part per printed copy. Every STL is in the 3MF's build frame in millimetres, component and build transforms applied, so the parts line up when drawn together; plate is the plate number from 1 (list_3mf_plates index + 1), absent for a 3MF without plates; color is #RRGGBB from the 3MF's own filament colours, absent when it declares none; painted means slicer painting recolours some facets. A part beyond the read limits is listed in skipped with why.",
3187
+ inputSchema: {
3188
+ type: "object",
3189
+ properties: {
3190
+ three_mf_path: { type: "string", description: "Path to the 3MF." },
3191
+ out_dir: { type: "string", description: "An existing folder; each call writes into a new subfolder of it." }
3192
+ },
3193
+ required: ["three_mf_path", "out_dir"],
3194
+ additionalProperties: false
3195
+ },
3196
+ outputSchema: PART_MESHES_OUTPUT_SCHEMA
3197
+ },
3181
3198
  {
3182
3199
  name: "blender_mcp_setup",
3183
3200
  description: "Check or update the MCP for Blender add-on that the configured Blender bridge (BLENDER_MCP_COMMAND uvx, BLENDER_MCP_ARGS naming mcp-for-blender or blender-mcp) needs. Without update: which add-on file Blender loads, its protocol and the protocol the package expects, whether Blender is listening and the running add-on's own handshake. Changes nothing. With update: true, stages the add-on with the package's own installer (mcp-for-blender install-addon) at the inspected version, checks it, keeps the old file as a backup next to it and renames the new one into place. Never starts, stops or edits Blender; a running Blender uses the new add-on once it is re-enabled or restarted. A custom bridge returns supported false.",
@@ -4098,7 +4115,13 @@ class BambuPrinterMCPServer {
4098
4115
  await progressNotifications;
4099
4116
  // The text stays the sliced file's path; slicer_result is the slicer's own result.json, verbatim, and
4100
4117
  // slicer_report its verdict and words, so clients don't read the slicer's format.
4101
- return { content: [{ type: "text", text: sliced.path }], structuredContent: withSlicerReport(sliced) };
4118
+ // A warning about floating regions comes with where they are and the rule that bounds chasing it (#859).
4119
+ const reported = withSlicerReport(sliced);
4120
+ // Turned or scaled by the slicer: the STL's own coordinates would no longer match the slice.
4121
+ const turned = Boolean(args?.orient) || [args?.rotate, args?.rotate_x, args?.rotate_y].some(r => r !== undefined && Number(r) !== 0)
4122
+ || (args?.scale !== undefined && Number(args.scale) !== 1);
4123
+ const located = await floatingWarningFacts(reported.slicer_report, String(args.stl_path), turned);
4124
+ return { content: [{ type: "text", text: sliced.path }], structuredContent: { ...reported, ...located } };
4102
4125
  }
4103
4126
  case "print_3mf": {
4104
4127
  if (!args?.three_mf_path) {
@@ -4451,6 +4474,9 @@ class BambuPrinterMCPServer {
4451
4474
  case "counterpart_make_3mf":
4452
4475
  result = await makeCounterpart3mf(args ?? {});
4453
4476
  break;
4477
+ case "counterpart_part_meshes":
4478
+ result = await partMeshes(args ?? {});
4479
+ break;
4454
4480
  case "design_guidance":
4455
4481
  result = designGuidance(args ?? {});
4456
4482
  break;
@@ -4533,7 +4559,7 @@ class BambuPrinterMCPServer {
4533
4559
  }
4534
4560
  const message = error instanceof Error ? error.message : String(error);
4535
4561
  // Refusals and printer rejections repeat unchanged; say what to fix instead of "try again".
4536
- const refused = /nothing was (?:sent|uploaded)|no command was sent|does not match the job|is ambiguous|is missing or ambiguous|rejected the print command|are refused|is refused|refused because|refused until|refused before/i.test(message);
4562
+ const refused = error instanceof FilamentSlotsError || /nothing was (?:sent|uploaded)|no command was sent|does not match the job|is ambiguous|is missing or ambiguous|rejected the print command|are refused|is refused|refused because|refused until|refused before/i.test(message);
4537
4563
  const structured = {
4538
4564
  status: "error",
4539
4565
  retryable: false,
@@ -4550,6 +4576,11 @@ class BambuPrinterMCPServer {
4550
4576
  ...(error.slicerResult ? { slicer_result: error.slicerResult } : {}),
4551
4577
  slicer_report: { ...refusalReport(error.words), message: error.plain ?? error.words.slice(0, 2000) },
4552
4578
  } : {}),
4579
+ // A design in more colours than filaments to slice it with: the counts and the plain answer a client shows.
4580
+ ...(error instanceof FilamentSlotsError ? {
4581
+ filament_slots: { colours: error.colours, slots: error.slots },
4582
+ slicer_report: { failed: true, message: error.plain, slicer_message: `${error.colours} filament colours were supplied for ${error.slots} filament slots.` },
4583
+ } : {}),
4553
4584
  };
4554
4585
  // MCP clients validate structuredContent against a declared outputSchema even on
4555
4586
  // errors (SDK 1.32 Client.callTool), so those tools return the error as text only.
package/dist/refusal.d.ts CHANGED
@@ -10,8 +10,11 @@
10
10
  * - printer-upload-failed: the print file didn't reach the printer, so no print command was sent.
11
11
  * - slicer-waiting-on-dialog: the slicer stopped working (no CPU, no output) as it does while a window waits for an
12
12
  * answer, and was stopped; nothing was sliced or sent. Not the slicer's verdict on the model: no slicer_report.
13
+ * - needs-more-filaments: the design is in more colours than there are filaments to slice it with (a two-colour 3MF on
14
+ * a printer with no AMS loaded); nothing was sliced. structuredContent.filament_slots says how many of each, and
15
+ * slicer_report.message the plain answer a client shows (scan-to-make #858, the DAD pass).
13
16
  */
14
- export declare const REFUSAL_CODES: readonly ["printer-command-rejected", "printer-not-ready", "printer-upload-failed", "slicer-waiting-on-dialog"];
17
+ export declare const REFUSAL_CODES: readonly ["printer-command-rejected", "printer-not-ready", "printer-upload-failed", "slicer-waiting-on-dialog", "needs-more-filaments"];
15
18
  export type RefusalCode = (typeof REFUSAL_CODES)[number];
16
19
  export declare class PrinterRefusal extends Error {
17
20
  readonly code: RefusalCode;
@@ -27,3 +30,14 @@ export declare function withPrintDispatch<T>(run: () => T): T;
27
30
  /** Call immediately before handing a print command to a transport. An acknowledgement may then be lost. */
28
31
  export declare function markPrintCommandSent(): void;
29
32
  export declare function printOutcome(error: unknown): PrintOutcome;
33
+ /**
34
+ * More filament colours than filament slots to slice with: the plain answer a person is shown, and the counts. The
35
+ * DAD pass sliced its two-colour 3MF for a P1S with no AMS loaded and got only "2 filament colours were supplied for
36
+ * 1 filament slots".
37
+ */
38
+ export declare class FilamentSlotsError extends PrinterRefusal {
39
+ readonly colours: number;
40
+ readonly slots: number;
41
+ readonly plain: string;
42
+ constructor(colours: number, slots: number);
43
+ }
package/dist/refusal.js CHANGED
@@ -11,8 +11,11 @@ import { AsyncLocalStorage } from "node:async_hooks";
11
11
  * - printer-upload-failed: the print file didn't reach the printer, so no print command was sent.
12
12
  * - slicer-waiting-on-dialog: the slicer stopped working (no CPU, no output) as it does while a window waits for an
13
13
  * answer, and was stopped; nothing was sliced or sent. Not the slicer's verdict on the model: no slicer_report.
14
+ * - needs-more-filaments: the design is in more colours than there are filaments to slice it with (a two-colour 3MF on
15
+ * a printer with no AMS loaded); nothing was sliced. structuredContent.filament_slots says how many of each, and
16
+ * slicer_report.message the plain answer a client shows (scan-to-make #858, the DAD pass).
14
17
  */
15
- export const REFUSAL_CODES = ["printer-command-rejected", "printer-not-ready", "printer-upload-failed", "slicer-waiting-on-dialog"];
18
+ export const REFUSAL_CODES = ["printer-command-rejected", "printer-not-ready", "printer-upload-failed", "slicer-waiting-on-dialog", "needs-more-filaments"];
16
19
  export class PrinterRefusal extends Error {
17
20
  constructor(code, message) {
18
21
  super(message);
@@ -42,3 +45,18 @@ export function printOutcome(error) {
42
45
  return "rejected";
43
46
  return printDispatch.getStore()?.attempted === false ? "not-sent" : "unknown";
44
47
  }
48
+ /**
49
+ * More filament colours than filament slots to slice with: the plain answer a person is shown, and the counts. The
50
+ * DAD pass sliced its two-colour 3MF for a P1S with no AMS loaded and got only "2 filament colours were supplied for
51
+ * 1 filament slots".
52
+ */
53
+ export class FilamentSlotsError extends PrinterRefusal {
54
+ constructor(colours, slots) {
55
+ const plain = `This design is in ${colours} colours, but only ${slots} filament${slots === 1 ? " is" : "s are"} available to print it. It needs a printer with an AMS loaded with ${colours} colours, or it can print in one colour.`;
56
+ super("needs-more-filaments", `${plain}\nThe slicer setup said: ${colours} filament colours were supplied for ${slots} filament slots.`);
57
+ this.colours = colours;
58
+ this.slots = slots;
59
+ this.name = "FilamentSlotsError";
60
+ this.plain = plain;
61
+ }
62
+ }
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Where a slice's "floating regions" warning comes from. Bambu Studio and OrcaSlicer say only that an object "has
3
+ * floating regions" (a layer island with nothing under it); a design worker then rebuilt and re-sliced six times
4
+ * chasing specks it could not see (scan-to-make #859, pass B). This finds them in the STL itself: each downward-facing
5
+ * low point of the surface that starts above the plate, with how far its surface hangs below the point where it joins
6
+ * something lower (its depth). The same mesh, the same places, so one fix can be aimed.
7
+ *
8
+ * Coordinates are the STL's own, in millimetres, with z measured from the model's lowest point (where the slicer
9
+ * puts the plate). Shared by bambu-printer-mcp and mcp-3D-printer-server.
10
+ */
11
+ /** One floating region: z where it starts (its lowest point), how far it hangs, and the box of what hangs (STL x, y; z from the model's lowest point). */
12
+ export interface FloatingRegion {
13
+ z: number;
14
+ depth_mm: number;
15
+ box_mm: {
16
+ min: [number, number, number];
17
+ max: [number, number, number];
18
+ };
19
+ }
20
+ export interface FloatingRegions {
21
+ /** The deepest regions first, at most `limit`; z from the model's lowest point. */
22
+ regions: FloatingRegion[];
23
+ /** All the low points found, before the limit. */
24
+ count: number;
25
+ /** The STL's lowest z, which the slicer moves to the plate. */
26
+ model_min_z: number;
27
+ }
28
+ /** Triangles of a binary or ASCII STL, as a flat array of 9 numbers each. */
29
+ export declare function stlTriangles(bytes: Buffer): Float64Array;
30
+ /**
31
+ * The floating low points of a triangle mesh. A sweep from the bottom up joins vertices into connected pieces of the
32
+ * surface below each height; a piece that starts above `plate_mm` is a low point, and its depth is how far up it
33
+ * reaches before it joins a piece that started lower (or the whole of it, if it never does: a body in mid-air).
34
+ * Only low points whose surface faces down count (the floor of a bowl or of a closed void faces up), and only
35
+ * those deeper than `min_depth_mm` (about one layer: shallower bumps fall inside the layer that already has material).
36
+ */
37
+ export declare function floatingRegions(triangles: Float64Array, options?: {
38
+ plate_mm?: number;
39
+ min_depth_mm?: number;
40
+ merge_mm?: number;
41
+ limit?: number;
42
+ }): FloatingRegions;
43
+ /** The slicer said a model has floating regions or small islands: a cosmetic warning this rule bounds. */
44
+ export declare function isFloatingWarning(message: string | undefined): boolean;
45
+ export declare const SLICE_WARNING_RULE = "A cosmetic warning (floating regions, small islands) gets one targeted fix and one re-slice, then stops: if it remains, report it in the result or slice with supports on. Do not rebuild and re-slice to chase it. A region that is a separate body in mid-air, or on a feature that carries load or makes a fit, is not cosmetic: fix that one properly.";
46
+ /**
47
+ * What slice_stl adds to a slice that worked but warned about floating regions: the rule above, and where the
48
+ * regions are when the input is an STL the slicer did not turn (orient, rotate). Never throws: a location it
49
+ * cannot find is left out, with why.
50
+ */
51
+ export declare function floatingWarningFacts(report: {
52
+ failed: boolean;
53
+ message?: string;
54
+ } | undefined, modelPath: string, turned: boolean): Promise<Record<string, unknown>>;