gcode
它能做什么
这个技能使用 OrcaSlicer 把 3D 模型文件切片为打印指令。适合想为 3D 打印机准备模型的人。
适用场景
- ✓当你希望为 3D 打印机切片一个 STL 或 3MF 模型时。
- ✓当你需要一个用于打印的已切片 .gcode.3mf 或纯 .gcode 文件时。
- ✓当你想在 OrcaSlicer 中打开模型,自己进行切片时。
技能链接
https://github.com/earthtojake/text-to-cad/blob/main/skills/gcode/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“能用 OrcaSlicer 为我的 Prusa MK4 切片这个 STL 文件,并给我 G-code 文件吗?”
每周 5 个新技能,1 分钟读完。
工作原理
AI 使用 OrcaSlicer 的预设,优先选择你已经在用来打印的预设,并运行切片程序。它绝不会把文件发送到打印机。对于 Bambu Lab 打印机,结果会通过 Bambu Connect 处理。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
G-code
Slice with OrcaSlicer, headless (below) or by opening the model in the
OrcaSlicer app for the user. The agent never contacts a printer: for a Bambu
Lab printer, the result is sent through Bambu Connect; for any other printer,
give the user the .gcode.
Install OrcaSlicer
- macOS:
brew install --cask orcaslicer. The command line is/Applications/OrcaSlicer.app/Contents/MacOS/OrcaSlicer. - Windows and Linux: install a release from
https://github.com/OrcaSlicer/OrcaSlicer/releases. The command is
orca-slicer; on Linux, run it from the AppImage or Flatpak.
Below, <orca> is that command.
Slice headless
OrcaSlicer's command line (https://www.orcaslicer.com/wiki/cli/cli_mode) needs
complete presets: it doesn't fill in a preset's parent settings, and it slices
only with a process whose compatible printers name the printer.
scripts/orca_presets.py (Python 3, no dependencies) writes them from
OrcaSlicer's presets, searching the user's own first, then OrcaSlicer's
built-in profiles.
Find the user's printer, process and filament presets. Prefer the presets the user prints with; never invent one, since a wrong bed size or temperature can damage the printer.
python scripts/orca_presets.py --list machine --match "MK4S" python scripts/orca_presets.py --list process --match "@MK4S 0.4" python scripts/orca_presets.py --list filament --match "PLA @MK4S"Write the complete presets:
python scripts/orca_presets.py --printer "Prusa MK4S 0.4 nozzle" \ --process "0.20mm SPEED @MK4S 0.4" --filament "Prusa Generic PLA @MK4S" \ --out presetsSlice. Give
--outputdiran absolute path:<orca> model.stl \ --load-settings "presets/process.json;presets/printer.json" \ --load-filaments presets/filament-1.json \ --arrange 1 --slice 0 \ --outputdir /absolute/path/to/out --export-3mf model.gcode.3mfThis writes
plate_1.gcode, the plain G-code, andmodel.gcode.3mf, the sliced 3MF, into that folder. The command line reads.stl,.3mf,.objand.amf; export STEP to STL or 3MF first (for a text-to-cad model,cad export <id> part.3mf, orcad export part.step part.3mf). Override one setting with--<setting>=<value>, using the setting's key with hyphens for underscores, such as--layer-height=0.16.
Open in OrcaSlicer
When the user would rather pick presets and slice themselves, or no preset can
be found, open the model in the app: open -a OrcaSlicer model.stl on macOS,
Start-Process model.stl on Windows when OrcaSlicer opens that file type, or
orca-slicer model.stl on Linux. The app also reads STEP.
Check before printing
<orca> model.stl --infoprints the model's size; it has to fit the bed.Check the slice's settings, which OrcaSlicer writes at the end of the G-code:
grep -E '^; (printer_model|nozzle_diameter|filament_type|nozzle_temperature|hot_plate_temp|bed_temperature) =|printing time' out/plate_1.gcodeConfirm they match the user's printer and material before anyone prints it.
Hand off
- A Bambu Lab printer: Bambu Connect, with the
.gcode.3mf. - Any other printer: the user prints the
.gcodefrom their printer's app, its web interface (PrusaLink, OctoPrint, Mainsail, Fluidd) or an SD card.
常见问题
它会把打印任务发送到我的打印机吗?
不会。对于 Bambu Lab 以外的打印机,你会得到 G-code 文件,由你自己使用。
它支持哪些打印机?
大多数内置 OrcaSlicer 配置文件的 FDM 打印机。
它会编造打印机设置吗?
不会。技能避免臆造设置,因为错误的数值可能损坏打印机。
详情
作者的原始描述
Slice 3D models into printer-ready G-code with OrcaSlicer, the open-source slicer with built-in profiles for most FDM printers (Prusa, Bambu Lab, Creality, Voron and more). Use when the user wants an `.stl`, `.3mf` or `.obj` model sliced for their printer, as a sliced `.gcode.3mf` or plain `.gcode`, headless with OrcaSlicer's command line or by opening the model in OrcaSlicer. Never contacts a printer.
repo: earthtojake/text-to-cad
热度
- GitHub 星标
- 25k
- 排名
- #10072
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …