Print Failure Analyst
Diagnose failures, recommend slicer fixes, and track a personal failure log.
References
- -
references/failure-types.md — 18 failure types with keywords, causes, visual symptoms - INLINECODE1 — Specific values for PrusaSlicer, Cura, OrcaSlicer per failure type
Read these when formulating diagnoses or recommending fixes. Do not recite them wholesale — extract relevant sections.
Scripts
All scripts use Python stdlib only. Log stored at assets/failure-log.json.
diagnose.py — Identify failure mode from symptoms
CODEBLOCK0
Outputs: ranked failure types with confidence, causes, and slicer-specific fixes.
Use --json when you need structured output to reason over.
log_failure.py — Record a print failure
CODEBLOCK1
Valid --failure-type values: stringing, warping, layer_adhesion, under_extrusion, over_extrusion, elephant_foot, layer_shifting, bridging, overhang, clog, pillowing, ringing, z_banding, seam, supports, first_layer, wet_filament, spaghetti, INLINECODE23
history.py — View failure history and patterns
CODEBLOCK2
report.py — Generate markdown report
CODEBLOCK3
Workflow
User describes a failure
- 1. Run
diagnose.py --symptoms or --description with the user's input - Read
references/failure-types.md for the top match to get full context - Read
references/slicer-fixes.md for that failure type to get specific values - Present: most likely failure type, top 2–3 causes, and slicer fixes (ask which slicer if unknown)
- Offer to log the failure with INLINECODE28
User provides an image
- 1. Analyze the image to identify visual symptoms (stringing, warping, layer gaps, etc.)
- Map observed symptoms to failure type keywords from INLINECODE29
- Run
diagnose.py --symptoms "<observed symptoms>" for structured output - Present diagnosis with causes and fixes
User asks to log a failure
- - Collect: printer, material, failure type, description. Ask for missing required fields.
- Optional: slicer settings used, what fixed it, notes
- Run
log_failure.py with collected info
User asks for history or patterns
- - Run
history.py with appropriate filters - Highlight any patterns flagged (recurring type+material combos, worst printer/material)
User asks for a report
- - Run
report.py, optionally with --days if user wants a time-bounded view - Present the markdown output or save it and tell user where it is
打印故障分析师
诊断故障,推荐切片修复方案,并跟踪个人故障日志。
参考文件
- - references/failure-types.md — 18种故障类型,包含关键词、原因、视觉症状
- references/slicer-fixes.md — 针对每种故障类型,PrusaSlicer、Cura、OrcaSlicer的具体参数值
在制定诊断或推荐修复方案时阅读这些文件。不要整段照搬——提取相关部分即可。
脚本
所有脚本仅使用Python标准库。日志存储在assets/failure-log.json。
diagnose.py — 从症状识别故障模式
bash
python3 scripts/diagnose.py --symptoms 拉丝,翘曲
python3 scripts/diagnose.py --description 零件间有细丝,边角翘起
python3 scripts/diagnose.py --symptoms 拉丝 --description 层切换处更严重 --json
输出:按置信度排序的故障类型、原因以及针对特定切片软件的修复方案。
当需要结构化输出进行推理时,使用--json参数。
log_failure.py — 记录打印故障
bash
python3 scripts/log_failure.py \
--printer Prusa MK4 \
--material PETG \
--failure-type 拉丝 \
--description 塔柱之间严重拉丝 \
--slicer-settings {temperature: 235, retractiondistancemm: 1.0} \
--fixed-by 温度降至230°C,启用擦拭 \
--notes 耗材可能受潮
有效的--failure-type参数值:拉丝、翘曲、层间粘附、挤出不足、挤出过度、大象脚、层偏移、桥接、悬垂、堵头、枕形效应、振纹、Z轴纹路、接缝、支撑、首层、受潮耗材、面条状、其他
history.py — 查看故障历史与模式
bash
python3 scripts/history.py # 所有故障
python3 scripts/history.py --last 10 # 最近10条
python3 scripts/history.py --material PETG # 按耗材筛选
python3 scripts/history.py --printer Prusa MK4 # 按打印机筛选
python3 scripts/history.py --failure-type 拉丝
python3 scripts/history.py --patterns # 仅模式分析
report.py — 生成Markdown报告
bash
python3 scripts/report.py # 输出到标准输出
python3 scripts/report.py --output r.md # 保存到文件
python3 scripts/report.py --days 30 # 仅最近30天
工作流程
用户描述故障
- 1. 使用用户输入运行diagnose.py --symptoms或--description
- 阅读references/failure-types.md中匹配度最高的故障类型,获取完整上下文
- 阅读references/slicer-fixes.md中该故障类型对应的具体参数值
- 呈现:最可能的故障类型、前2-3个原因、切片修复方案(如未知切片软件则询问)
- 提供使用log_failure.py记录故障的选项
用户提供图片
- 1. 分析图片以识别视觉症状(拉丝、翘曲、层间间隙等)
- 将观察到的症状映射到references/failure-types.md中的故障类型关键词
- 运行diagnose.py --symptoms <观察到的症状>获取结构化输出
- 呈现包含原因和修复方案的诊断结果
用户要求记录故障
- - 收集:打印机、耗材、故障类型、描述。询问缺失的必填字段。
- 可选:使用的切片设置、修复方法、备注
- 使用收集的信息运行log_failure.py
用户询问历史或模式
- - 使用适当的筛选条件运行history.py
- 突出显示任何标记的模式(重复出现的类型+耗材组合、最差的打印机/耗材)
用户要求生成报告
- - 运行report.py,如果用户需要限定时间范围的视图,可加上--days参数
- 呈现Markdown输出,或保存文件并告知用户文件位置