# lihaolun201003/opticalwaveguiderouternative3d architecture

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

- Interactive diagram: https://gitdiagram.com/lihaolun201003/opticalwaveguiderouternative3d
- Repository: https://github.com/lihaolun201003/opticalwaveguiderouternative3d

## Overview

Native3D is a research prototype for routing 3D optical waveguides. The principal workflow takes a scene with source/target poses and constraints, routes channels sequentially through a finite 3D search space, checks candidate paths and fixed prior waveguides, then independently validates the submitted set from JSON. The graph also preserves geometry, connector, and validation subsystems. The README documents the multichannel behavior; source-index references support the sampled search and geometry links. Multinet implementation files were not sampled, so their internal call relationships are shown only where documented or left out.

Main entry points: [`src/native3d/search/finite_graph.py`](https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/search/finite_graph.py) (Finite 3D Graph), [`src/native3d/multinet/sequential.py`](https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/multinet/sequential.py) (Sequential Scheduler), [`src/native3d/io/caseio.py`](https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/io/caseio.py) (Scene Loader), [`src/native3d/search/actions.py`](https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/search/actions.py) (Motion Actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Scene Inputs"]
  node_scene_json["Scene JSON"]
  node_case_io["Scene Loader<br/>[caseio.py]"]
  node_case_factory["Built-in Cases<br/>[cases.py]"]
  node_router_config["Router Config<br/>[config.py]"]
end

subgraph group_search["Routing Search"]
  node_finite_graph["Finite 3D Graph<br/>[finite_graph.py]"]
  node_route_driver["Route Driver<br/>[router.py]"]
  node_astar["A* Search<br/>[astar.py]"]
  node_actions["Motion Actions<br/>[actions.py]"]
  node_connector["Pose Connector<br/>[connector.py]"]
  node_congestion["Congestion Field<br/>[congestion.py]"]
  node_state["Pose State<br/>[state.py]"]
end

subgraph group_geometry["Geometry Constraints"]
  node_geometry_primitives["3D Primitives<br/>[primitives.py]"]
  node_geometry_vectors["Vector Math<br/>[vec.py]"]
  node_constraints["Path Constraints<br/>[checks.py]"]
end

subgraph group_multinet["Multichannel Routing"]
  node_scheduler["Sequential Scheduler<br/>[sequential.py]"]
  node_occupancy["Fixed Occupancy<br/>[occupancy.py]"]
  node_inter_net["Inter-net Checks<br/>[inter_net.py]"]
  node_self_spacing["Self-spacing<br/>[self_spacing.py]"]
  node_multi_models["Multinet Models<br/>[models.py]"]
end

subgraph group_validation["Validation Results"]
  node_single_validate["Single-net Validator<br/>[validate.py]"]
  node_joint_validate["Joint Validator<br/>[joint_validate.py]"]
  node_artifacts["Artifact I/O<br/>[artifacts.py]"]
end

node_engineer(("Routing User"))

node_engineer -->|"provides case"| node_scene_json
node_scene_json -->|"loads scene"| node_case_io
node_engineer -->|"selects cases"| node_case_factory
node_case_factory -->|"builds scenes"| node_case_io
node_case_io -->|"loads settings"| node_router_config
node_case_io -->|"supplies scene"| node_scheduler
node_router_config -->|"configures search"| node_finite_graph
node_scheduler -->|"routes channel"| node_finite_graph
node_scheduler -->|"fixes prior paths"| node_occupancy
node_scheduler -->|"checks net spacing"| node_inter_net
node_scheduler -->|"checks self spacing"| node_self_spacing
node_scheduler -.->|"uses records"| node_multi_models
node_finite_graph -->|"searches graph"| node_astar
node_finite_graph -->|"generates moves"| node_actions
node_finite_graph -->|"builds terminal moves"| node_connector
node_finite_graph -->|"checks candidates"| node_constraints
node_finite_graph -->|"scores congestion"| node_congestion
node_astar -->|"expands states"| node_state
node_actions -->|"creates primitives"| node_geometry_primitives
node_connector -->|"creates actions"| node_actions
node_geometry_primitives -->|"uses vector math"| node_geometry_vectors
node_constraints -->|"checks curves"| node_geometry_primitives
node_finite_graph -->|"supports routing modes"| node_route_driver
node_scheduler -->|"validates submitted set"| node_joint_validate
node_engineer -->|"runs acceptance"| node_joint_validate
node_engineer -.->|"validates path JSON"| node_single_validate
node_single_validate -->|"reports results"| node_artifacts

click node_case_io "https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/io/caseio.py"
click node_case_factory "https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/cases.py"
click node_router_config "https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/config.py"
click node_scheduler "https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/multinet/sequential.py"
click node_occupancy "https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/multinet/occupancy.py"
click node_inter_net "https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/multinet/inter_net.py"
click node_self_spacing "https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/multinet/self_spacing.py"
click node_multi_models "https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/multinet/models.py"
click node_finite_graph "https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/search/finite_graph.py"
click node_route_driver "https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/search/router.py"
click node_astar "https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/search/astar.py"
click node_actions "https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/search/actions.py"
click node_connector "https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/search/connector.py"
click node_congestion "https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/search/congestion.py"
click node_state "https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/search/state.py"
click node_geometry_primitives "https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/geometry/primitives.py"
click node_geometry_vectors "https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/geometry/vec.py"
click node_constraints "https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/constraints/checks.py"
click node_single_validate "https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/validation/validate.py"
click node_joint_validate "https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/validation/joint_validate.py"
click node_artifacts "https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/io/artifacts.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_scene_json,node_case_io,node_case_factory,node_router_config,node_engineer toneBlue
class node_finite_graph,node_route_driver,node_astar,node_actions,node_connector,node_congestion,node_state toneAmber
class node_geometry_primitives,node_geometry_vectors,node_constraints toneMint
class node_scheduler,node_occupancy,node_inter_net,node_self_spacing,node_multi_models toneRose
class node_single_validate,node_joint_validate,node_artifacts toneIndigo
```

## Components

### Scene Inputs

- **Scene JSON**
- [Scene Loader](https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/io/caseio.py): `src/native3d/io/caseio.py`
- [Built-in Cases](https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/cases.py): `src/native3d/cases.py`
- [Router Config](https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/config.py): `src/native3d/config.py`

### Routing Search

- [Finite 3D Graph](https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/search/finite_graph.py): `src/native3d/search/finite_graph.py`
- [Route Driver](https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/search/router.py): `src/native3d/search/router.py`
- [A* Search](https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/search/astar.py): `src/native3d/search/astar.py`
- [Motion Actions](https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/search/actions.py): `src/native3d/search/actions.py`
- [Pose Connector](https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/search/connector.py): `src/native3d/search/connector.py`
- [Congestion Field](https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/search/congestion.py): `src/native3d/search/congestion.py`
- [Pose State](https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/search/state.py): `src/native3d/search/state.py`

### Geometry Constraints

- [3D Primitives](https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/geometry/primitives.py): `src/native3d/geometry/primitives.py`
- [Vector Math](https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/geometry/vec.py): `src/native3d/geometry/vec.py`
- [Path Constraints](https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/constraints/checks.py): `src/native3d/constraints/checks.py`

### Multichannel Routing

- [Sequential Scheduler](https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/multinet/sequential.py): `src/native3d/multinet/sequential.py`
- [Fixed Occupancy](https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/multinet/occupancy.py): `src/native3d/multinet/occupancy.py`
- [Inter-net Checks](https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/multinet/inter_net.py): `src/native3d/multinet/inter_net.py`
- [Self-spacing](https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/multinet/self_spacing.py): `src/native3d/multinet/self_spacing.py`
- [Multinet Models](https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/multinet/models.py): `src/native3d/multinet/models.py`

### Validation Results

- [Single-net Validator](https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/validation/validate.py): `src/native3d/validation/validate.py`
- [Joint Validator](https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/validation/joint_validate.py): `src/native3d/validation/joint_validate.py`
- [Artifact I/O](https://github.com/lihaolun201003/opticalwaveguiderouternative3d/blob/main/src/native3d/io/artifacts.py): `src/native3d/io/artifacts.py`

### Other components

- **Routing User**

## Connections

- Routing User → Scene JSON: provides case (evidence: `README.md`)
- Scene JSON → Scene Loader: loads scene (evidence: `src/native3d/io/caseio.py`)
- Routing User → Built-in Cases: selects cases (evidence: `README.md`)
- Built-in Cases → Scene Loader: builds scenes (evidence: `src/native3d/cases.py`)
- Scene Loader → Router Config: loads settings (evidence: `src/native3d/io/caseio.py`)
- Scene Loader → Sequential Scheduler: supplies scene (evidence: `README.md`)
- Router Config → Finite 3D Graph: configures search (evidence: `src/native3d/search/finite_graph.py`)
- Sequential Scheduler → Finite 3D Graph: routes channel (evidence: `README.md`)
- Sequential Scheduler → Fixed Occupancy: fixes prior paths (evidence: `README.md`)
- Sequential Scheduler → Inter-net Checks: checks net spacing (evidence: `README.md`)
- Sequential Scheduler → Self-spacing: checks self spacing (evidence: `README.md`)
- Sequential Scheduler → Multinet Models: uses records
- Finite 3D Graph → A* Search: searches graph (evidence: `src/native3d/search/finite_graph.py`)
- Finite 3D Graph → Motion Actions: generates moves (evidence: `src/native3d/search/finite_graph.py`)
- Finite 3D Graph → Pose Connector: builds terminal moves (evidence: `src/native3d/search/finite_graph.py`)
- Finite 3D Graph → Path Constraints: checks candidates (evidence: `src/native3d/search/finite_graph.py`)
- Finite 3D Graph → Congestion Field: scores congestion (evidence: `src/native3d/search/finite_graph.py`)
- A* Search → Pose State: expands states (evidence: `src/native3d/search/astar.py`)
- Motion Actions → 3D Primitives: creates primitives (evidence: `src/native3d/search/actions.py`)
- Pose Connector → Motion Actions: creates actions (evidence: `src/native3d/search/connector.py`)
- 3D Primitives → Vector Math: uses vector math (evidence: `src/native3d/geometry/primitives.py`)
- Path Constraints → 3D Primitives: checks curves (evidence: `src/native3d/constraints/checks.py`)
- Finite 3D Graph → Route Driver: supports routing modes (evidence: `src/native3d/search/router.py`)
- Sequential Scheduler → Joint Validator: validates submitted set (evidence: `README.md`)
- Routing User → Joint Validator: runs acceptance (evidence: `README.md`)
- Routing User → Single-net Validator: validates path JSON
- Single-net Validator → Artifact I/O: reports results (evidence: `src/native3d/io/artifacts.py`)
