pdf-to-cad

将 PDF(工程图纸/原理图/蓝图)转换为分层矢量 SVG 与 DXF(兼容 AutoCAD/中望/浩辰)以供下游 CAD 或 AI 绘图工作流使用。保留所有矢量几何、文本和光栅图像,生成清晰图层且无失真。可通过自然语言提示调用,保留用户消息中的输入 PDF 路径示例(例如 @-引用或粘贴的路径)。

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "pdf-to-cad":https://skillpi.com/zh/skills/deepskill-dc5251bc0f132e8c8d4f7023d23dfbd2910e2797f5cd266cead238fb887cbb73。安装前核对上游来源和版本:https://skillhub.cn/skills/user_e23943a8/pdf-to-cad。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

skillhub.cn

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

将 PDF(工程图纸/原理图/蓝图)转换为分层矢量 SVG 与 DXF(兼容 AutoCAD/中望/浩辰)以供下游 CAD 或 AI 绘图工作流使用。保留所有矢量几何、文本和光栅图像,生成清晰图层且无失真。可通过自然语言提示调用,保留用户消息中的输入 PDF 路径示例(例如 @-引用或粘贴的路径)。

0 下载

介绍来源: third_party · user_e23943a8 · 1.0.0 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
适合谁
User says "把这份 PDF 图纸转成 CAD/DXF/矢量图" or equivalent (zh/en). User wants editable vector geometry from a PDF (not a raster trace). User is prepping a PDF for AI-assisted CAD redraw / parametric editing.
输入和输出
翻译待完成,请参阅来源文档。
软件、账号及付费要求
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: pdf-to-cad
description: |-
  Convert a PDF (engineering drawing / schematic / blueprint) into layered
  vector SVG and DXF (AutoCAD / 中望 / 浩辰 compatible) for downstream CAD or
  AI drawing workflows. Preserves all vector geometry, text, and raster images
  with clear layers and no distortion. Invoke with natural-language prompts such
  as "将此pdf图纸转化为CAD", "把这份pdf转成dxf", "pdf转矢量图", "pdf to cad",
  "pdf to dxf", "convert this pdf drawing to cad". Keep the input PDF path from
  the user's message (e.g. via @-referenced file or pasted path).
agent_created: true

PDF → CAD (SVG + DXF) Converter

Turn a PDF drawing into two deliverables:

  • .svg — layered (Inkscape layers: Geometry / Text / Images), 1:1 real-world mm.
  • .dxf — DXF R2010, mm units, 4 layers (Geometry / Hatch / Text / Images), imports cleanly into AutoCAD, 中望, 浩辰, LibreCAD, and most AI CAD tools.

When to use

  • User says "把这份 PDF 图纸转成 CAD/DXF/矢量图" or equivalent (zh/en).
  • User wants editable vector geometry from a PDF (not a raster trace).
  • User is prepping a PDF for AI-assisted CAD redraw / parametric editing.

Inputs

  • The source PDF path — usually @-referenced in the message or pasted as text. If missing, ask the user for the PDF file.
  • Optional output directory (default: same folder as the PDF).

Prerequisites (one-time per environment)

Managed Python venv with pymupdf + ezdxf. Set this up once:

VENV="C:/Users/muxinshu/.workbuddy/binaries/python/envs/default"
PY="$VENV/Scripts/python.exe"
"$VENV/Scripts/pip.exe" install --quiet pymupdf ezdxf

If the venv doesn't exist yet, create it first:

"C:/Users/muxinshu/.workbuddy/binaries/python/versions/3.13.12/python.exe" \
  -m venv "$VENV"

