dsh-cad-review
开发工具 活跃维护

dsh-cad-review

dongsheng123132/dsh-cad-review

证据优先逻辑解析ASCII DXF文件内容,可执行确定性CAD规则审查,无需额外依赖即可快速核验文件规则合规性,输出结果直观可追溯,适配工程场景快速校验需求。

4
Stars 标星
0
Forks 分支
4
Watchers 关注
0
Open Issues
JavaScript
主要语言
MIT
开源协议
17 KB
仓库大小
1 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:dongsheng123132/dsh-cad-review
git clone https://github.com/dongsheng123132/dsh-cad-review.git
git clone git@github.com:dongsheng123132/dsh-cad-review.git
README.md main

dsh-cad-review

CI
MIT license
Node.js 22+
Awesome DSH Plugins

Evidence-first ASCII DXF inspection and deterministic CAD rule review for DeepSeek Harness.

This plugin does not infer engineering defects from screenshots. It reads CAD entities, hashes the source drawing, and emits issues tied to entity handle/index, layer, source line range and geometric location. Unsupported entities remain visible as an evidence gap.

Install

dsh plugin --profile <name> add github:dongsheng123132/dsh-cad-review

Configure a workspace root and project-owned policy:

- id: dsh-cad-review
  name: dsh-cad-review
  config:
    workspaceRoot: C:/absolute/project/path
    maxBytes: 20971520
    policy:
      requiredLayers: ["WALL"]
      forbiddenLayers: ["DEFPOINTS"]
      forbiddenEntityTypes: ["3DSOLID"]
      requireClosedPolylines: true
      minTextHeight: 2.5
      maxDrawingSpan: 1000
      requiredInsUnits: 4
      maxEntities: 100000
      maxIssues: 500

Paths must be .dxf files relative to workspaceRoot. Traversal, symlink escape, binary DXF and oversized input are refused.

DSH tools

  • dsh_cad_inspect_dxf — source SHA-256, units, bounds, layers, entity counts and exact entity geometry/line evidence.
  • dsh_cad_review_dxf — the same evidence plus a deterministic policy report. A per-call policyJson can override configured policy.

The extractor understands LINE, LWPOLYLINE, CIRCLE, ARC, TEXT, MTEXT, POINT and INSERT geometry. Other types are retained and reported as structurally unsupported rather than silently treated as reviewed.

Checks cover malformed numbers, zero-length lines, non-positive radii, polyline closure and declared vertex count, exact duplicate geometry, required/forbidden layers, forbidden entity types, text height, units, drawing span and entity limits. Severity overrides use stable rule IDs.

CLI

dsh-cad-review inspect drawing.dxf
dsh-cad-review review drawing.dxf --policy examples/strict-mm-policy.json

review exits 2 when error-severity issues exist.

Evidence boundary

  • v0.1 reads ASCII DXF only. Binary DXF and DWG are refused, not guessed.
  • A source SHA-256 identifies the exact reviewed bytes; it does not prove authorship.
  • Rules are project-owned. This package does not claim a universal building, mechanical or electrical code.
  • A passing report means the supplied deterministic policy found no error; it is not professional engineering approval.
  • Unsupported entity types make extraction incomplete and remain explicit in the report.

Verify

npm test
npm run check
npm run smoke:plugin
npm run smoke:cli

MIT