{"id":"4ad0af57-5af2-4fcd-a325-fa28373b0b88","entityType":"agent","slug":"clawhub-yfg305-ssq","name":"图纸解析","canonicalUrl":"https://www.xpersona.co/agent/clawhub-yfg305-ssq","canonicalPath":"/agent/clawhub-yfg305-ssq","generatedAt":"2026-10-10T13:32:29.596Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-10T10:35:39.297Z","emptyReason":null},"description":"建筑图纸解析引擎。支持 DWG/DXF/PDF/图片格式的图纸解析，提取文字、段落、材料表、尺寸标注等结构化数据。用户提及'解析图纸''读图''CAD解析''PDF解析'时触发。 Skill: 图纸解析 Owner: yfg305 Summary: 建筑图纸解析引擎。支持 DWG/DXF/PDF/图片格式的图纸解析，提取文字、段落、材料表、尺寸标注等结构化数据。用户提及'解析图纸''读图''CAD解析''PDF解析'时触发。 Tags: latest:0.1.1 Version history: v0.1.1 | 2026-08-18T23:56:34.460Z | auto - Version 0.1.1 released with no file or documentation changes detected. - No new features, fixes, or updates included in this release. v0.1.0 | 2026-08-18T23:52:58.874Z | auto - Initial release of the drawing-parser e","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.5K downloads reported by the source. Last updated 10/10/2026.","installCommand":"clawhub skill install s17d97d5gyphs43gjx0sx4nvfn8cqntd:ssq","sourceUrl":"https://clawhub.ai/yfg305/ssq","homepage":"https://clawhub.ai/yfg305/skills/ssq","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/yfg305/ssq","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/yfg305/skills/ssq","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":63,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"建筑图纸解析引擎。支持 DWG/DXF/PDF/图片格式的图纸解析，提取文字、段落、材料表、尺寸标注等结构化数据。用户提及'解析图纸''读图''CAD解析''PDF解析'时触发。 Skill: 图纸解析 Owner: yfg305 Summary: 建筑图纸解析引擎。支持 DWG/DXF/PDF/图片格式的图纸解析，提"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-10T10:35:39.297Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T10:35:39.297Z","emptyReason":null},"stars":null,"forks":null,"downloads":1492,"packageName":null,"latestVersion":"0.1.1","tractionLabel":"1.5K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T10:35:39.296Z","emptyReason":null},"lastUpdatedAt":"2026-10-10T10:35:39.297Z","lastCrawledAt":"2026-10-10T10:35:39.296Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-11T10:35:39.296Z","lastVerifiedAt":null,"highlights":[{"version":"0.1.1","createdAt":"2026-08-18T23:56:34.460Z","changelog":"- Version 0.1.1 released with no file or documentation changes detected. - No new features, fixes, or updates included in this release.","fileCount":14,"zipByteSize":16649},{"version":"0.1.0","createdAt":"2026-08-18T23:52:58.874Z","changelog":"- Initial release of the drawing-parser engine. - Supports parsing DWG, DXF, PDF, and image (PNG/JPG) architectural drawings. - Extracts structured data: texts, paragraphs, tables, and dimensions. - Offers four OCR modes with automatic fallback for PDF/image parsing. - Provides both Python API and command-line usage. - Outputs results to structured JSON for downstream use.","fileCount":14,"zipByteSize":16652}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17d97d5gyphs43gjx0sx4nvfn8cqntd:ssq","setupComplexity":"low","setupSteps":["Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-yfg305-ssq/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-yfg305-ssq/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-yfg305-ssq/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-yfg305-ssq/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-yfg305-ssq/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-yfg305-ssq/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-10T13:32:29.596Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-yfg305-ssq/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-yfg305-ssq/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-yfg305-ssq/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-yfg305-ssq/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-10T10:35:39.297Z","emptyReason":null},"readme":"Skill: 图纸解析\n\nOwner: yfg305\n\nSummary: 建筑图纸解析引擎。支持 DWG/DXF/PDF/图片格式的图纸解析，提取文字、段落、材料表、尺寸标注等结构化数据。用户提及'解析图纸''读图''CAD解析''PDF解析'时触发。\n\nTags: latest:0.1.1\n\nVersion history:\n\nv0.1.1 | 2026-08-18T23:56:34.460Z | auto\n\n- Version 0.1.1 released with no file or documentation changes detected.\n- No new features, fixes, or updates included in this release.\n\nv0.1.0 | 2026-08-18T23:52:58.874Z | auto\n\n- Initial release of the drawing-parser engine.\n- Supports parsing DWG, DXF, PDF, and image (PNG/JPG) architectural drawings.\n- Extracts structured data: texts, paragraphs, tables, and dimensions.\n- Offers four OCR modes with automatic fallback for PDF/image parsing.\n- Provides both Python API and command-line usage.\n- Outputs results to structured JSON for downstream use.\n\nArchive index:\n\nArchive v0.1.1: 14 files, 16649 bytes\n\nFiles: .gitignore (541b), examples (0b), examples/basic_usage.py (2790b), LICENSE (1063b), manifest.json (1450b), README.md (4034b), requirements.txt (379b), scripts (0b), scripts/cad_parser.py (5281b), scripts/main.py (4697b), scripts/pdf_parser.py (6622b), skill-card.md (2467b), SKILL.md (3902b), _meta.json (122b)\n\nFile v0.1.1:SKILL.md\n\n---\nname: drawing-parser\ndescription: \"建筑图纸解析引擎。支持 DWG/DXF/PDF/图片格式的图纸解析，提取文字、段落、材料表、尺寸标注等结构化数据。用户提及'解析图纸''读图''CAD解析''PDF解析'时触发。\"\nmetadata:\n  version: \"1.0.0\"\n  author: \"yfg305\"\n  license: \"MIT\"\n  tags: [\"建筑\", \"图纸解析\", \"CAD\", \"PDF\", \"OCR\"]\n---\n\n# Drawing Parser — 建筑图纸解析引擎\n\n自动识别图纸格式（DWG/DXF/PDF/图片），调度对应解析管线，输出结构化数据供方案编制和审核使用。\n\n## 支持的格式\n\n| 格式 | 子引擎 | 技术方案 | 精度 |\n|:----|:------|:---------|:----:|\n| `.dwg` | CAD管线 | ODA转换→DXF→ezdxf | 高 |\n| `.dxf` | CAD管线 | ezdxf 直接读取 | 高 |\n| `.pdf` | PDF管线 | PyMuPDF + 多模式OCR | 高 |\n| `.png/.jpg` | PDF管线 | 同上，三种OCR可选 | 高 |\n\n## OCR 模式对比（PDF/图片）\n\n| 模式 | 技术栈 | 精度 | 速度 | 依赖 |\n|:----|:--------|:---:|:----|:----|\n| `v6`（推荐） | PP-OCRv6 rapidocr | 最高 | 较快 | pip install rapidocr |\n| `dl` | deepdoc ONNX | 高 | 较慢 | onnxruntime, opencv |\n| `rapid` | RapidOCR-json.exe | 高 | 较快 | 仅需exe |\n| `fast` | PaddleOCR-json.exe | 够用 | 快 | 仅需exe |\n\n## 快速开始\n\n### Python API\n\n```python\nimport sys\nsys.path.insert(0, 'path/to/scripts')\n\n# CAD 图纸解析\nfrom cad_parser import parse_cad_drawing\nresult = parse_cad_drawing('图纸.dwg', output_dir='./output')\n\n# PDF 图纸解析\nfrom pdf_parser import parse_pdf_drawing\nresult = parse_pdf_drawing('图纸.pdf', ocr_mode='v6', output_dir='./output')\n```\n\n### 命令行\n\n```bash\n# CAD 解析\npython scripts/cad_parser.py 图纸.dwg ./output --mode v4\n\n# PDF 解析（自动降级 v6→dl→rapid→fast）\npython scripts/pdf_parser.py 图纸.pdf ./output --mode v6\n```\n\n## 输出结构\n\n所有解析结果写入 `{项目}/_drawing_parser/project_data.json`：\n\n```json\n{\n  \"project_name\": \"示例项目\",\n  \"source_file\": \"图纸.dwg\",\n  \"parse_time\": \"2026-08-18T18:00:00Z\",\n  \"texts\": [\n    {\n      \"content\": \"钢筋混凝土\",\n      \"bbox\": [x1, y1, x2, y2],\n      \"layer\": \"TEXT\",\n      \"confidence\": 0.95\n    }\n  ],\n  \"paragraphs\": [\n    {\n      \"type\": \"title\",\n      \"content\": \"结构设计说明\",\n      \"position\": 1\n    }\n  ],\n  \"tables\": [\n    {\n      \"header\": [\"材料\", \"规格\", \"数量\"],\n      \"rows\": [[\"钢筋\", \"HRB400\", \"120\"]]\n    }\n  ],\n  \"dimensions\": [\n    {\n      \"value\": 3600,\n      \"unit\": \"mm\",\n      \"position\": [x, y]\n    }\n  ]\n}\n```\n\n## 依赖安装\n\n### 基础依赖（所有模式）\n\n```bash\npip install pymupdf ezdxf openpyxl numpy matplotlib\n```\n\n### CAD 管线（v4主力）\n\n```bash\n# ODA File Converter（免费，需手动下载安装）\n# 下载地址：https://www.opendesign.com/guestfiles/oda_file_converter\n\n# 或 AutoCAD（v3备用管线）\n# 需要安装 AutoCAD 2026+\n```\n\n### PDF 管线\n\n```bash\n# v6 模式（推荐）\npip install rapidocr\n\n# dl 模式\npip install onnxruntime opencv-python-headless\n# 模型文件：models/deepdoc/（已内置）\n\n# rapid / fast 模式\n# exe 文件已内置在 scripts/ocr_service/\n```\n\n## 故障排查\n\n| 问题 | 解决方案 |\n|:----|:--------|\n| ODA 路径异常 | 更新 config.json 中的 ODA_PATH |\n| ezdxf 版本冲突 | `pip install ezdxf==1.4.4` |\n| LISP 脚本失效 | 检查 dwg_extract_v2.lsp 路径配置 |\n| v4 管线失败 | 切 v3（accoreconsole+LISP） |\n| OCR 模型缺失 | 从 hf-mirror.com 下载 PP-OCRv6 模型 |\n| 内存不足 | 降低 max_pages 参数 |\n\n## 版本历史\n\n- v1.0.0（2026-08-18）：初始开源版本\n  - 支持 DWG/DXF/PDF/图片四种格式\n  - 四模式OCR自动降级\n  - 结构化JSON输出\n\n## 许可证\n\nMIT License - 可自由使用、修改、分发\n\n## 贡献\n\n欢迎提 Issue 和 PR。请确保：\n1. 代码符合 PEP 8 规范\n2. 新增功能附带测试用例\n3. 更新 CHANGELOG.md\n\nFile v0.1.1:README.md\n\n# Drawing Parser — 建筑图纸解析引擎\n\n[![Python](https://img.shields.io/badge/Python-3.8+-blue.svg)](https://www.python.org/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![GitHub stars](https://img.shields.io/github/stars/yfg305/drawing-parser)](https://github.com/yfg305/drawing-parser/stargazers)\n\n> 建筑图纸智能解析工具，支持 DWG/DXF/PDF/图片格式，自动提取文字、段落、材料表、尺寸标注等结构化数据。\n\n## ✨ 特性\n\n- **多格式支持**：DWG、DXF、PDF、PNG、JPG\n- **智能OCR**：四种OCR模式自动降级（PP-OCRv6 → deepdoc → RapidOCR → PaddleOCR）\n- **结构化输出**：JSON格式，包含文字、段落、表格、尺寸标注\n- **可视化分析**：支持图层截图、区域放大、距离测量\n- **Hana集成**：可直接作为 HanaAgent 技能使用\n\n## 📦 安装\n\n### 1. 克隆仓库\n\n```bash\ngit clone https://github.com/yfg305/drawing-parser.git\ncd drawing-parser\n```\n\n### 2. 安装依赖\n\n```bash\n# 基础依赖\npip install -r requirements.txt\n\n# 按需安装OCR模式\npip install rapidocr        # v6模式（推荐）\n# 或\npip install onnxruntime opencv-python-headless  # dl模式\n```\n\n### 3. CAD 依赖（可选）\n\n```bash\n# 方法一：ODA File Converter（推荐）\n# 下载地址：https://www.opendesign.com/guestfiles/oda_file_converter\n\n# 方法二：AutoCAD（v3备用）\n# 需要安装 AutoCAD 2026+\n```\n\n## 🚀 快速开始\n\n### Python API\n\n```python\nfrom scripts.cad_parser import parse_cad_drawing\nfrom scripts.pdf_parser import parse_pdf_drawing\n\n# 解析 CAD 图纸\nresult = parse_cad_drawing('floor_plan.dwg', output_dir='./output')\nprint(f\"提取文字: {len(result['texts'])} 条\")\nprint(f\"提取表格: {len(result['tables'])} 个\")\n\n# 解析 PDF 图纸\nresult = parse_pdf_drawing('elevation.pdf', ocr_mode='v6', output_dir='./output')\n```\n\n### 命令行\n\n```bash\n# 解析 CAD 图纸\npython scripts/cad_parser.py floor_plan.dwg ./output --mode v4\n\n# 解析 PDF 图纸（自动降级）\npython scripts/pdf_parser.py elevation.pdf ./output --mode v6\n```\n\n## 📊 输出示例\n\n```json\n{\n  \"project_name\": \"示例项目\",\n  \"source_file\": \"floor_plan.dwg\",\n  \"parse_time\": \"2026-08-18T18:00:00Z\",\n  \"texts\": [\n    {\n      \"content\": \"C30混凝土\",\n      \"bbox\": [100, 200, 300, 250],\n      \"layer\": \"TEXT\",\n      \"confidence\": 0.95\n    }\n  ],\n  \"paragraphs\": [\n    {\n      \"type\": \"title\",\n      \"content\": \"结构设计说明\",\n      \"position\": 1\n    }\n  ],\n  \"tables\": [\n    {\n      \"header\": [\"材料\", \"规格\", \"数量\"],\n      \"rows\": [\n        [\"钢筋\", \"HRB400\", \"120\"],\n        [\"混凝土\", \"C30\", \"45m³\"]\n      ]\n    }\n  ],\n  \"dimensions\": [\n    {\n      \"value\": 3600,\n      \"unit\": \"mm\",\n      \"position\": [500, 600]\n    }\n  ]\n}\n```\n\n## 🔧 配置\n\n编辑 `config.json`：\n\n```json\n{\n  \"ODA_PATH\": \"C:\\\\Program Files\\\\ODA\\\\ODAFileConverter.exe\",\n  \"ACCONSOLE_PATH\": \"C:\\\\Program Files\\\\Autodesk\\\\AutoCAD 2026\\\\accoreconsole.exe\",\n  \"OCR_MODE\": \"v6\",\n  \"MAX_PAGES\": 10,\n  \"OUTPUT_DIR\": \"./output\"\n}\n```\n\n## 📚 文档\n\n- [SKILL.md](SKILL.md) - 技能描述和触发条件\n- [scripts/](scripts/) - 核心解析脚本\n- [examples/](examples/) - 使用示例\n- [models/](models/) - OCR 模型文件\n\n## 🤝 贡献\n\n欢迎提 Issue 和 PR！\n\n1. Fork 本仓库\n2. 创建特性分支 (`git checkout -b feature/AmazingFeature`)\n3. 提交更改 (`git commit -m 'Add some AmazingFeature'`)\n4. 推送到分支 (`git push origin feature/AmazingFeature`)\n5. 开启 Pull Request\n\n## 📄 许可证\n\nMIT License - 详见 [LICENSE](LICENSE) 文件\n\n## 🙏 致谢\n\n- [ezdxf](https://github.com/mozman/ezdxf) - DXF 文件处理\n- [PyMuPDF](https://pymupdf.readthedocs.io/) - PDF 处理\n- [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR) - OCR 引擎\n- [RapidOCR](https://github.com/RapidAI/RapidOCR) - 快速OCR\n- [OpenDesign Alliance](https://www.opendesign.com/) - ODA File Converter\n\n---\n\nMade with ❤️ by [yfg305](https://github.com/yfg305)\n\nFile v0.1.1:_meta.json\n\n{\n  \"ownerId\": \"kn76k6w4x0228a3bz67yfpd5xn8cp2ra\",\n  \"slug\": \"ssq\",\n  \"version\": \"0.1.1\",\n  \"publishedAt\": 1787097394460\n}\n\nFile v0.1.1:skill-card.md\n\n## Description:\n\n建筑图纸解析引擎，支持 DWG/DXF/PDF/图片格式的图纸解析，并提取文字、段落、材料表、尺寸标注等结构化数据。\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[yfg305](https://clawhub.ai/user/yfg305)\n\n### License/Terms of Use:\n\nMIT\n\n## Use Case:\n\nDevelopers and engineering teams use this skill to parse architectural drawings into structured local JSON outputs for drafting, review, and downstream analysis workflows.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The security review says the skill processes potentially sensitive drawings with underspecified local file handling.\n\nMitigation: Run it in an isolated, least-privileged environment using copies of drawings, and review the local output directory after each run.\n\nRisk: The security review says the skill materially overstates what it can parse, including DWG, OCR, and table extraction.\n\nMitigation: Treat extracted text, tables, dimensions, and summaries as draft outputs requiring human review before design, compliance, or customer use.\n\nRisk: The security review flags dependency installation as underspecified.\n\nMitigation: Pin or lock Python and OCR/CAD dependencies before processing confidential building plans.\n\n## Reference(s):\n\n- [Server-resolved source repository](https://github.com/yfg305/ssq)\n- [ClawHub skill page](https://clawhub.ai/yfg305/skills/ssq)\n- [PyMuPDF documentation](https://pymupdf.readthedocs.io/)\n- [ezdxf](https://github.com/mozman/ezdxf)\n- [RapidOCR](https://github.com/RapidAI/RapidOCR)\n- [Open Design Alliance File Converter](https://www.opendesign.com/guestfiles/oda_file_converter)\n\n## Skill Output:\n\n**Output Type(s):** [text, code, shell commands, configuration, files]\n\n**Output Format:** [Markdown guidance with Python and shell examples; parsed drawing data is written as JSON files.]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Local outputs may include extracted drawing text, bounding boxes, tables, dimensions, layers, metadata, and error strings.]\n\n## Skill Version(s):\n\n0.1.1 (source: ClawHub release metadata; artifact metadata reports 1.0.0)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v0.1.1:manifest.json\n\n{\n  \"name\": \"drawing-parser\",\n  \"version\": \"1.0.0\",\n  \"description\": \"建筑图纸解析引擎，支持DWG/DXF/PDF/图片格式的结构化数据提取\",\n  \"author\": \"yfg305\",\n  \"license\": \"MIT\",\n  \"keywords\": [\"建筑\", \"图纸解析\", \"CAD\", \"PDF\", \"OCR\", \"ezdxf\", \"PP-OCR\"],\n  \"repository\": \"https://github.com/yfg305/drawing-parser\",\n  \"homepage\": \"https://github.com/yfg305/drawing-parser#readme\",\n  \"bugs\": {\n    \"url\": \"https://github.com/yfg305/drawing-parser/issues\"\n  },\n  \"engines\": {\n    \"python\": \">=3.8\"\n  },\n  \"dependencies\": {\n    \"pymupdf\": \">=1.23.0\",\n    \"ezdxf\": \">=1.4.0\",\n    \"openpyxl\": \">=3.1.0\",\n    \"numpy\": \">=1.24.0\",\n    \"matplotlib\": \">=3.7.0\"\n  },\n  \"optional_dependencies\": {\n    \"ocr-v6\": [\"rapidocr\"],\n    \"ocr-dl\": [\"onnxruntime\", \"opencv-python-headless\"],\n    \"cad-v4\": [\"oda-file-converter\"],\n    \"cad-v3\": [\"autocad\"]\n  },\n  \"scripts\": {\n    \"parse-cad\": \"python scripts/cad_parser.py\",\n    \"parse-pdf\": \"python scripts/pdf_parser.py\",\n    \"install-deps\": \"pip install -r requirements.txt\"\n  },\n  \"files\": [\n    \"SKILL.md\",\n    \"manifest.json\",\n    \"scripts/**/*.py\",\n    \"scripts/ocr_service/**/*\",\n    \"models/**/*\",\n    \"examples/**/*\",\n    \"LICENSE\",\n    \"README.md\"\n  ],\n  \"hana_integration\": {\n    \"skill_type\": \"tool\",\n    \"trigger_keywords\": [\"解析图纸\", \"读图\", \"CAD解析\", \"PDF解析\", \"提取图纸数据\"],\n    \"entry_point\": \"scripts/main.py\",\n    \"output_schema\": \"project_data.json\"\n  }\n}\n\nFile v0.1.1:LICENSE\n\nMIT License\n\nCopyright (c) 2026 yfg305\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\nFile v0.1.1:requirements.txt\n\n# 基础依赖（必需）\npymupdf>=1.23.0\nezdxf>=1.4.0\nopenpyxl>=3.1.0\nnumpy>=1.24.0\nmatplotlib>=3.7.0\n\n# OCR 模式选择（按需安装）\n# rapidocr        # v6模式（推荐，PP-OCRv6）\n# onnxruntime     # dl模式（deepdoc）\n# opencv-python-headless  # dl模式\n\n# CAD 依赖\n# oda-file-converter  # v4管线（需手动下载）\n# pyautocad          # v3管线备用\n\nArchive v0.1.0: 14 files, 16652 bytes\n\nFiles: .gitignore (541b), examples (0b), examples/basic_usage.py (2790b), LICENSE (1063b), manifest.json (1450b), README.md (4034b), requirements.txt (379b), scripts (0b), scripts/cad_parser.py (5281b), scripts/main.py (4697b), scripts/pdf_parser.py (6622b), skill-card.md (2528b), SKILL.md (3902b), _meta.json (122b)\n\nFile v0.1.0:SKILL.md\n\n---\nname: drawing-parser\ndescription: \"建筑图纸解析引擎。支持 DWG/DXF/PDF/图片格式的图纸解析，提取文字、段落、材料表、尺寸标注等结构化数据。用户提及'解析图纸''读图''CAD解析''PDF解析'时触发。\"\nmetadata:\n  version: \"1.0.0\"\n  author: \"yfg305\"\n  license: \"MIT\"\n  tags: [\"建筑\", \"图纸解析\", \"CAD\", \"PDF\", \"OCR\"]\n---\n\n# Drawing Parser — 建筑图纸解析引擎\n\n自动识别图纸格式（DWG/DXF/PDF/图片），调度对应解析管线，输出结构化数据供方案编制和审核使用。\n\n## 支持的格式\n\n| 格式 | 子引擎 | 技术方案 | 精度 |\n|:----|:------|:---------|:----:|\n| `.dwg` | CAD管线 | ODA转换→DXF→ezdxf | 高 |\n| `.dxf` | CAD管线 | ezdxf 直接读取 | 高 |\n| `.pdf` | PDF管线 | PyMuPDF + 多模式OCR | 高 |\n| `.png/.jpg` | PDF管线 | 同上，三种OCR可选 | 高 |\n\n## OCR 模式对比（PDF/图片）\n\n| 模式 | 技术栈 | 精度 | 速度 | 依赖 |\n|:----|:--------|:---:|:----|:----|\n| `v6`（推荐） | PP-OCRv6 rapidocr | 最高 | 较快 | pip install rapidocr |\n| `dl` | deepdoc ONNX | 高 | 较慢 | onnxruntime, opencv |\n| `rapid` | RapidOCR-json.exe | 高 | 较快 | 仅需exe |\n| `fast` | PaddleOCR-json.exe | 够用 | 快 | 仅需exe |\n\n## 快速开始\n\n### Python API\n\n```python\nimport sys\nsys.path.insert(0, 'path/to/scripts')\n\n# CAD 图纸解析\nfrom cad_parser import parse_cad_drawing\nresult = parse_cad_drawing('图纸.dwg', output_dir='./output')\n\n# PDF 图纸解析\nfrom pdf_parser import parse_pdf_drawing\nresult = parse_pdf_drawing('图纸.pdf', ocr_mode='v6', output_dir='./output')\n```\n\n### 命令行\n\n```bash\n# CAD 解析\npython scripts/cad_parser.py 图纸.dwg ./output --mode v4\n\n# PDF 解析（自动降级 v6→dl→rapid→fast）\npython scripts/pdf_parser.py 图纸.pdf ./output --mode v6\n```\n\n## 输出结构\n\n所有解析结果写入 `{项目}/_drawing_parser/project_data.json`：\n\n```json\n{\n  \"project_name\": \"示例项目\",\n  \"source_file\": \"图纸.dwg\",\n  \"parse_time\": \"2026-08-18T18:00:00Z\",\n  \"texts\": [\n    {\n      \"content\": \"钢筋混凝土\",\n      \"bbox\": [x1, y1, x2, y2],\n      \"layer\": \"TEXT\",\n      \"confidence\": 0.95\n    }\n  ],\n  \"paragraphs\": [\n    {\n      \"type\": \"title\",\n      \"content\": \"结构设计说明\",\n      \"position\": 1\n    }\n  ],\n  \"tables\": [\n    {\n      \"header\": [\"材料\", \"规格\", \"数量\"],\n      \"rows\": [[\"钢筋\", \"HRB400\", \"120\"]]\n    }\n  ],\n  \"dimensions\": [\n    {\n      \"value\": 3600,\n      \"unit\": \"mm\",\n      \"position\": [x, y]\n    }\n  ]\n}\n```\n\n## 依赖安装\n\n### 基础依赖（所有模式）\n\n```bash\npip install pymupdf ezdxf openpyxl numpy matplotlib\n```\n\n### CAD 管线（v4主力）\n\n```bash\n# ODA File Converter（免费，需手动下载安装）\n# 下载地址：https://www.opendesign.com/guestfiles/oda_file_converter\n\n# 或 AutoCAD（v3备用管线）\n# 需要安装 AutoCAD 2026+\n```\n\n### PDF 管线\n\n```bash\n# v6 模式（推荐）\npip install rapidocr\n\n# dl 模式\npip install onnxruntime opencv-python-headless\n# 模型文件：models/deepdoc/（已内置）\n\n# rapid / fast 模式\n# exe 文件已内置在 scripts/ocr_service/\n```\n\n## 故障排查\n\n| 问题 | 解决方案 |\n|:----|:--------|\n| ODA 路径异常 | 更新 config.json 中的 ODA_PATH |\n| ezdxf 版本冲突 | `pip install ezdxf==1.4.4` |\n| LISP 脚本失效 | 检查 dwg_extract_v2.lsp 路径配置 |\n| v4 管线失败 | 切 v3（accoreconsole+LISP） |\n| OCR 模型缺失 | 从 hf-mirror.com 下载 PP-OCRv6 模型 |\n| 内存不足 | 降低 max_pages 参数 |\n\n## 版本历史\n\n- v1.0.0（2026-08-18）：初始开源版本\n  - 支持 DWG/DXF/PDF/图片四种格式\n  - 四模式OCR自动降级\n  - 结构化JSON输出\n\n## 许可证\n\nMIT License - 可自由使用、修改、分发\n\n## 贡献\n\n欢迎提 Issue 和 PR。请确保：\n1. 代码符合 PEP 8 规范\n2. 新增功能附带测试用例\n3. 更新 CHANGELOG.md\n\nFile v0.1.0:README.md\n\n# Drawing Parser — 建筑图纸解析引擎\n\n[![Python](https://img.shields.io/badge/Python-3.8+-blue.svg)](https://www.python.org/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![GitHub stars](https://img.shields.io/github/stars/yfg305/drawing-parser)](https://github.com/yfg305/drawing-parser/stargazers)\n\n> 建筑图纸智能解析工具，支持 DWG/DXF/PDF/图片格式，自动提取文字、段落、材料表、尺寸标注等结构化数据。\n\n## ✨ 特性\n\n- **多格式支持**：DWG、DXF、PDF、PNG、JPG\n- **智能OCR**：四种OCR模式自动降级（PP-OCRv6 → deepdoc → RapidOCR → PaddleOCR）\n- **结构化输出**：JSON格式，包含文字、段落、表格、尺寸标注\n- **可视化分析**：支持图层截图、区域放大、距离测量\n- **Hana集成**：可直接作为 HanaAgent 技能使用\n\n## 📦 安装\n\n### 1. 克隆仓库\n\n```bash\ngit clone https://github.com/yfg305/drawing-parser.git\ncd drawing-parser\n```\n\n### 2. 安装依赖\n\n```bash\n# 基础依赖\npip install -r requirements.txt\n\n# 按需安装OCR模式\npip install rapidocr        # v6模式（推荐）\n# 或\npip install onnxruntime opencv-python-headless  # dl模式\n```\n\n### 3. CAD 依赖（可选）\n\n```bash\n# 方法一：ODA File Converter（推荐）\n# 下载地址：https://www.opendesign.com/guestfiles/oda_file_converter\n\n# 方法二：AutoCAD（v3备用）\n# 需要安装 AutoCAD 2026+\n```\n\n## 🚀 快速开始\n\n### Python API\n\n```python\nfrom scripts.cad_parser import parse_cad_drawing\nfrom scripts.pdf_parser import parse_pdf_drawing\n\n# 解析 CAD 图纸\nresult = parse_cad_drawing('floor_plan.dwg', output_dir='./output')\nprint(f\"提取文字: {len(result['texts'])} 条\")\nprint(f\"提取表格: {len(result['tables'])} 个\")\n\n# 解析 PDF 图纸\nresult = parse_pdf_drawing('elevation.pdf', ocr_mode='v6', output_dir='./output')\n```\n\n### 命令行\n\n```bash\n# 解析 CAD 图纸\npython scripts/cad_parser.py floor_plan.dwg ./output --mode v4\n\n# 解析 PDF 图纸（自动降级）\npython scripts/pdf_parser.py elevation.pdf ./output --mode v6\n```\n\n## 📊 输出示例\n\n```json\n{\n  \"project_name\": \"示例项目\",\n  \"source_file\": \"floor_plan.dwg\",\n  \"parse_time\": \"2026-08-18T18:00:00Z\",\n  \"texts\": [\n    {\n      \"content\": \"C30混凝土\",\n      \"bbox\": [100, 200, 300, 250],\n      \"layer\": \"TEXT\",\n      \"confidence\": 0.95\n    }\n  ],\n  \"paragraphs\": [\n    {\n      \"type\": \"title\",\n      \"content\": \"结构设计说明\",\n      \"position\": 1\n    }\n  ],\n  \"tables\": [\n    {\n      \"header\": [\"材料\", \"规格\", \"数量\"],\n      \"rows\": [\n        [\"钢筋\", \"HRB400\", \"120\"],\n        [\"混凝土\", \"C30\", \"45m³\"]\n      ]\n    }\n  ],\n  \"dimensions\": [\n    {\n      \"value\": 3600,\n      \"unit\": \"mm\",\n      \"position\": [500, 600]\n    }\n  ]\n}\n```\n\n## 🔧 配置\n\n编辑 `config.json`：\n\n```json\n{\n  \"ODA_PATH\": \"C:\\\\Program Files\\\\ODA\\\\ODAFileConverter.exe\",\n  \"ACCONSOLE_PATH\": \"C:\\\\Program Files\\\\Autodesk\\\\AutoCAD 2026\\\\accoreconsole.exe\",\n  \"OCR_MODE\": \"v6\",\n  \"MAX_PAGES\": 10,\n  \"OUTPUT_DIR\": \"./output\"\n}\n```\n\n## 📚 文档\n\n- [SKILL.md](SKILL.md) - 技能描述和触发条件\n- [scripts/](scripts/) - 核心解析脚本\n- [examples/](examples/) - 使用示例\n- [models/](models/) - OCR 模型文件\n\n## 🤝 贡献\n\n欢迎提 Issue 和 PR！\n\n1. Fork 本仓库\n2. 创建特性分支 (`git checkout -b feature/AmazingFeature`)\n3. 提交更改 (`git commit -m 'Add some AmazingFeature'`)\n4. 推送到分支 (`git push origin feature/AmazingFeature`)\n5. 开启 Pull Request\n\n## 📄 许可证\n\nMIT License - 详见 [LICENSE](LICENSE) 文件\n\n## 🙏 致谢\n\n- [ezdxf](https://github.com/mozman/ezdxf) - DXF 文件处理\n- [PyMuPDF](https://pymupdf.readthedocs.io/) - PDF 处理\n- [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR) - OCR 引擎\n- [RapidOCR](https://github.com/RapidAI/RapidOCR) - 快速OCR\n- [OpenDesign Alliance](https://www.opendesign.com/) - ODA File Converter\n\n---\n\nMade with ❤️ by [yfg305](https://github.com/yfg305)\n\nFile v0.1.0:_meta.json\n\n{\n  \"ownerId\": \"kn76k6w4x0228a3bz67yfpd5xn8cp2ra\",\n  \"slug\": \"ssq\",\n  \"version\": \"0.1.0\",\n  \"publishedAt\": 1787097178874\n}\n\nFile v0.1.0:skill-card.md\n\n## Description:\n\n建筑图纸解析引擎，支持 DWG、DXF、PDF 和图片格式的图纸解析，并提取文字、段落、材料表、尺寸标注等结构化数据。\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[yfg305](https://clawhub.ai/user/yfg305)\n\n### License/Terms of Use:\n\nMIT\n\n## Use Case:\n\nDevelopers, engineers, and building-design teams use this skill to parse architectural drawings and produce structured JSON for downstream drafting, review, or workflow automation.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill may materially overstate drawing-parsing capabilities and produce unreliable results for sensitive design files.\n\nMitigation: Require independent verification before using parsed output for architectural review, compliance, procurement, or safety decisions.\n\nRisk: The release is assessed as an incomplete prototype.\n\nMitigation: Install only after reviewing local dependencies and testing the parser on non-confidential drawings in an isolated output directory.\n\nRisk: Input drawings and generated outputs may contain confidential project information.\n\nMitigation: Avoid processing confidential drawings unless local storage, dependency behavior, and output retention are acceptable.\n\n## Reference(s):\n\n- [Server-resolved source repository](https://github.com/yfg305/ssq)\n- [ClawHub skill page](https://clawhub.ai/yfg305/skills/ssq)\n- [PyMuPDF documentation](https://pymupdf.readthedocs.io/)\n- [ezdxf repository](https://github.com/mozman/ezdxf)\n- [Open Design Alliance File Converter](https://www.opendesign.com/guestfiles/oda_file_converter)\n- [PaddleOCR repository](https://github.com/PaddlePaddle/PaddleOCR)\n- [RapidOCR repository](https://github.com/RapidAI/RapidOCR)\n\n## Skill Output:\n\n**Output Type(s):** [Analysis, Code, Shell commands, Configuration, JSON]\n\n**Output Format:** [Markdown guidance with Python and shell command examples; parsed drawing outputs are structured JSON files.]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Outputs may include extracted text, paragraphs, tables, dimensions, layers, metadata, and local project_data.json files.]\n\n## Skill Version(s):\n\n0.1.0 (source: ClawHub release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v0.1.0:manifest.json\n\n{\n  \"name\": \"drawing-parser\",\n  \"version\": \"1.0.0\",\n  \"description\": \"建筑图纸解析引擎，支持DWG/DXF/PDF/图片格式的结构化数据提取\",\n  \"author\": \"yfg305\",\n  \"license\": \"MIT\",\n  \"keywords\": [\"建筑\", \"图纸解析\", \"CAD\", \"PDF\", \"OCR\", \"ezdxf\", \"PP-OCR\"],\n  \"repository\": \"https://github.com/yfg305/drawing-parser\",\n  \"homepage\": \"https://github.com/yfg305/drawing-parser#readme\",\n  \"bugs\": {\n    \"url\": \"https://github.com/yfg305/drawing-parser/issues\"\n  },\n  \"engines\": {\n    \"python\": \">=3.8\"\n  },\n  \"dependencies\": {\n    \"pymupdf\": \">=1.23.0\",\n    \"ezdxf\": \">=1.4.0\",\n    \"openpyxl\": \">=3.1.0\",\n    \"numpy\": \">=1.24.0\",\n    \"matplotlib\": \">=3.7.0\"\n  },\n  \"optional_dependencies\": {\n    \"ocr-v6\": [\"rapidocr\"],\n    \"ocr-dl\": [\"onnxruntime\", \"opencv-python-headless\"],\n    \"cad-v4\": [\"oda-file-converter\"],\n    \"cad-v3\": [\"autocad\"]\n  },\n  \"scripts\": {\n    \"parse-cad\": \"python scripts/cad_parser.py\",\n    \"parse-pdf\": \"python scripts/pdf_parser.py\",\n    \"install-deps\": \"pip install -r requirements.txt\"\n  },\n  \"files\": [\n    \"SKILL.md\",\n    \"manifest.json\",\n    \"scripts/**/*.py\",\n    \"scripts/ocr_service/**/*\",\n    \"models/**/*\",\n    \"examples/**/*\",\n    \"LICENSE\",\n    \"README.md\"\n  ],\n  \"hana_integration\": {\n    \"skill_type\": \"tool\",\n    \"trigger_keywords\": [\"解析图纸\", \"读图\", \"CAD解析\", \"PDF解析\", \"提取图纸数据\"],\n    \"entry_point\": \"scripts/main.py\",\n    \"output_schema\": \"project_data.json\"\n  }\n}\n\nFile v0.1.0:LICENSE\n\nMIT License\n\nCopyright (c) 2026 yfg305\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\nFile v0.1.0:requirements.txt\n\n# 基础依赖（必需）\npymupdf>=1.23.0\nezdxf>=1.4.0\nopenpyxl>=3.1.0\nnumpy>=1.24.0\nmatplotlib>=3.7.0\n\n# OCR 模式选择（按需安装）\n# rapidocr        # v6模式（推荐，PP-OCRv6）\n# onnxruntime     # dl模式（deepdoc）\n# opencv-python-headless  # dl模式\n\n# CAD 依赖\n# oda-file-converter  # v4管线（需手动下载）\n# pyautocad          # v3管线备用","readmeExcerpt":"Skill: 图纸解析 Owner: yfg305 Summary: 建筑图纸解析引擎。支持 DWG/DXF/PDF/图片格式的图纸解析，提取文字、段落、材料表、尺寸标注等结构化数据。用户提及'解析图纸''读图''CAD解析''PDF解析'时触发。 Tags: latest:0.1.1 Version history: v0.1.1 | 2026-08-18T23:56:34.460Z | auto - Version 0.1.1 released with no file or documentation changes detected. - No new features, fixes, or updates included in this release. v0.1.0 | 2026-08-18T23:52:58.874Z | auto - Initial release of the drawing-parser e","codeSnippets":[],"executableExamples":[{"language":"python","snippet":"import sys\nsys.path.insert(0, 'path/to/scripts')\n\n# CAD 图纸解析\nfrom cad_parser import parse_cad_drawing\nresult = parse_cad_drawing('图纸.dwg', output_dir='./output')\n\n# PDF 图纸解析\nfrom pdf_parser import parse_pdf_drawing\nresult = parse_pdf_drawing('图纸.pdf', ocr_mode='v6', output_dir='./output')"},{"language":"bash","snippet":"# CAD 解析\npython scripts/cad_parser.py 图纸.dwg ./output --mode v4\n\n# PDF 解析（自动降级 v6→dl→rapid→fast）\npython scripts/pdf_parser.py 图纸.pdf ./output --mode v6"},{"language":"json","snippet":"{\n  \"project_name\": \"示例项目\",\n  \"source_file\": \"图纸.dwg\",\n  \"parse_time\": \"2026-08-18T18:00:00Z\",\n  \"texts\": [\n    {\n      \"content\": \"钢筋混凝土\",\n      \"bbox\": [x1, y1, x2, y2],\n      \"layer\": \"TEXT\",\n      \"confidence\": 0.95\n    }\n  ],\n  \"paragraphs\": [\n    {\n      \"type\": \"title\",\n      \"content\": \"结构设计说明\",\n      \"position\": 1\n    }\n  ],\n  \"tables\": [\n    {\n      \"header\": [\"材料\", \"规格\", \"数量\"],\n      \"rows\": [[\"钢筋\", \"HRB400\", \"120\"]]\n    }\n  ],\n  \"dimensions\": [\n    {\n      \"value\": 3600,\n      \"unit\": \"mm\",\n      \"position\": [x, y]\n    }\n  ]\n}"},{"language":"bash","snippet":"pip install pymupdf ezdxf openpyxl numpy matplotlib"},{"language":"bash","snippet":"# ODA File Converter（免费，需手动下载安装）\n# 下载地址：https://www.opendesign.com/guestfiles/oda_file_converter\n\n# 或 AutoCAD（v3备用管线）\n# 需要安装 AutoCAD 2026+"},{"language":"bash","snippet":"# v6 模式（推荐）\npip install rapidocr\n\n# dl 模式\npip install onnxruntime opencv-python-headless\n# 模型文件：models/deepdoc/（已内置）\n\n# rapid / fast 模式\n# exe 文件已内置在 scripts/ocr_service/"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: drawing-parser\ndescription: \"建筑图纸解析引擎。支持 DWG/DXF/PDF/图片格式的图纸解析，提取文字、段落、材料表、尺寸标注等结构化数据。用户提及'解析图纸''读图''CAD解析''PDF解析'时触发。\"\nmetadata:\n  version: \"1.0.0\"\n  author: \"yfg305\"\n  license: \"MIT\"\n  tags: [\"建筑\", \"图纸解析\", \"CAD\", \"PDF\", \"OCR\"]\n---\n\n# Drawing Parser — 建筑图纸解析引擎\n\n自动识别图纸格式（DWG/DXF/PDF/图片），调度对应解析管线，输出结构化数据供方案编制和审核使用。\n\n## 支持的格式\n\n| 格式 | 子引擎 | 技术方案 | 精度 |\n|:----|:------|:---------|:----:|\n| `.dwg` | CAD管线 | ODA转换→DXF→ezdxf | 高 |\n| `.dxf` | CAD管线 | ezdxf 直接读取 | 高 |\n| `.pdf` | PDF管线 | PyMuPDF + 多模式OCR | 高 |\n| `.png/.jpg` | PDF管线 | 同上，三种OCR可选 | 高 |\n\n## OCR 模式对比（PDF/图片）\n\n| 模式 | 技术栈 | 精度 | 速度 | 依赖 |\n|:----|:--------|:---:|:----|:----|\n| `v6`（推荐） | PP-OCRv6 rapidocr | 最高 | 较快 | pip install rapidocr |\n| `dl` | deepdoc ONNX | 高 | 较慢 | onnxruntime, opencv |\n| `rapid` | RapidOCR-json.exe | 高 | 较快 | 仅需exe |\n| `fast` | PaddleOCR-json.exe | 够用 | 快 | 仅需exe |\n\n## 快速开始\n\n### Python API\n\n```python\nimport sys\nsys.path.insert(0, 'path/to/scripts')\n\n# CAD 图纸解析\nfrom cad_parser import parse_cad_drawing\nresult = parse_cad_drawing('图纸.dwg', output_dir='./output')\n\n# PDF 图纸解析\nfrom pdf_parser import parse_pdf_drawing\nresult = parse_pdf_drawing('图纸.pdf', ocr_mode='v6', output_dir='./output')\n```\n\n### 命令行\n\n```bash\n# CAD 解析\npython scripts/cad_parser.py 图纸.dwg ./output --mode v4\n\n# PDF 解析（自动降级 v6→dl→rapid→fast）\npython scripts/pdf_parser.py 图纸.pdf ./output --mode v6\n```\n\n## 输出结构\n\n所有解析结果写入 `{项目}/_drawing_parser/project_data.json`：\n\n```json\n{\n  \"project_name\": \"示例项目\",\n  \"source_file\": \"图纸.dwg\",\n  \"parse_time\": \"2026-08-18T18:00:00Z\",\n  \"texts\": [\n    {\n      \"content\": \"钢筋混凝土\",\n      \"bbox\": [x1, y1, x2, y2],\n      \"layer\": \"TEXT\",\n      \"confidence\": 0.95\n    }\n  ],\n  \"paragraphs\": [\n    {\n      \"type\": \"title\",\n      \"content\": \"结构设计说明\",\n      \"position\": 1\n    }\n  ],\n  \"tables\": [\n    {\n      \"header\": [\"材料\", \"规格\", \"数量\"],\n      \"rows\": [[\"钢筋\", \"HRB400\", \"120\"]]\n    }\n  ],\n  \"dimensions\": [\n    {\n      \"value\": 3600,\n      \"unit\": \"mm\",\n      \"position\": [x, y]\n    }\n  ]\n}\n```\n\n## 依赖安装\n\n### 基础依赖（所有模式）\n\n```bash\npip install pymupdf ezdxf openpyxl numpy matplotlib\n```\n\n### CAD 管线（v4主力）\n\n```bash\n# ODA File Converter（免费，需手动下载安装）\n# 下载地址：https://www.opendesign.com/guestfiles/oda_file_converter\n\n# 或 AutoCAD（v3备用管线）\n# 需要安装 AutoCAD 2026+\n```\n\n### PDF 管线\n\n```bash\n# v6 模式（推荐）\npip install rapidocr\n\n# dl 模式\npip install onnxruntime opencv-python-headless\n# 模型文件：models/deepdoc/（已内置）\n\n# rapid / fast 模式\n# exe 文件已内置在 scripts/ocr_service/\n```\n\n## 故障排查\n\n| 问题 | 解决方案 |\n|:----|:--------|\n| ODA 路径异常 | 更新 config.json 中的 ODA_PATH |\n| ezdxf 版本冲突 | `pip install ezdxf==1.4.4` |\n| LISP 脚本失效 | 检查 dwg_extract_v2.lsp 路径配置 |\n| v4 管线失败 | 切 v3（accoreconsole+LISP） |\n| OCR 模型缺失 | 从 hf-mirror.com 下载 PP-OCRv6 模型 |\n| 内存不足 | 降低 max_pages 参数 |\n\n## 版本历史\n\n- v1.0.0（2026-08-18）：初始开源版本\n  - 支持 DWG/DXF/PDF/图片四种格式\n  - 四模式OCR自动降级\n  - 结构化JSON输出\n\n## 许可证\n\nMIT License - 可自由使用、修改、分发\n\n## 贡献\n\n欢迎提 Issue 和 PR。请确保：\n1. 代码符合 PEP 8 规范\n2. 新增功能附带测试用例\n3. 更新 CHANGELOG.md"},{"path":"README.md","content":"# Drawing Parser — 建筑图纸解析引擎\n\n[![Python](https://img.shields.io/badge/Python-3.8+-blue.svg)](https://www.python.org/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![GitHub stars](https://img.shields.io/github/stars/yfg305/drawing-parser)](https://github.com/yfg305/drawing-parser/stargazers)\n\n> 建筑图纸智能解析工具，支持 DWG/DXF/PDF/图片格式，自动提取文字、段落、材料表、尺寸标注等结构化数据。\n\n## ✨ 特性\n\n- **多格式支持**：DWG、DXF、PDF、PNG、JPG\n- **智能OCR**：四种OCR模式自动降级（PP-OCRv6 → deepdoc → RapidOCR → PaddleOCR）\n- **结构化输出**：JSON格式，包含文字、段落、表格、尺寸标注\n- **可视化分析**：支持图层截图、区域放大、距离测量\n- **Hana集成**：可直接作为 HanaAgent 技能使用\n\n## 📦 安装\n\n### 1. 克隆仓库\n\n```bash\ngit clone https://github.com/yfg305/drawing-parser.git\ncd drawing-parser\n```\n\n### 2. 安装依赖\n\n```bash\n# 基础依赖\npip install -r requirements.txt\n\n# 按需安装OCR模式\npip install rapidocr        # v6模式（推荐）\n# 或\npip install onnxruntime opencv-python-headless  # dl模式\n```\n\n### 3. CAD 依赖（可选）\n\n```bash\n# 方法一：ODA File Converter（推荐）\n# 下载地址：https://www.opendesign.com/guestfiles/oda_file_converter\n\n# 方法二：AutoCAD（v3备用）\n# 需要安装 AutoCAD 2026+\n```\n\n## 🚀 快速开始\n\n### Python API\n\n```python\nfrom scripts.cad_parser import parse_cad_drawing\nfrom scripts.pdf_parser import parse_pdf_drawing\n\n# 解析 CAD 图纸\nresult = parse_cad_drawing('floor_plan.dwg', output_dir='./output')\nprint(f\"提取文字: {len(result['texts'])} 条\")\nprint(f\"提取表格: {len(result['tables'])} 个\")\n\n# 解析 PDF 图纸\nresult = parse_pdf_drawing('elevation.pdf', ocr_mode='v6', output_dir='./output')\n```\n\n### 命令行\n\n```bash\n# 解析 CAD 图纸\npython scripts/cad_parser.py floor_plan.dwg ./output --mode v4\n\n# 解析 PDF 图纸（自动降级）\npython scripts/pdf_parser.py elevation.pdf ./output --mode v6\n```\n\n## 📊 输出示例\n\n```json\n{\n  \"project_name\": \"示例项目\",\n  \"source_file\": \"floor_plan.dwg\",\n  \"parse_time\": \"2026-08-18T18:00:00Z\",\n  \"texts\": [\n    {\n      \"content\": \"C30混凝土\",\n      \"bbox\": [100, 200, 300, 250],\n      \"layer\": \"TEXT\",\n      \"confidence\": 0.95\n    }\n  ],\n  \"paragraphs\": [\n    {\n      \"type\": \"title\",\n      \"content\": \"结构设计说明\",\n      \"position\": 1\n    }\n  ],\n  \"tables\": [\n    {\n      \"header\": [\"材料\", \"规格\", \"数量\"],\n      \"rows\": [\n        [\"钢筋\", \"HRB400\", \"120\"],\n        [\"混凝土\", \"C30\", \"45m³\"]\n      ]\n    }\n  ],\n  \"dimensions\": [\n    {\n      \"value\": 3600,\n      \"unit\": \"mm\",\n      \"position\": [500, 600]\n    }\n  ]\n}\n```\n\n## 🔧 配置\n\n编辑 `config.json`：\n\n```json\n{\n  \"ODA_PATH\": \"C:\\\\Program Files\\\\ODA\\\\ODAFileConverter.exe\",\n  \"ACCONSOLE_PATH\": \"C:\\\\Program Files\\\\Autodesk\\\\AutoCAD 2026\\\\accoreconsole.exe\",\n  \"OCR_MODE\": \"v6\",\n  \"MAX_PAGES\": 10,\n  \"OUTPUT_DIR\": \"./output\"\n}\n```\n\n## 📚 文档\n\n- [SKILL.md](SKILL.md) - 技能描述和触发条件\n- [scripts/](scripts/) - 核心解析脚本\n- [examples/](examples/) - 使用示例\n- [models/](models/) - OCR 模型文件\n\n## 🤝 贡献\n\n欢迎提 Issue 和 PR！\n\n1. Fork 本仓库\n2. 创建特性分支 (`git checkout -b feature/AmazingFeature`)\n3. 提交更改 (`git commit -m 'Add some AmazingFeature'`)\n4. 推送到分支 (`git push origin feature/AmazingFeature`)\n5. 开启 Pull Request\n\n## 📄 许可证\n\nMIT License - 详见 [LICENSE](LICENSE) 文件\n\n## 🙏 致谢\n\n- [ezdxf](https://github.com/mozman"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn76k6w4x0228a3bz67yfpd5xn8cp2ra\",\n  \"slug\": \"ssq\",\n  \"version\": \"0.1.1\",\n  \"publishedAt\": 1787097394460\n}"},{"path":"skill-card.md","content":"## Description:\n\n建筑图纸解析引擎，支持 DWG/DXF/PDF/图片格式的图纸解析，并提取文字、段落、材料表、尺寸标注等结构化数据。\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[yfg305](https://clawhub.ai/user/yfg305)\n\n### License/Terms of Use:\n\nMIT\n\n## Use Case:\n\nDevelopers and engineering teams use this skill to parse architectural drawings into structured local JSON outputs for drafting, review, and downstream analysis workflows.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The security review says the skill processes potentially sensitive drawings with underspecified local file handling.\n\nMitigation: Run it in an isolated, least-privileged environment using copies of drawings, and review the local output directory after each run.\n\nRisk: The security review says the skill materially overstates what it can parse, including DWG, OCR, and table extraction.\n\nMitigation: Treat extracted text, tables, dimensions, and summaries as draft outputs requiring human review before design, compliance, or customer use.\n\nRisk: The security review flags dependency installation as underspecified.\n\nMitigation: Pin or lock Python and OCR/CAD dependencies before processing confidential building plans.\n\n## Reference(s):\n\n- [Server-resolved source repository](https://github.com/yfg305/ssq)\n- [ClawHub skill page](https://clawhub.ai/yfg305/skills/ssq)\n- [PyMuPDF documentation](https://pymupdf.readthedocs.io/)\n- [ezdxf](https://github.com/mozman/ezdxf)\n- [RapidOCR](https://github.com/RapidAI/RapidOCR)\n- [Open Design Alliance File Converter](https://www.opendesign.com/guestfiles/oda_file_converter)\n\n## Skill Output:\n\n**Output Type(s):** [text, code, shell commands, configuration, files]\n\n**Output Format:** [Markdown guidance with Python and shell examples; parsed drawing data is written as JSON files.]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Local outputs may include extracted drawing text, bounding boxes, tables, dimensions, layers, metadata, and error strings.]\n\n## Skill Version(s):\n\n0.1.1 (source: ClawHub release metadata; artifact metadata reports 1.0.0)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment."},{"path":"manifest.json","content":"{\n  \"name\": \"drawing-parser\",\n  \"version\": \"1.0.0\",\n  \"description\": \"建筑图纸解析引擎，支持DWG/DXF/PDF/图片格式的结构化数据提取\",\n  \"author\": \"yfg305\",\n  \"license\": \"MIT\",\n  \"keywords\": [\"建筑\", \"图纸解析\", \"CAD\", \"PDF\", \"OCR\", \"ezdxf\", \"PP-OCR\"],\n  \"repository\": \"https://github.com/yfg305/drawing-parser\",\n  \"homepage\": \"https://github.com/yfg305/drawing-parser#readme\",\n  \"bugs\": {\n    \"url\": \"https://github.com/yfg305/drawing-parser/issues\"\n  },\n  \"engines\": {\n    \"python\": \">=3.8\"\n  },\n  \"dependencies\": {\n    \"pymupdf\": \">=1.23.0\",\n    \"ezdxf\": \">=1.4.0\",\n    \"openpyxl\": \">=3.1.0\",\n    \"numpy\": \">=1.24.0\",\n    \"matplotlib\": \">=3.7.0\"\n  },\n  \"optional_dependencies\": {\n    \"ocr-v6\": [\"rapidocr\"],\n    \"ocr-dl\": [\"onnxruntime\", \"opencv-python-headless\"],\n    \"cad-v4\": [\"oda-file-converter\"],\n    \"cad-v3\": [\"autocad\"]\n  },\n  \"scripts\": {\n    \"parse-cad\": \"python scripts/cad_parser.py\",\n    \"parse-pdf\": \"python scripts/pdf_parser.py\",\n    \"install-deps\": \"pip install -r requirements.txt\"\n  },\n  \"files\": [\n    \"SKILL.md\",\n    \"manifest.json\",\n    \"scripts/**/*.py\",\n    \"scripts/ocr_service/**/*\",\n    \"models/**/*\",\n    \"examples/**/*\",\n    \"LICENSE\",\n    \"README.md\"\n  ],\n  \"hana_integration\": {\n    \"skill_type\": \"tool\",\n    \"trigger_keywords\": [\"解析图纸\", \"读图\", \"CAD解析\", \"PDF解析\", \"提取图纸数据\"],\n    \"entry_point\": \"scripts/main.py\",\n    \"output_schema\": \"project_data.json\"\n  }\n}"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"建筑图纸解析引擎。支持 DWG/DXF/PDF/图片格式的图纸解析，提取文字、段落、材料表、尺寸标注等结构化数据。用户提及'解析图纸''读图''CAD解析''PDF解析'时触发。 Skill: 图纸解析 Owner: yfg305 Summary: 建筑图纸解析引擎。支持 DWG/DXF/PDF/图片格式的图纸解析，提取文字、段落、材料表、尺寸标注等结构化数据。用户提及'解析图纸''读图''CAD解析''PDF解析'时触发。 Tags: latest:0.1.1 Version history: v0.1.1 | 2026-08-18T23:56:34.460Z | auto - Version 0.1.1 released with no file or documentation changes detected. - No new features, fixes, or updates included in this release. v0.1.0 | 2026-08-18T23:52:58.874Z | auto - Initial release of the drawing-parser e","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":960,"uniquenessScore":54,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-10T10:35:39.297Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-10T10:35:39.297Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-10T13:32:29.596Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}