Skip to content

MA3STR0/cad-poc

Repository files navigation

CAD Drawing Automation PoC

Generate annotated 2D technical drawings (PDF) from STEP files.

Quick Start

# 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.pdf

What It Does

Takes 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

Project Structure

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

Scripts

Main Script

poc_annotated_export.py - The unified pipeline. This is what you run.

python poc_annotated_export.py <input.stp> [output.pdf]

Supporting Modules

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

Standalone Script

poc_parametric.py - Generates STEP files from parameters (separate use case).

python poc_parametric.py
# Output: output/parametric_output.stp

Requirements

  • Python 3.11+
  • build123d (OpenCASCADE-based CAD kernel)
  • svglib + reportlab (PDF generation)

Limitations

  • 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages