Skip to content

feat: add CAD workflow for DWG/DXF file translation#49

Open
reknottycat wants to merge 2 commits into
xunbu:mainfrom
reknottycat:feature/cad-workflow
Open

feat: add CAD workflow for DWG/DXF file translation#49
reknottycat wants to merge 2 commits into
xunbu:mainfrom
reknottycat:feature/cad-workflow

Conversation

@reknottycat

Copy link
Copy Markdown

Summary

  • Add CAD module (DwgConverter, TextExtractor, TextApplier) for DWG/DXF file translation
  • Add CadWorkflow: DWG→DXF→extract text→LLM translate→write back to DXF
  • Support LibreDWG and HaoChen/AutoCAD backends (ODA excluded — commercial)
  • Register CadWorkflowParams in schemas and factory
  • Add 12 unit tests covering the full CAD pipeline
  • ezdxf as optional dependency: pip install docutranslate[cad]

Changes

  • docutranslate/cad/ — new CAD module (dwg_converter, text_extractor, text_applier)
  • docutranslate/workflow/cad_workflow.py — CAD workflow class
  • docutranslate/core/schemas.py — CadWorkflowParams schema
  • docutranslate/core/factory.py — CAD workflow factory registration
  • tests/test_workflow/test_cad_workflow.py — 12 tests (all passing)

Backend support

Backend Status
LibreDWG Supported (open source, auto-detected)
HaoChen CAD Supported (COM automation)
AutoCAD Supported (COM automation)
ODA Excluded (commercial/paid)

Test results

12 passed in 6.63s

Qwen3 Translator added 2 commits June 12, 2026 16:40
- Add CAD module: DwgConverter, TextExtractor, TextApplier
- Add CadWorkflow with DWG→DXF→extract→translate→apply pipeline
- Support LibreDWG and HaoChen/AutoCAD backends
- Register CadWorkflowParams in schemas and factory
- Add 12 unit tests covering the full CAD pipeline
- ezdxf as optional dependency (pip install docutranslate[cad])
- Remove ODA references from docstrings
- Remove unused imports (os, re)
- Fix font_size_reduction=0 bug (use explicit None check)
- Remove hardcoded local paths from tests
- Remove PR 1 test file reference from .gitignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant