- docs/USAGE.md: Full usage guide with CLI options, Python API, troubleshooting - docs/ATOMIZER_INTEGRATION.md: Guide for FEA/Atomizer integration - examples/sample_config.toml: Annotated configuration example - README.md: Expanded with installation, usage, architecture
6.9 KiB
6.9 KiB
CAD-Documenter
One video → Complete engineering documentation.
Transform video walkthroughs of CAD models into comprehensive, structured documentation — ready for CDRs, FEA setups, and client deliverables.
The Problem
- Documentation is tedious — Engineers spend hours documenting CAD models manually
- Knowledge lives in heads — Verbal explanations during reviews aren't captured
- CDR prep is painful — Gathering images, writing descriptions, creating BOMs
- FEA setup requires context — Atomizer needs model understanding that's often verbal
The Solution
Record yourself explaining your CAD model. CAD-Documenter:
- Extracts key frames at scene changes (smart, not fixed intervals)
- Transcribes your explanation via Whisper
- Analyzes visually using GPT-4o or Claude vision
- Correlates visual + verbal to identify components
- Generates documentation with images, BOM, and Atomizer hints
Output
- 📄 Markdown documentation — Structured, version-controlled
- 📊 Bill of Materials — CSV with components, materials, functions
- 🔧 Component registry — Detailed specs per component
- 🎯 Atomizer hints — FEA objectives, constraints, parameters
- 📑 PDF — Professional output via Atomaste Report Standard
Installation
# Clone
git clone http://100.80.199.40:3000/Antoine/CAD-Documenter.git
cd CAD-Documenter
# Install with uv
uv sync
# Or with pip
pip install -e .
Requirements
- Python 3.12+
- ffmpeg (for video/audio processing)
- OpenAI or Anthropic API key (for vision analysis)
# macOS
brew install ffmpeg
# Ubuntu/Debian
sudo apt install ffmpeg
# Windows (with chocolatey)
choco install ffmpeg
Quick Start
# Set API key
export OPENAI_API_KEY="sk-your-key"
# Run
uv run cad-doc walkthrough.mp4
# With all features
uv run cad-doc walkthrough.mp4 --bom --atomizer-hints --pdf
Usage
# Basic
cad-doc video.mp4
# Custom output directory
cad-doc video.mp4 --output ./my_docs/
# Full pipeline
cad-doc video.mp4 --bom --atomizer-hints --pdf
# Just extract frames
cad-doc video.mp4 --frames-only
# Use Anthropic instead of OpenAI
cad-doc video.mp4 --api-provider anthropic
# Better transcription (slower)
cad-doc video.mp4 --whisper-model medium
Configuration
Create a config file:
cad-doc --init-config
# Creates ~/.cad-documenter.toml
Or set environment variables:
export OPENAI_API_KEY="sk-..." # Required for OpenAI
export ANTHROPIC_API_KEY="sk-..." # Required for Anthropic
export CAD_DOC_PROVIDER="anthropic" # Override default provider
See docs/USAGE.md for full configuration options.
Recording Tips
For best results when recording:
- Spin slowly — Give the AI time to see each angle
- Name components — "This is the main bracket..."
- Mention materials — "Made of 6061 aluminum"
- Describe functions — "This holds the motor"
- Note constraints — "Must fit within 200mm"
- Point out features — "These fillets reduce stress"
Architecture
┌─────────────────────────────────────────────────────────────────────┐
│ CAD-DOCUMENTER │
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Video │───►│ Frame │───►│ Vision │───►│ Struct │ │
│ │ Input │ │ Extract │ │ Analysis │ │ Output │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
│ │ │ │ │ │
│ ▼ ▼ ▼ ▼ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Audio │───►│ Whisper │───►│ Correlate│───►│ Generate │ │
│ │ Track │ │Transcribe│ │ Timeline │ │ Docs │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
└─────────────────────────────────────────────────────────────────────┘
Atomizer Integration
CAD-Documenter generates FEA optimization hints for Atomizer:
cad-doc walkthrough.mp4 --atomizer-hints
Output atomizer_hints.json:
{
"objectives": [{"name": "mass", "direction": "minimize"}],
"constraints": [{"type": "frequency", "value": ">100 Hz"}],
"parameters": ["thickness", "fillet_radius"],
"critical_regions": [{"feature": "fillet", "concern": "stress_concentration"}]
}
See docs/ATOMIZER_INTEGRATION.md for details.
Python API
from cad_documenter.pipeline import DocumentationPipeline
pipeline = DocumentationPipeline(
video_path="walkthrough.mp4",
output_dir="./docs"
)
results = pipeline.run_full_pipeline(
atomizer_hints=True,
bom=True,
pdf=True
)
Project Structure
CAD-Documenter/
├── src/cad_documenter/
│ ├── cli.py # Command-line interface
│ ├── pipeline.py # Main orchestrator
│ ├── config.py # Configuration management
│ ├── video_processor.py # Frame extraction
│ ├── audio_analyzer.py # Whisper transcription
│ ├── vision_analyzer.py # AI vision analysis
│ └── doc_generator.py # Output generation
├── prompts/ # AI prompts
├── templates/ # Jinja2 templates
├── tests/ # Test suite
├── docs/ # Documentation
└── examples/ # Example configs
Roadmap
- Core pipeline (frames, transcription, vision)
- Configuration system
- Atomizer hints extraction
- BOM generation
- Part Manager integration (P/N lookup)
- Interactive review mode
- Gitea auto-publish
- SolidWorks add-in
License
MIT
Credits
Built by Atomaste for the engineering community.