# mrnorwayman/automatic-pipe-routing architecture

> Architecture diagram of the GitHub repository mrnorwayman/automatic-pipe-routing, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mrnorwayman/automatic-pipe-routing
- Repository: https://github.com/mrnorwayman/automatic-pipe-routing

## Overview

Automatic 3D pipe routing takes STEP port data and an STL machine model, searches obstacle-avoiding paths for each pipe, turns paths into point clouds, and displays the result. Main.py documents the orchestration; Classes.py excerpts show STEP extraction, STL sampling/fragmentation, pipe generation through D*, and visualization. Some internal implementations are omitted, so uncertain links are not shown.

Main entry points: [`Main.py`](https://github.com/mrnorwayman/automatic-pipe-routing/blob/main/Main.py) (Routing workflow), [`Classes.py`](https://github.com/mrnorwayman/automatic-pipe-routing/blob/main/Classes.py) (Pipe definition)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Geometry inputs"]
  node_step["STEP port extraction<br/>[Classes.py]"]
  node_stl["STL obstacle model<br/>[Classes.py]"]
  node_fragment["Obstacle fragmentation<br/>[Classes.py]"]
end

subgraph group_routing["Pipe routing"]
  node_pipe["Pipe definition<br/>[Classes.py]"]
  node_search["D* path search<br/>[Classes.py]"]
  node_node["Search state<br/>[Classes.py]"]
  node_cloud["Pipe point cloud<br/>[Classes.py]"]
end

subgraph group_visualization["3D visualization"]
  node_viewer["Point-cloud viewer<br/>[Classes.py]"]
end

node_engineer(("Operator"))
node_main["Routing workflow<br/>[Main.py]"]
node_stepfile["STEP model"]
node_stlfile["STL mesh file"]
node_open3d["Open3D"]

node_engineer -->|"runs"| node_main
node_main -->|"requests ports"| node_step
node_stepfile -->|"read by"| node_step
node_step -->|"returns ports"| node_main
node_main -->|"creates pipes"| node_pipe
node_main -->|"creates model"| node_stl
node_stlfile -->|"read by"| node_stl
node_main -->|"requests obstacles"| node_fragment
node_stl -->|"samples mesh"| node_fragment
node_main -->|"sets obstacles"| node_pipe
node_pipe -->|"calls"| node_search
node_search -->|"creates states"| node_node
node_search -->|"returns path"| node_pipe
node_pipe -->|"converts path"| node_cloud
node_main -->|"adds pipe points"| node_viewer
node_stl -->|"adds mesh"| node_viewer
node_viewer -->|"displays"| node_open3d

click node_main "https://github.com/mrnorwayman/automatic-pipe-routing/blob/main/Main.py"
click node_step "https://github.com/mrnorwayman/automatic-pipe-routing/blob/main/Classes.py"
click node_stl "https://github.com/mrnorwayman/automatic-pipe-routing/blob/main/Classes.py"
click node_fragment "https://github.com/mrnorwayman/automatic-pipe-routing/blob/main/Classes.py"
click node_pipe "https://github.com/mrnorwayman/automatic-pipe-routing/blob/main/Classes.py"
click node_search "https://github.com/mrnorwayman/automatic-pipe-routing/blob/main/Classes.py"
click node_node "https://github.com/mrnorwayman/automatic-pipe-routing/blob/main/Classes.py"
click node_cloud "https://github.com/mrnorwayman/automatic-pipe-routing/blob/main/Classes.py"
click node_viewer "https://github.com/mrnorwayman/automatic-pipe-routing/blob/main/Classes.py"

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_step,node_stl,node_fragment toneBlue
class node_pipe,node_search,node_node,node_cloud toneAmber
class node_viewer toneMint
class node_engineer,node_stepfile,node_stlfile,node_open3d toneIndigo
class node_main toneTeal
```

## Components

### Geometry inputs

- [STEP port extraction](https://github.com/mrnorwayman/automatic-pipe-routing/blob/main/Classes.py): `Classes.py`
- [STL obstacle model](https://github.com/mrnorwayman/automatic-pipe-routing/blob/main/Classes.py): `Classes.py`
- [Obstacle fragmentation](https://github.com/mrnorwayman/automatic-pipe-routing/blob/main/Classes.py): `Classes.py`

### Pipe routing

- [Pipe definition](https://github.com/mrnorwayman/automatic-pipe-routing/blob/main/Classes.py): `Classes.py`
- [D* path search](https://github.com/mrnorwayman/automatic-pipe-routing/blob/main/Classes.py): `Classes.py`
- [Search state](https://github.com/mrnorwayman/automatic-pipe-routing/blob/main/Classes.py): `Classes.py`
- [Pipe point cloud](https://github.com/mrnorwayman/automatic-pipe-routing/blob/main/Classes.py): `Classes.py`

### 3D visualization

- [Point-cloud viewer](https://github.com/mrnorwayman/automatic-pipe-routing/blob/main/Classes.py): `Classes.py`

### Other components

- **Operator**
- [Routing workflow](https://github.com/mrnorwayman/automatic-pipe-routing/blob/main/Main.py): `Main.py`
- **STEP model**
- **STL mesh file**
- **Open3D**

## Connections

- Operator → Routing workflow: runs
- Routing workflow → STEP port extraction: requests ports
- STEP model → STEP port extraction: read by
- STEP port extraction → Routing workflow: returns ports
- Routing workflow → Pipe definition: creates pipes
- Routing workflow → STL obstacle model: creates model
- STL mesh file → STL obstacle model: read by
- Routing workflow → Obstacle fragmentation: requests obstacles
- STL obstacle model → Obstacle fragmentation: samples mesh
- Routing workflow → Pipe definition: sets obstacles
- Pipe definition → D* path search: calls
- D* path search → Search state: creates states
- D* path search → Pipe definition: returns path
- Pipe definition → Pipe point cloud: converts path
- Routing workflow → Point-cloud viewer: adds pipe points
- STL obstacle model → Point-cloud viewer: adds mesh
- Point-cloud viewer → Open3D: displays