Steps

  1. Locate the PDF. Read the path from the user message. Resolve to an absolute path.

  2. Run the bundled converter (this skill's convert.py). It does everything: vector SVG export via PyMuPDF, layer reorganization, DXF build via ezdxf, and the critical extents patch.

    VENV="C:/Users/muxinshu/.workbuddy/binaries/python/envs/default"
    "$VENV/Scripts/python.exe" \
      "C:/Users/muxinshu/.workbuddy/skills/pdf-to-cad/convert.py" \
      "ABSOLUTE_PDF_PATH" [--out OUTPUT_DIR]
  3. Validate (quick). Confirm non-zero entity counts printed at the end (polylines / hatches / texts / images). The script's DXF extents patched line must appear — that's what prevents a blank open.

  4. Report. Tell the user the output paths and the key note below.

Outputs

  • base.svg — layered vector, open in Inkscape/Illustrator.
  • base.dxf — CAD-ready; must sit in the same folder as base_images/ (29-ish PNGs referenced by relative path). Move both together.
  • base_images/ — extracted raster images (photos / renders) referenced by the DXF.

CRITICAL gotchas (why a naive ezdxf export fails)

  1. Blank-on-open fix: ezdxf's auditor recomputes $EXTMIN/$EXTMAX on saveas and fails for docs with many HATCH/IMAGE, resetting them to ±1e20. CAD apps frame the initial view from these → blank screen. The script PATCHES the ASCII DXF after save with the real A4-range extents. Never remove that patch.
  2. Chinese font: doc.styles.add("SimSun", font=...) — font= must be a keyword arg, else the style silently drops and text uses a missing font.
  3. Mirrored images: PyMuPDF emits image transforms with negative determinant (vertical flip). add_image(size_in_units, rotation) can't express a mirror, so the script sets u_pixel / v_pixel vectors directly.
  4. Orientation: SVG/PDF are y-DOWN; DXF is y-UP. Flip with (H_PT - y). Page height H_PT is read dynamically from the PDF mediabox (don't hardcode).
  5. Inherited paint: fill/stroke are often set on ancestor "g" groups, not the path. resolve_paint() walks the ancestor chain; SVG default fill is black. Skip (255,255,255) fills (background) to avoid a black sheet.

Notes

  • Vector curves stay exact (Bézier flattened to polylines at 0.25 mm step in DXF).
  • Raster photos are embedded as images, NOT traced — they remain raster by nature.
  • If the user later reports "DXF blank", re-check the patched extents line first.

当前收录版本

1.0.0

核对来源版本 ↗

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值88/100

亮点

  • 解决工程图纸 PDF 转可编辑 CAD 矢量格式的高频刚需
  • 输出完整闭环(SVG+DXF+图像目录),适用于设计、制造、AI 辅助绘图等场景
触发精准85/100

亮点

  • 提供中英文多种自然语言触发词,覆盖合理,边界清晰
结构规范92/100

待提升项

  • 缺少 When to Use 显式章节标题 原报告严重程度:轻微

    文档中有 'When to use' 内容,但未使用标准二级标题 '## When to Use',而是直接写在正文中,影响结构规范性。

    改进建议:将 'When to use' 部分改为标准二级标题 '## When to Use',提升文档结构一致性。

  • 文档略长 原报告严重程度:轻微

    SKILL.md 内容较为详尽,接近 500 行限制,可能影响可读性。

    改进建议:考虑将部分技术细节(如 CRITICAL gotchas)移至单独文档或通过折叠块展示,保持主文档简洁。

亮点

  • 结构完整,包含输入、步骤、输出、关键陷阱等必要章节
  • 步骤清晰,有端到端示例,frontmatter 完整
执行可靠75/100

待提升项

  • 硬编码路径导致环境依赖 原报告严重程度:重大

    Prerequisites 和 Steps 中使用了硬编码的 Python venv 路径(C:/Users/muxinshu/.workbuddy/...),不具备跨平台通用性。

    改进建议:建议将路径改为环境变量或相对路径,或提供配置说明,以增强环境兼容性。

亮点

  • 工具来源明确(pymupdf + ezdxf),参数正确
  • 覆盖了关键异常处理(DXF extents 补丁、中文字体、镜像图像、坐标系翻转)
证据可验 (前四项均值)85/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

翻译待完成,请参阅来源文档。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。