← 返回
未分类 中文

DXF to Image

Convert DXF to PNG, JPG, or SVG for sharing (e.g. Telegram) or further editing.
将 DXF 转换为 PNG、JPG 或 SVG,便于分享(如 Telegram)或进一步编辑。
qrost qrost 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 308
下载
💾 0
安装
1
版本
#latest

概述

DXF to Image / SVG

Convert DXF (CAD) files to PNG, JPG, or SVG. Useful when you have DXF from map-grabber, Rhino, or other CAD tools and need a raster image to send in chat or a vector SVG for editing.

Dependencies

  • ezdxf (DXF read + drawing add-on)
  • matplotlib (for PNG/JPG only)
  • Pillow (for JPG only)

Setup: OpenClaw does not install Python packages automatically. After installing this skill, run once: pip install -r requirements.txt (from the skill folder). If a script fails with ModuleNotFoundError, install the missing package.

Usage

Convert DXF to PNG, JPG, or SVG

Parameters:

  • input: Path to the DXF file.
  • -o, --output: Output file path (default: same name as input with .png, .jpg, or .svg).
  • -f, --format: png (default), jpg, or svg.
  • --width, --height: Output size in pixels for PNG/JPG only (keeps aspect ratio if only one is set).
  • --dpi: DPI for PNG/JPG (default 150).
  • --margin: Margin in mm for SVG (default 2).
# DXF to PNG (default)
python3 scripts/convert_dxf.py drawing.dxf -o drawing.png

# DXF to SVG (vector, no matplotlib for this path)
python3 scripts/convert_dxf.py site.dxf -f svg -o site.svg

# DXF to JPG
python3 scripts/convert_dxf.py site.dxf -f jpg -o site.jpg

# Fixed width 800px (height auto)
python3 scripts/convert_dxf.py map.dxf -o map.png --width 800

Sending images to Telegram

Used from the OpenClaw Telegram conversation. Run the script with -o .png or -o .jpg, then send that file to the user via the OpenClaw message/media tool.

OpenClaw allowed paths: The message tool only sends files from allowed dirs (~/.openclaw/media/, ~/.openclaw/agents/, or /tmp). Use e.g. -o ~/.openclaw/media/out.png or -o /tmp/out.png; do not use the skill install directory or sending will fail.

Agent behavior: When the user asks to convert a DXF to PNG, JPG, or SVG (or "send DXF as image"), run the script directly with exec: use convert_dxf.py -o with -f png/jpg/svg and output path under an allowed dir; then send the generated file. Do not ask for confirmation; execute and return the file.

Examples

User: "Convert this DXF to PNG so I can send it in Telegram."

Action: Run convert_dxf.py -o /tmp/out.png, then send the PNG to the user.

User: "Export the DXF as SVG."

Action: Run convert_dxf.py -f svg -o /tmp/out.svg, then send or return the SVG path.

User: "Turn the site DXF into a JPG, 1200px wide."

Action: Run with -f jpg -o /tmp/site.jpg --width 1200, then send the JPG.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-12 05:52 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

Map Grabber

qrost
获取地址的 OpenStreetMap 矢量(街道、建筑)并导出为 SVG、GeoPackage 或 DXF,供 CAD/Rhino 使用。
★ 1 📥 1,446
design-media

Openai Whisper

steipete
使用 Whisper CLI 进行本地语音转文字(无需 API 密钥)
★ 329 📥 92,789
design-media

UI/UX Pro Max

xobi667
提供 UI/UX 设计智能与实现指导,帮助打造精美界面。适用于 UI 设计、UX 流程、信息架构、视觉风格、设计系统/标记、组件规格、文案/微文案、无障碍及前端 UI(HTML/CSS/JS、React、Next.js、Vue、Svelte
★ 216 📥 46,474