# wangyao1052/yi3d architecture

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

- Interactive diagram: https://gitdiagram.com/wangyao1052/yi3d
- Repository: https://github.com/wangyao1052/yi3d

## Overview

Yi3D is a desktop parametric 3D-modeling application with a C++ modeling engine, Qt/OSG interface, Python API, and scripting integrations. The main workflow is to create sketches or primitives, apply modeling and modification features, and save the resulting model; the application also supports selection, viewing, and editing through GUI commands. README-listed capabilities are represented even where implementation excerpts were unavailable. Edges are limited to README-documented behavior or relationships visible in the supplied source index and excerpts.

Main entry points: [`src/wy3d/db/Database.cpp`](https://github.com/wangyao1052/yi3d/blob/main/src/wy3d/db/Database.cpp) (Model Database), [`src/wy3dApp/commands`](https://github.com/wangyao1052/yi3d/tree/main/src/wy3dApp/commands) (GUI Commands), [`src/wy3dApp/application/Application.cpp`](https://github.com/wangyao1052/yi3d/blob/main/src/wy3dApp/application/Application.cpp) (Application Manager), [`src/wy3d`](https://github.com/wangyao1052/yi3d/tree/main/src/wy3d) (Part Features)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Desktop Application"]
  node_main["Application Startup<br/>[main.cpp]"]
  node_application["Application Manager<br/>[Application.cpp]"]
  node_document["Document and Autosave<br/>[Document.cpp]"]
  node_commands["GUI Commands"]
  node_selection["Selection<br/>[SelectHandler.cpp]"]
  node_panels["Dock Panels"]
end

subgraph group_model["Modeling Engine"]
  node_database[("Model Database<br/>[Database.cpp]")]
  node_sketch["2D and 3D Sketching"]
  node_primitives["Solid Primitives"]
  node_features["Part Features"]
  node_operations["Boolean and Modifiers"]
end

subgraph group_interop["Scripting and Import"]
  node_python["Python Bindings"]
  node_executor["Python Script Executor"]
  node_ipc["IPC Server<br/>[IpcServer.cpp]"]
  node_dxf["DXF Sketch Exchange"]
  node_ai["AI Modeling Skill<br/>[IpcClient.py]"]
end

subgraph group_geometry["Geometry Services"]
  node_topology["Topology Naming"]
end

node_user(("Modeler"))

node_user -->|"starts"| node_main
node_main -->|"initializes"| node_application
node_application -.->|"manages"| node_document
node_user -->|"invokes"| node_commands
node_commands -.->|"creates sketches"| node_sketch
node_commands -.->|"creates shapes"| node_primitives
node_commands -.->|"creates features"| node_features
node_commands -.->|"applies operations"| node_operations
node_application -->|"configures"| node_selection
node_application -->|"configures"| node_panels
node_database -.->|"stores model"| node_sketch
node_database -.->|"stores model"| node_primitives
node_database -.->|"stores model"| node_features
node_database -.->|"stores model"| node_operations
node_features -.->|"uses naming"| node_topology
node_python -->|"exposes API"| node_database
node_executor -.->|"executes scripts"| node_python
node_user -->|"describes model"| node_ai
node_ai -->|"sends script"| node_ipc
node_ipc -.->|"dispatches script"| node_executor
node_dxf -->|"exchanges sketches"| node_sketch
node_document -.->|"saves model"| node_database

click node_main "https://github.com/wangyao1052/yi3d/blob/main/src/wy3dApp/main.cpp"
click node_application "https://github.com/wangyao1052/yi3d/blob/main/src/wy3dApp/application/Application.cpp"
click node_document "https://github.com/wangyao1052/yi3d/blob/main/src/wy3dApp/application/Document.cpp"
click node_commands "https://github.com/wangyao1052/yi3d/tree/main/src/wy3dApp/commands"
click node_selection "https://github.com/wangyao1052/yi3d/blob/main/src/wy3dApp/select/SelectHandler.cpp"
click node_panels "https://github.com/wangyao1052/yi3d/blob/main/src/wy3dApp/widgets/panels/DockPanelManager.cpp"
click node_database "https://github.com/wangyao1052/yi3d/blob/main/src/wy3d/db/Database.cpp"
click node_sketch "https://github.com/wangyao1052/yi3d/tree/main/src/wy3d/sketch"
click node_primitives "https://github.com/wangyao1052/yi3d/tree/main/src/wy3d/primitives"
click node_features "https://github.com/wangyao1052/yi3d/tree/main/src/wy3d"
click node_operations "https://github.com/wangyao1052/yi3d/tree/main/src/wy3d/boolean"
click node_topology "https://github.com/wangyao1052/yi3d/tree/main/src/wy3d/topo"
click node_python "https://github.com/wangyao1052/yi3d/blob/main/src/wy3dPY/BindWydbDatabase.cpp"
click node_executor "https://github.com/wangyao1052/yi3d/blob/main/src/wy3dApp/application/PythonScriptExecutor.cpp"
click node_ipc "https://github.com/wangyao1052/yi3d/blob/main/src/wy3dApp/application/IpcServer.cpp"
click node_dxf "https://github.com/wangyao1052/yi3d/tree/main/scripts/modules/dxf"
click node_ai "https://github.com/wangyao1052/yi3d/blob/main/skills/YI3D/scripts/IpcClient.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_main,node_application,node_document,node_commands,node_selection,node_panels toneBlue
class node_database,node_sketch,node_primitives,node_features,node_operations toneAmber
class node_python,node_executor,node_ipc,node_dxf,node_ai toneMint
class node_topology toneRose
class node_user toneIndigo
```

## Components

### Desktop Application

- [Application Startup](https://github.com/wangyao1052/yi3d/blob/main/src/wy3dApp/main.cpp): `src/wy3dApp/main.cpp`
- [Application Manager](https://github.com/wangyao1052/yi3d/blob/main/src/wy3dApp/application/Application.cpp): `src/wy3dApp/application/Application.cpp`
- [Document and Autosave](https://github.com/wangyao1052/yi3d/blob/main/src/wy3dApp/application/Document.cpp): `src/wy3dApp/application/Document.cpp`
- [GUI Commands](https://github.com/wangyao1052/yi3d/tree/main/src/wy3dApp/commands): `src/wy3dApp/commands`
- [Selection](https://github.com/wangyao1052/yi3d/blob/main/src/wy3dApp/select/SelectHandler.cpp): `src/wy3dApp/select/SelectHandler.cpp`
- [Dock Panels](https://github.com/wangyao1052/yi3d/blob/main/src/wy3dApp/widgets/panels/DockPanelManager.cpp): `src/wy3dApp/widgets/panels/DockPanelManager.cpp`

### Modeling Engine

- [Model Database](https://github.com/wangyao1052/yi3d/blob/main/src/wy3d/db/Database.cpp): `src/wy3d/db/Database.cpp`
- [2D and 3D Sketching](https://github.com/wangyao1052/yi3d/tree/main/src/wy3d/sketch): `src/wy3d/sketch`
- [Solid Primitives](https://github.com/wangyao1052/yi3d/tree/main/src/wy3d/primitives): `src/wy3d/primitives`
- [Part Features](https://github.com/wangyao1052/yi3d/tree/main/src/wy3d): `src/wy3d`
- [Boolean and Modifiers](https://github.com/wangyao1052/yi3d/tree/main/src/wy3d/boolean): `src/wy3d/boolean`

### Scripting and Import

- [Python Bindings](https://github.com/wangyao1052/yi3d/blob/main/src/wy3dPY/BindWydbDatabase.cpp): `src/wy3dPY/BindWydbDatabase.cpp`
- [Python Script Executor](https://github.com/wangyao1052/yi3d/blob/main/src/wy3dApp/application/PythonScriptExecutor.cpp): `src/wy3dApp/application/PythonScriptExecutor.cpp`
- [IPC Server](https://github.com/wangyao1052/yi3d/blob/main/src/wy3dApp/application/IpcServer.cpp): `src/wy3dApp/application/IpcServer.cpp`
- [DXF Sketch Exchange](https://github.com/wangyao1052/yi3d/tree/main/scripts/modules/dxf): `scripts/modules/dxf`
- [AI Modeling Skill](https://github.com/wangyao1052/yi3d/blob/main/skills/YI3D/scripts/IpcClient.py): `skills/YI3D/scripts/IpcClient.py`

### Geometry Services

- [Topology Naming](https://github.com/wangyao1052/yi3d/tree/main/src/wy3d/topo): `src/wy3d/topo`

### Other components

- **Modeler**

## Connections

- Modeler → Application Startup: starts (evidence: `README.md`)
- Application Startup → Application Manager: initializes (evidence: `src/wy3dApp/main.cpp`)
- Application Manager → Document and Autosave: manages
- Modeler → GUI Commands: invokes (evidence: `README.md`)
- GUI Commands → 2D and 3D Sketching: creates sketches
- GUI Commands → Solid Primitives: creates shapes
- GUI Commands → Part Features: creates features
- GUI Commands → Boolean and Modifiers: applies operations
- Application Manager → Selection: configures (evidence: `src/wy3dApp/application/Application.cpp`)
- Application Manager → Dock Panels: configures (evidence: `src/wy3dApp/application/Application.cpp`)
- Model Database → 2D and 3D Sketching: stores model
- Model Database → Solid Primitives: stores model
- Model Database → Part Features: stores model
- Model Database → Boolean and Modifiers: stores model
- Part Features → Topology Naming: uses naming
- Python Bindings → Model Database: exposes API (evidence: `README.md`)
- Python Script Executor → Python Bindings: executes scripts
- Modeler → AI Modeling Skill: describes model (evidence: `README.md`)
- AI Modeling Skill → IPC Server: sends script (evidence: `README.md`)
- IPC Server → Python Script Executor: dispatches script
- DXF Sketch Exchange → 2D and 3D Sketching: exchanges sketches (evidence: `README.md`)
- Document and Autosave → Model Database: saves model
