Generate annotated 2D technical drawings (PDF) from STEP files.
# Install dependencies
pip install -r requirements.txt
# Generate annotated PDF from a STEP file
python poc_annotated_export.py input/example.stp output/example_annotated.pdfTakes a 3D CAD model (STEP format) and generates:
- 2D orthographic views (front, top, left, right, isometric)
- Automatic dimension annotations (bounding box, diameters)
- Multi-page PDF with all views
cad-poc/
├── input/ # Place STEP files here
│ └── example.stp # Sample input (CATIA V5 part)
│
├── output/ # Generated files go here
│ ├── example_annotated.pdf # Generated annotated PDF
│ ├── view_*.svg # Individual view SVGs
│ └── ...
│
├── poc_annotated_export.py # MAIN SCRIPT - run this
├── poc_step_reader.py # Geometry analysis module
├── poc_2d_projection.py # 2D view generation module
├── dimensions.py # SVG dimension annotation library
├── poc_parametric.py # Parametric STEP generation (standalone)
│
├── requirements.txt # Python dependencies
└── PROJECT.md # Detailed technical documentation
poc_annotated_export.py - The unified pipeline. This is what you run.
python poc_annotated_export.py <input.stp> [output.pdf]These are imported by the main script. You don't need to run them directly.
| File | Purpose |
|---|---|
poc_step_reader.py |
Loads STEP files, extracts geometry info (bounding box, holes, surface types) |
poc_2d_projection.py |
Generates orthographic SVG views from 3D geometry |
dimensions.py |
Adds ISO-style dimension annotations to SVG files |
poc_parametric.py - Generates STEP files from parameters (separate use case).
python poc_parametric.py
# Output: output/parametric_output.stp- Python 3.11+
- build123d (OpenCASCADE-based CAD kernel)
- svglib + reportlab (PDF generation)
- No GD&T symbol rendering (tolerances, datums)
- No title block generation
- Output is technically accurate but not production-quality
See PROJECT.md for detailed technical documentation and future roadmap.