Introduction¶
In the DeepSeek Harness (DSH) ecosystem, agents are usually proficient at handling text or general software code, but in the field of mechanical design, working with geometries and engineering files requires specific capabilities. The dsh-cad-design plugin integrates CadQuery and ezdxf to provide agents with parametric CAD design capabilities, enabling them to write modeling code, validate geometries, render previews, and export manufacturing files.
What Is This¶
dsh-cad-design is a parametric CAD toolkit designed for DeepSeek Harness. It allows agents to write CadQuery code to build 3D parts, or ezdxf code to generate 2D engineering drawings. This toolchain covers the complete workflow from code authoring, geometry validation, preview rendering, to file export.
Core Features¶
The plugin includes the following main features:
- 3D Modeling: Based on CadQuery and the OpenCASCADE kernel, with native STEP export support.
- 2D Drafting: Based on ezdxf, supporting the generation and export of DXF engineering drawings.
- Geometry Validation: Uses the
cad_validatetool to check the validity of code-generated geometries. - Preview Rendering: Uses
cad_renderto generate PNG or SVG preview images and provides factual data such as volume or bounding box. - File Export: Supports exporting to STEP, IGES, STL, 3MF (CadQuery), and DXF (ezdxf) formats.
- File Conversion: Uses
cad_convertto convert between different manufacturing formats. - Parametric Skills: Built-in
cadquery-designskill (for 3D part design) andezdxf-draftingskill (for 2D sketch drafting).
Installation and Configuration¶
Before using the plugin, the corresponding Python dependencies must be installed:
pip install cadquery # 3D 建模依赖
pip install ezdxf matplotlib # 2D 绘图及预览依赖
When installing the plugin, the --profile parameter must be explicitly specified. The web profile, which includes the web interface, is typically used:
dsh plugin --profile web add dsh-cad-design
After installation, the cad_doctor tool can be used to check the environment configuration and dependencies.
Configuration Example¶
The plugin configuration is located in the cordis.patch.yml file of the target profile. The following is a configuration snippet:
- insert:
- id: cad-tools
name: dsh-cad-design
config:
workDir: '' # 默认为 <session cwd>/.dsh/cad
timeoutSeconds: 120
enableSkill: true
backendPriority: # 后端路由优先级
- cadquery
- ezdxf
cadquery:
enabled: true
pythonPath: '' # 留空则自动检测
ezdxf:
enabled: true
pythonPath: ''
The environment variable DSH_CAD_PYTHON can also be used to override the default Python interpreter path.
Typical Usage¶
When a user issues a design instruction, the agent typically follows this workflow:
- Load the Skill: The agent loads the
cadquery-designorezdxf-draftingskill. - Validate: Run
cad_validateto validate the code and geometry results. - Preview: Run
cad_renderto generate a preview image (PNG/SVG). - Iterate: Adjust the code based on the preview until the design meets the requirements.
- Export: Run
cad_exportto export the file to STEP, DXF, or another supported format.
For example, if the user instruction is “Design an M8 hex-nut retainer, 3 mm wall, and export STEP”, the agent will complete the design following the steps above and output a retainer.step file.
Notes¶
- Execution Permissions: The
cad_*tools execute Python code locally. The plugin itself does not implement policy restrictions; when deployed in shared or untrusted environments, permission control should be combined with DSH’stools/pre-executehook. - Profile Requirement: Installing the plugin requires explicitly specifying
--profile, and the profile must include an interface bundle (such as thewebprofile). - Ecosystem Distinction: There is another plugin named
dsh-cadon npm, maintained by LAU-MARS. It is a CAD viewer plugin and is complementary to this plugin: this plugin is responsible for modeling and drafting, while that plugin is responsible for viewing models in the web interface. - Environment Requirements: Python 3.10+ and the corresponding pip packages (cadquery/ezdxf/matplotlib) are required.
Conclusion¶
dsh-cad-design brings parametric CAD capabilities into DSH agent workflows, enabling agents to move directly from code generation to manufacturing file output. For developers who need automated mechanical design pipelines, the plugin provides a complete toolchain from design to verification.
- Catalog page: https://www.skillhub.cn/plugins/Mrdifferent2022/dsh-cad-design
- Source code: https://github.com/Mrdifferent2022/dsh-cad-design