# ant1pal/nwd2dwg architecture

> Architecture diagram of the GitHub repository ant1pal/nwd2dwg, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ant1pal/nwd2dwg
- Repository: https://github.com/ant1pal/nwd2dwg

## Overview

NWD2DWG converts Navisworks models into CAD geometry and engineering deliverables during a shared model traversal, with revision comparison and delivery traceability as follow-on workflows. The graph preserves the README’s major export, analysis, configuration, and MCP capabilities. Several relationships are documented in the README or SOURCE INDEX; sampled excerpts are partial, so unsampled implementation details are not inferred.

Main entry points: [`src/EngineeringPipeline.cs`](https://github.com/ant1pal/nwd2dwg/blob/main/src/EngineeringPipeline.cs) (Engineering pipeline), [`src/NWD2DWG.cs`](https://github.com/ant1pal/nwd2dwg/blob/main/src/NWD2DWG.cs) (CLI and GUI), [`src/NwdPlugin.cs`](https://github.com/ant1pal/nwd2dwg/blob/main/src/NwdPlugin.cs) (Model extraction), [`mcp/nwd2dwg_mcp.py`](https://github.com/ant1pal/nwd2dwg/blob/main/mcp/nwd2dwg_mcp.py) (MCP server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and setup"]
  node_mcp["MCP server<br/>[nwd2dwg_mcp.py]"]
  node_app["CLI and GUI<br/>[NWD2DWG.cs]"]
end

subgraph group_extract["Model extraction"]
  node_plugin["Model extraction<br/>[NwdPlugin.cs]"]
  node_pipeline["Engineering pipeline"]
end

subgraph group_engineering["Engineering outputs"]
  node_boq["Quantity takeoff<br/>[BoqCalculator.cs]"]
  node_cog["Mass and CoG<br/>[CogCalculator.cs]"]
  node_steel["Steel profiles"]
  node_pipes["Pipe axes<br/>[PipeTracer.cs]"]
  node_iso["Pipe isometrics<br/>[IsoGenerator.cs]"]
  node_penetrations["Sleeves and openings"]
  node_clearance["Clearance checks"]
  node_plan["Floor plans<br/>[Section2Plan.cs]"]
  node_finishes["Room finish schedule"]
  node_clashes["Clash clustering<br/>[ClashClusterer.cs]"]
  node_bcf["BCF export<br/>[BcfExporter.cs]"]
end

subgraph group_formats["Geometry formats"]
  node_cad["CAD geometry<br/>[NWD2DWG.cs]"]
  node_gltf["glTF export<br/>[GltfWriter.cs]"]
  node_ifc["IFC export<br/>[IfcWriter.cs]"]
  node_simplify["Mesh simplification<br/>[MeshDecimator.cs]"]
  node_solid["Solid reconstruction"]
end

subgraph group_trace["Configuration and traceability"]
  node_profile["Output profiles<br/>[OutputProfile.cs]"]
  node_config["Settings and presets<br/>[ConfigManager.cs]"]
  node_xlsx["Excel reports<br/>[XlsxWriter.cs]"]
  node_revision["Revision index and diff<br/>[RevisionIndex.cs]"]
  node_delivery["Delivery log<br/>[DeliveryLog.cs]"]
end

node_user(("Engineer"))
node_navis["Navisworks API"]
node_deliverables["CAD and reports"]
node_autocad["AutoCAD"]

node_user -->|"runs conversion"| node_app
node_user -->|"requests tools"| node_mcp
node_mcp -->|"wraps CLI"| node_app
node_app -->|"loads model plugin"| node_plugin
node_plugin -->|"reads model"| node_navis
node_plugin -->|"feeds extracted data"| node_pipeline
node_pipeline -->|"calculates quantities"| node_boq
node_pipeline -->|"calculates mass"| node_cog
node_pipeline -->|"matches profiles"| node_steel
node_pipeline -->|"traces pipes"| node_pipes
node_pipeline -->|"generates isometrics"| node_iso
node_pipeline -->|"builds openings"| node_penetrations
node_pipeline -->|"checks clearance"| node_clearance
node_pipeline -->|"slices plan"| node_plan
node_pipeline -->|"builds schedule"| node_finishes
node_pipeline -->|"clusters clashes"| node_clashes
node_pipeline -->|"exports BCF"| node_bcf
node_plugin -->|"writes geometry"| node_cad
node_app -->|"exports glTF"| node_gltf
node_app -->|"exports IFC"| node_ifc
node_app -->|"simplifies mesh"| node_simplify
node_app -->|"reconstructs solids"| node_solid
node_cad -->|"converts to DWG"| node_autocad
node_pipeline -->|"writes index"| node_revision
node_pipeline -->|"records run"| node_delivery
node_config -->|"loads profile"| node_profile
node_pipeline -->|"uses output rules"| node_profile
node_pipeline -->|"writes workbook"| node_xlsx
node_app -->|"compares indexes"| node_revision
node_app -->|"produces"| node_deliverables
node_pipeline -->|"writes reports"| node_deliverables

click node_mcp "https://github.com/ant1pal/nwd2dwg/blob/main/mcp/nwd2dwg_mcp.py"
click node_app "https://github.com/ant1pal/nwd2dwg/blob/main/src/NWD2DWG.cs"
click node_plugin "https://github.com/ant1pal/nwd2dwg/blob/main/src/NwdPlugin.cs"
click node_pipeline "https://github.com/ant1pal/nwd2dwg/blob/main/src/EngineeringPipeline.cs"
click node_boq "https://github.com/ant1pal/nwd2dwg/blob/main/src/BoqCalculator.cs"
click node_cog "https://github.com/ant1pal/nwd2dwg/blob/main/src/CogCalculator.cs"
click node_steel "https://github.com/ant1pal/nwd2dwg/blob/main/src/SteelProfileMatcher.cs"
click node_pipes "https://github.com/ant1pal/nwd2dwg/blob/main/src/PipeTracer.cs"
click node_iso "https://github.com/ant1pal/nwd2dwg/blob/main/src/IsoGenerator.cs"
click node_penetrations "https://github.com/ant1pal/nwd2dwg/blob/main/src/PenetrationBuilder.cs"
click node_clearance "https://github.com/ant1pal/nwd2dwg/blob/main/src/ClearanceValidator.cs"
click node_plan "https://github.com/ant1pal/nwd2dwg/blob/main/src/Section2Plan.cs"
click node_finishes "https://github.com/ant1pal/nwd2dwg/blob/main/src/RoomFinishSchedule.cs"
click node_clashes "https://github.com/ant1pal/nwd2dwg/blob/main/src/ClashClusterer.cs"
click node_bcf "https://github.com/ant1pal/nwd2dwg/blob/main/src/BcfExporter.cs"
click node_cad "https://github.com/ant1pal/nwd2dwg/blob/main/src/NWD2DWG.cs"
click node_gltf "https://github.com/ant1pal/nwd2dwg/blob/main/src/GltfWriter.cs"
click node_ifc "https://github.com/ant1pal/nwd2dwg/blob/main/src/IfcWriter.cs"
click node_simplify "https://github.com/ant1pal/nwd2dwg/blob/main/src/MeshDecimator.cs"
click node_solid "https://github.com/ant1pal/nwd2dwg/blob/main/src/SolidReconstructor.cs"
click node_profile "https://github.com/ant1pal/nwd2dwg/blob/main/src/OutputProfile.cs"
click node_config "https://github.com/ant1pal/nwd2dwg/blob/main/src/ConfigManager.cs"
click node_xlsx "https://github.com/ant1pal/nwd2dwg/blob/main/src/XlsxWriter.cs"
click node_revision "https://github.com/ant1pal/nwd2dwg/blob/main/src/RevisionIndex.cs"
click node_delivery "https://github.com/ant1pal/nwd2dwg/blob/main/src/DeliveryLog.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_mcp,node_app toneBlue
class node_plugin,node_pipeline toneAmber
class node_boq,node_cog,node_steel,node_pipes,node_iso,node_penetrations,node_clearance,node_plan,node_finishes,node_clashes,node_bcf,node_navis toneMint
class node_cad,node_gltf,node_ifc,node_simplify,node_solid toneRose
class node_profile,node_config,node_xlsx,node_revision,node_delivery,node_user,node_deliverables,node_autocad toneIndigo
```

## Components

### Entry and setup

- [MCP server](https://github.com/ant1pal/nwd2dwg/blob/main/mcp/nwd2dwg_mcp.py): `mcp/nwd2dwg_mcp.py`
- [CLI and GUI](https://github.com/ant1pal/nwd2dwg/blob/main/src/NWD2DWG.cs): `src/NWD2DWG.cs`

### Model extraction

- [Model extraction](https://github.com/ant1pal/nwd2dwg/blob/main/src/NwdPlugin.cs): `src/NwdPlugin.cs`
- [Engineering pipeline](https://github.com/ant1pal/nwd2dwg/blob/main/src/EngineeringPipeline.cs): `src/EngineeringPipeline.cs`

### Engineering outputs

- [Quantity takeoff](https://github.com/ant1pal/nwd2dwg/blob/main/src/BoqCalculator.cs): `src/BoqCalculator.cs`
- [Mass and CoG](https://github.com/ant1pal/nwd2dwg/blob/main/src/CogCalculator.cs): `src/CogCalculator.cs`
- [Steel profiles](https://github.com/ant1pal/nwd2dwg/blob/main/src/SteelProfileMatcher.cs): `src/SteelProfileMatcher.cs`
- [Pipe axes](https://github.com/ant1pal/nwd2dwg/blob/main/src/PipeTracer.cs): `src/PipeTracer.cs`
- [Pipe isometrics](https://github.com/ant1pal/nwd2dwg/blob/main/src/IsoGenerator.cs): `src/IsoGenerator.cs`
- [Sleeves and openings](https://github.com/ant1pal/nwd2dwg/blob/main/src/PenetrationBuilder.cs): `src/PenetrationBuilder.cs`
- [Clearance checks](https://github.com/ant1pal/nwd2dwg/blob/main/src/ClearanceValidator.cs): `src/ClearanceValidator.cs`
- [Floor plans](https://github.com/ant1pal/nwd2dwg/blob/main/src/Section2Plan.cs): `src/Section2Plan.cs`
- [Room finish schedule](https://github.com/ant1pal/nwd2dwg/blob/main/src/RoomFinishSchedule.cs): `src/RoomFinishSchedule.cs`
- [Clash clustering](https://github.com/ant1pal/nwd2dwg/blob/main/src/ClashClusterer.cs): `src/ClashClusterer.cs`
- [BCF export](https://github.com/ant1pal/nwd2dwg/blob/main/src/BcfExporter.cs): `src/BcfExporter.cs`

### Geometry formats

- [CAD geometry](https://github.com/ant1pal/nwd2dwg/blob/main/src/NWD2DWG.cs): `src/NWD2DWG.cs`
- [glTF export](https://github.com/ant1pal/nwd2dwg/blob/main/src/GltfWriter.cs): `src/GltfWriter.cs`
- [IFC export](https://github.com/ant1pal/nwd2dwg/blob/main/src/IfcWriter.cs): `src/IfcWriter.cs`
- [Mesh simplification](https://github.com/ant1pal/nwd2dwg/blob/main/src/MeshDecimator.cs): `src/MeshDecimator.cs`
- [Solid reconstruction](https://github.com/ant1pal/nwd2dwg/blob/main/src/SolidReconstructor.cs): `src/SolidReconstructor.cs`

### Configuration and traceability

- [Output profiles](https://github.com/ant1pal/nwd2dwg/blob/main/src/OutputProfile.cs): `src/OutputProfile.cs`
- [Settings and presets](https://github.com/ant1pal/nwd2dwg/blob/main/src/ConfigManager.cs): `src/ConfigManager.cs`
- [Excel reports](https://github.com/ant1pal/nwd2dwg/blob/main/src/XlsxWriter.cs): `src/XlsxWriter.cs`
- [Revision index and diff](https://github.com/ant1pal/nwd2dwg/blob/main/src/RevisionIndex.cs): `src/RevisionIndex.cs`
- [Delivery log](https://github.com/ant1pal/nwd2dwg/blob/main/src/DeliveryLog.cs): `src/DeliveryLog.cs`

### Other components

- **Engineer**
- **Navisworks API**
- **CAD and reports**
- **AutoCAD**

## Connections

- Engineer → CLI and GUI: runs conversion (evidence: `README.md`)
- Engineer → MCP server: requests tools (evidence: `README.md`)
- MCP server → CLI and GUI: wraps CLI (evidence: `README.md`)
- CLI and GUI → Model extraction: loads model plugin (evidence: `src/NWD2DWG.cs`)
- Model extraction → Navisworks API: reads model (evidence: `README.md`)
- Model extraction → Engineering pipeline: feeds extracted data (evidence: `src/NwdPlugin.cs`)
- Engineering pipeline → Quantity takeoff: calculates quantities (evidence: `src/EngineeringPipeline.cs`)
- Engineering pipeline → Mass and CoG: calculates mass (evidence: `src/EngineeringPipeline.cs`)
- Engineering pipeline → Steel profiles: matches profiles (evidence: `src/EngineeringPipeline.cs`)
- Engineering pipeline → Pipe axes: traces pipes (evidence: `src/EngineeringPipeline.cs`)
- Engineering pipeline → Pipe isometrics: generates isometrics (evidence: `src/EngineeringPipeline.cs`)
- Engineering pipeline → Sleeves and openings: builds openings (evidence: `src/EngineeringPipeline.cs`)
- Engineering pipeline → Clearance checks: checks clearance (evidence: `src/EngineeringPipeline.cs`)
- Engineering pipeline → Floor plans: slices plan (evidence: `src/EngineeringPipeline.cs`)
- Engineering pipeline → Room finish schedule: builds schedule (evidence: `src/EngineeringPipeline.cs`)
- Engineering pipeline → Clash clustering: clusters clashes (evidence: `src/EngineeringPipeline.cs`)
- Engineering pipeline → BCF export: exports BCF (evidence: `src/EngineeringPipeline.cs`)
- Model extraction → CAD geometry: writes geometry (evidence: `src/NwdPlugin.cs`)
- CLI and GUI → glTF export: exports glTF (evidence: `src/NWD2DWG.cs`)
- CLI and GUI → IFC export: exports IFC (evidence: `src/NWD2DWG.cs`)
- CLI and GUI → Mesh simplification: simplifies mesh (evidence: `src/NWD2DWG.cs`)
- CLI and GUI → Solid reconstruction: reconstructs solids (evidence: `src/NWD2DWG.cs`)
- CAD geometry → AutoCAD: converts to DWG (evidence: `src/NWD2DWG.cs`)
- Engineering pipeline → Revision index and diff: writes index (evidence: `src/EngineeringPipeline.cs`)
- Engineering pipeline → Delivery log: records run (evidence: `src/EngineeringPipeline.cs`)
- Settings and presets → Output profiles: loads profile (evidence: `src/ConfigManager.cs`)
- Engineering pipeline → Output profiles: uses output rules (evidence: `src/EngineeringPipeline.cs`)
- Engineering pipeline → Excel reports: writes workbook (evidence: `src/EngineeringPipeline.cs`)
- CLI and GUI → Revision index and diff: compares indexes (evidence: `src/NWD2DWG.cs`)
- CLI and GUI → CAD and reports: produces (evidence: `README.md`)
- Engineering pipeline → CAD and reports: writes reports (evidence: `README.md`)
