How a-shojaei/constructdrawingai works
ConstructDrawingAI turns construction drawings into structured CIR data, then supports detection, connectivity, ontology grounding, quantity takeoff, Q&A and RFI drafting. The principal route is drawing ingestion → CIR → perception → grounding/takeoff or agent outputs; the backend exposes these workflows. Synthetic generation and evaluation are substantial supporting capabilities. Documented layer flow and shown imports/calls support the relationships below; some subsystem internals were not sampled, so those relationships are omitted rather than inferred.
Main entry points: schema.py CIR schema · app.py Backend API · render.py Drawing renderer · generate.py Sample generation
Components 24
Shared data
- CIR schema
cir/schema.py
Drawing extraction
- Drawing ingest
ingest - Detection
perception/detector.py - Connectivity graph
perception/connectivity.py
Decision outputs
- Ontology grounding
grounding/ontology.py - Quantity takeoff
engines/takeoff.py - Drawing Q&A
agent/qa.py - RFI drafting
agent/rfi.py - Backend API
backend/app.py - Image detection adapter
backend/detect.py
Data and evaluation
- Real drawing sets
datasets/realsets.py - Dataset preparation
datasets/preparers - Model evaluation
eval/metrics.py - Evaluation tasks
eval/tasks.py
Synthetic engine
- Electrical model
synthetic/model.py - Scene layout
synthetic/scene.py - Drawing renderer
synthetic/render.py - Sample generation
synthetic/generate.py - Layout rules
synthetic/layout.py - Sample provenance
synthetic/provenance.py - Drawing style
synthetic/style.py - Symbol catalog
synthetic/symbols.py - Render canvas
synthetic/canvas.py
Other components
- Engineer
Connections 28
- Engineer → Backend API: submits drawing
README.md - Drawing ingest → CIR schema: produces CIR
README.md - CIR schema → Detection: feeds detection
README.md - Detection → CIR schema: writes detections
README.md - Detection → Connectivity graph: extracts connections
- CIR schema → Ontology grounding: supplies entities
README.md - CIR schema → Quantity takeoff: supplies quantities
engines/takeoff.py - CIR schema → Drawing Q&A: grounds answers
agent/qa.py - CIR schema → RFI drafting: informs drafts
agent/rfi.py - Backend API → Ontology grounding: calls grounding
backend/app.py - Backend API → Quantity takeoff: calls takeoff
backend/app.py - Backend API → Drawing Q&A: calls Q&A
backend/app.py - Backend API → RFI drafting: calls drafting
backend/app.py - Backend API → Image detection adapter: routes image
backend/app.py - Image detection adapter → CIR schema: returns CIR
backend/detect.py - Real drawing sets → Drawing ingest: rasterizes sheets
datasets/realsets.py - Dataset preparation → CIR schema: writes CIR data
datasets/preparers/graphml_cir.py - CIR schema → Model evaluation: scores predictions
eval/metrics.py - Evaluation tasks → CIR schema: holds ground truth
eval/tasks.py - Sample generation → Electrical model: builds model
synthetic/generate.py - Sample generation → Drawing renderer: renders samples
synthetic/generate.py - Sample generation → Scene layout: builds scenes
synthetic/generate.py - Drawing renderer → Electrical model: reads model
synthetic/render.py - Scene layout → Layout rules: uses layout
synthetic/scene.py - Drawing renderer → Render canvas: draws on canvas
synthetic/render.py - Drawing renderer → Drawing style: uses style
synthetic/render.py - Drawing renderer → Symbol catalog: draws symbols
synthetic/render.py - Drawing renderer → Sample provenance: records provenance
synthetic/render.py