360 Secure SkillHub
360 安全技能中心

Image To Relief Stl

该技能是一个确定性命令行流水线:读取源图像(彩色/多色掩膜或灰度图),通过 palette 或 grayscale 模式把颜色或灰度值映射为高度,用栅格高度场网格化生成水密可打印的 ASCII STL,并可选输出 potrace 矢量预览 SVG。

ajmwagar
ajmwagar
热度 93.92
最近更新 2026-05-11 15:52:12
分类:创作依赖:代码执行 / 读写文件应用场景:图像生成 / 文件转换

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add image-to-relief-stl
Metadata
name
image-to-relief-stl
description
Turn a source image (or multi-color mask image) into a 3D-printable bas-relief STL by mapping colors (or grayscale) to heights. Use when you have an image from an image-gen skill (nano-banana-pro, etc.) and want a real, printable model (STL) via a deterministic pipeline.
metadata
{"openclaw":{"requires":{"bins":["python3","potrace","mkbitmap"]},"install":[{"id":"apt","kind":"apt","package":"potrace","bins":["potrace","mkbitmap"],"label":"Install potrace + mkbitmap (apt)"},{"id":"brew","kind":"brew","formula":"potrace","bins":["potrace","mkbitmap"],"label":"Install potrace + mkbitmap (brew)"}]}}

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 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 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).