This is meant for marketing/preview images, not photorealism.
If you need studio lighting / materials, use Blender — but this gets you 80% quickly and reproducibly.
1---2name: render-stl-png3description: render-stl-png4---5# render-stl-png67Render an STL to a PNG from a nice, consistent 3D angle ("Blender-ish" default perspective) with a solid color.89This is a **deterministic software renderer**:10- No OpenGL11- No Blender dependency12- Uses a simple camera + z-buffer + Lambert shading1314## Inputs1516- STL file path (ASCII or binary)17- Output PNG path1819## Parameters2021- `--size <px>`: image width/height (square), default `1024`22- `--bg "#rrggbb"`: background color, default `#0b0f14`23- `--color "#rrggbb"`: mesh base color, default `#4cc9f0`24- `--azim-deg <deg>`: camera azimuth around Z, default `-35`25- `--elev-deg <deg>`: camera elevation, default `25`26- `--fov-deg <deg>`: perspective field of view, default `35`27- `--margin <0..0.4>`: framing margin as fraction of view, default `0.08`28- `--light-dir "x,y,z"`: directional light vector, default `-0.4,-0.3,1.0`2930## Usage3132### One-shot3334```bash35python3 scripts/render_stl_png.py \36 --stl /path/to/model.stl \37 --out /tmp/model.png \38 --color "#ffb703" \39 --bg "#0b0f14" \40 --size 120041```4243### Wrapper (recommended)4445The wrapper creates a cached venv (so `pillow` is available) and runs the renderer.4647```bash48bash scripts/render_stl_png.sh /path/to/model.stl /tmp/model.png --color "#ffb703"49```5051## Notes5253- This is meant for **marketing/preview images**, not photorealism.54- If you need studio lighting / materials, use Blender — but this gets you 80% quickly and reproducibly.
Run npx skillmds@latest add demerzels-lab/render-stl-png in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
render-stl-png It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
Demerzels-lab (@demerzels-lab) published this skill. Their other Agent Skills are listed on their SkillMD profile.