image-to-relief-stl

TotalClaw 作者 totalclaw

通过将颜色(或灰度)映射到高度,将源图像(或多色蒙版图像)转换为可 3D 打印的浅浮雕 STL。当您拥有来自图像生成技能(nano-banana-pro 等)的图像并希望通过确定性管道获得真实的可打印模型 (STL) 时使用。

安装 / 下载方式

TotalClaw CLI推荐
totalclaw skills install shop:totalclaw:totalclaw~ajmwagar-image-to-relief-stl
cURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~ajmwagar-image-to-relief-stl/file -o ajmwagar-image-to-relief-stl.md
## 概述(中文)

通过将颜色(或灰度)映射到高度,将源图像(或多色蒙版图像)转换为可 3D 打印的浅浮雕 STL。当您拥有来自图像生成技能(nano-banana-pro 等)的图像并希望通过确定性管道获得真实的可打印模型 (STL) 时使用。

## 原文

# image-to-relief-stl

Generate a **watertight, printable STL** from an input image by mapping colors (or grayscale) to heights.

This is an orchestrator-friendly workflow:
- Use **nano-banana-pro** (or any image model) to generate a **flat-color** image.
- Run this skill to convert it into a **bas-relief** model.

## Practical constraints (to make it work well)

Ask the image model for:
- **exactly N solid colors** (no gradients)
- **no shadows / no antialiasing**
- bold shapes with clear edges

That makes segmentation reliable.

## Quick start (given an image)

```bash
bash scripts/image_to_relief.sh input.png --out out.stl \
  --mode palette \
  --palette '#000000=3.0,#ffffff=0.0' \
  --base 1.5 \
  --pixel 0.4
```

### Grayscale mode

```bash
bash scripts/image_to_relief.sh input.png --out out.stl \
  --mode grayscale \
  --min-height 0.0 \
  --max-height 3.0 \
  --base 1.5 \
  --pixel 0.4
```

## Outputs

- `out.stl` (ASCII STL)
- optional `out-preview.svg` (vector preview via potrace; best-effort)

## Notes

- This v0 uses a **raster heightfield** meshing approach (robust, no heavy CAD deps).
- The `--pixel` parameter controls resolution (smaller = higher detail, bigger STL).