gcode
🤖 AI Summary
This skill generates printer-agnostic `.gcode` from mesh files (`.stl`, `.obj`, `.3mf`, `.ply`, `.glb`, `.gltf`) using a local CLI tool, requiring an explicit printer profile JSON and never uploading or starting print jobs.
How to Install
Claude Code:
git clone --depth 1 https://github.com/earthtojake/text-to-cad.git && cp text-to-cad/skills/gcode ~/.claude/skills/gcode -r# G-code
Provenance: maintained in [earthtojake/text-to-cad](https://github.com/earthtojake/text-to-cad).
Use the installed local skill files as the runtime source of truth; the
repository link is only for provenance and release review.
Use this skill for plain `.gcode` generation from mesh files. It is printer-agnostic and never uploads, starts, or packages print jobs.
## Workflow
1. Confirm the input is a supported mesh: `.stl`, `.obj`, unsliced `.3mf`, `.ply`, `.glb`, or `.gltf`.
2. Require an explicit printer/profile wrapper JSON. Do not invent real-printer profiles.
3. Discover slicer backends when the backend is unknown:
```bash
python scripts/gcode_tool.py discover
```
4. Inspect the input:
```bash
python scripts/gcode_tool.py inspect --input path/to/model.stl --json
```
5. Dry-run the slicer command before executing:
```bash
python scripts/gcode_tool.py slice \
--input path/to/model.stl \
--output /tmp/model.gcode \
--profile path/to/profile.json \
--backend auto \
--dry-run
```
6. Execute only after the dry-run command and profile are appropriate:
```bash
python scripts/gcode_tool.py slice \
--input path/to/model.stl \
--output /tmp/model.gcode \
--profile path/to/profile.json \
--backend auto \
--execute
```
7. Validate the generated G-code:
```bash
python scripts/gcode_tool.py validate \
--gcode /tmp/model.gcode \
--profile path/to/profile.json \
--json
```
## CAD Viewer Handoff
After completing G-code work that creates or modifies a plain `.gcode`, you must ALWAYS hand the explicit file path to `$cad-viewer` when that skill is installed. `$cad-viewer` must start CAD Viewer if it is not already running and return link(s) to the relevant created or updated file(s); the preview is diagnostic only and does not replace this skill's static validation. If `$cad-viewer` is unavailable or startup fails, report that instead of silently omitting the handoff.
## Profile Contract
Every slice requires a wrapper profile JSON with an absolute native slicer profile path:
```json
{
"backend": "orcaslicer",
"native_config": "/absolute/path/to/native-slicer-profile",
"machine": {
"name": "Example Printer",
"bed_size_mm": [180, 180],
"z_height_mm": 180,
"motion_bounds_mm": {
"x": [0, 180],
"y": [0, 180],
"z": [0, 180]
}
},
"filament": {
"type": "PLA",
"nozzle_temp_c": 220,
"bed_temp_c": 65
}
}
```
The wrapper supplies validation bounds and backend selection. `machine.motion_bounds_mm` is optional; omit it for the default `0..bed_size` and `0..z_height` bounds, or set it from a native printer profile when start/end G-code intentionally uses safe wipe/purge positions outside the printable area. The native slicer profile remains the source of detailed process, printer, and filament behavior.
For OrcaSlicer, use `native_settings` and `native_filaments` when the real profile is split across machine, process, and filament JSON files. Keep `native_config`
Details
| Category | Coding → generation |
| Source | earthtojake/text-to-cad |
| SKILL.md | View on GitHub → |
| Repo Stars | ★ 6.8K |
| Est. per Skill | 622 (shared across 11 skills from this repo) |
| Difficulty | Intermediate |
| Risk Level | N/A |
Related Skills
jq
jq — JSON Querying and Transformation Overview jq is the standard CLI tool for querying and reshapin
pubmed-database
PubMed Database Overview PubMed is the U.S. National Library of Medicine's comprehensive database pr
angular-ui-patterns
Angular UI Patterns Core Principles Never show stale UI - Loading states only when actually loading
animejs-animation
Anime.js Animation Skill Anime.js is a lightweight but extremely powerful JavaScript animation engin
Works Well With
Skills from the same repository — often designed to work together
bambu-labs
Bambu Labs Provenance: maintained in earthtojake/text-to-cad(https://github.com/earthtojake/text-to-
cad-viewer
CAD Viewer Provenance: maintained in earthtojake/text-to-cad(https://github.com/earthtojake/text-to-
cad
CAD generation, inspection, and validation Provenance: maintained in earthtojake/text-to-cad(https:/