Image To Cad — Design skill for Claude Code
地图截图转 AutoCAD DXF 的 Claude Code 技能 Claude Code skill: vectorize web-map screenshots (Amap/Baidu style) into AutoCAD DXF.
How to install Image To Cad
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open hwdemtv/image-to-cad and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Image To Cad does
地图截图转 AutoCAD DXF 的 Claude Code 技能 Claude Code skill: vectorize web-map screenshots (Amap/Baidu style) into AutoCAD DXF.
Alternatives in Design
- Figma — Fetch design context, screenshots, and assets from Figma for implementation 14.6k ★
- Site — Crawl a whole site and synthesize ONE canonical design system across all pages — unified tokens, coverage map 3.6k ★
- Extract Skill — Reverse-engineer design systems, tokens, and components from live products or screenshots 2.8k ★
README
image-to-cad — 地图截图转 CAD(DXF)
Claude Code skill:把高德/百度/腾讯等网页地图截图矢量化为 AutoCAD 可直接打开的 DXF。
**输入**:一张网页地图截图(标准高德配色) **输出**:`.dxf`(R2010,按内容分 9 个图层)+ 并排预览图 + 50% 叠加校验图
能做什么
- 建筑外形轮廓:每栋楼一条闭合多段线(屋顶 + 三维侧影合并;相邻粘连的楼用标记分水岭在细颈处自动切开)
- 道路及步道边线:白色路网/步道自动提取为边界线
- 绿地、学校建筑及操场、快速路(黄色)、导航路线(橄榄绿)、红色标注框、定位针:自动识别、独立分层
- 中文标注:GB 大字体样式(
gbenor.shx+gbcbig.shx),简体中文版 AutoCAD 打开不显示问号 - 坐标系:1 单位 = 1 源图像素,Y 轴向上
安装
把本目录复制到 `~/.claude/skills/image-to-cad`(或双击安装 `image-to-cad.skill` 包)。
依赖:Python 3.10+,`pip install opencv-python numpy ezdxf pillow`
使用
在 Claude Code 里直接说:**"把这张地图转成 CAD"** 并附上截图。
命令行手动运行:
# 探测配色
python scripts/map2dxf.py --probe 地图.png
# 生成 DXF + 预览
python scripts/map2dxf.py --src 地图.png
# 加中文标注后重跑(labels.json 格式见 references/lessons.md)
python scripts/map2dxf.py --src 地图.png --labels labels.json
# 剔除误检的假楼(广场/路缘条带)
python scripts/map2dxf.py --src 地图.png --exclude 0,520,150,700
常用参数:`--open-k`(板楼细臂被吃掉时调小)、`--pathcut-k`、`--shadow-hug`、`--core-min`、`--eps`。
原理与调优
管线:颜色分割(纯白=路面 / 灰白=楼顶 / 绿灰=侧影)→ 先切路网再闭运算 → 厚核为种子的分水岭回长重建 → 中文 DXF → 预览自检。
踩坑记录与故障速查表见 [references/lessons.md](references/lessons.md),SKILL.md 为技能触发与工作流说明。
实测
在三张高德截图上定型验证:岳家嘴小区(856×755)、鸿源国际公馆(590×435)、徐东嘉园(1184×870,43 栋楼)。
License
MIT
Related Skills
App Auditor Plugin Claude
Claude plugin for auditing live web apps: capture screenshots, generate demo videos, document components, extr
Image Reconstruction
Reconstruct, remix, and edit image references with an agent skill, visual map, reusable JSON, and prompt compi
Visual Standards
Load visual formatting standards for screenshots, emoji headings, and image specs: $ARGUMENTS
UI Slicing
Slice any UI reference image (Pinterest, Dribbble, screenshots) into pixel-perfect front-end code. Agent skill
Post Skill
Post — a Claude skill for Xiaohongshu / X share-image sets that look native and sell: App Store poster layout,
Internal API Reverse Engineering
Agent skill: map the undocumented internal API behind any web SaaS UI — source-map mining, differential proof,
Related Agents
Cad Drafter
Produces DXF drawings: plans, sections, rebar details and MEP layouts with ezdxf (or the autocad-dxf MCP). Use
Aec Drafter
Use to turn an approved plan spec into country-correct drawings — DXF/DWG sheets with the right units, layers,
Dao
Dessin AutoCAD à partir du modèle 3D - export DWG/DXF 3D (MESH), élévations et plans 2D cotés, présentations i