# st-tech/ppf-contact-solver architecture

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

- Interactive diagram: https://gitdiagram.com/st-tech/ppf-contact-solver
- Repository: https://github.com/st-tech/ppf-contact-solver

## Overview

ZOZO Contact Solver provides a Blender add-on and Python API for authoring physics scenes, running simulations locally or remotely, and viewing fetched animation/results; it also exposes MCP support for natural-language-driven simulations. The graph shows the Blender control path, the solver/server and Python-session surfaces, and the simulation engine. Several subsystems are represented from README capabilities or directory paths because their implementation was not sampled; those links are marked unverified where needed.

Main entry points: [`blender_addon/core/client.py`](https://github.com/st-tech/ppf-contact-solver/blob/main/blender_addon/core/client.py) (Solver Client), [`blender_addon/core/facade.py`](https://github.com/st-tech/ppf-contact-solver/blob/main/blender_addon/core/facade.py) (Communicator), [`blender_addon/ui/solver.py`](https://github.com/st-tech/ppf-contact-solver/blob/main/blender_addon/ui/solver.py) (Add-on UI), [`frontend/_session_.py`](https://github.com/st-tech/ppf-contact-solver/blob/main/frontend/_session_.py) (Python Sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_blender["Blender Add-on"]
  node_ui["Add-on UI<br/>[solver.py]"]
  node_facade["Communicator<br/>[facade.py]"]
  node_engine["Event Engine<br/>[engine.py]"]
  node_state["App State<br/>[state.py]"]
  node_encoder["Scene Encoder<br/>[mesh.py]"]
  node_client["Solver Client<br/>[client.py]"]
  node_cache[("Animation Cache<br/>[pc2.py]")]
  node_groups["Scene Groups<br/>[groups.py]"]
end

subgraph group_runtime["Simulation Runtime"]
  node_solver["Contact Solver<br/>[main.rs]"]
  node_server["Solver Server<br/>[engine.rs]"]
  node_formats["Scene Formats<br/>[statistics.rs]"]
end

subgraph group_python["Python API"]
  node_pyapi["Python Bindings<br/>[session_py.rs]"]
  node_session["Python Sessions<br/>[_session_.py]"]
  node_frontend["Python Frontend<br/>[__init__.py]"]
end

subgraph group_automation["MCP Integration"]
  node_mcp["MCP Server<br/>[http_handler.py]"]
end

node_user(("Artist / User"))
node_blender["Blender"]
node_mcpclient(("MCP Client"))

node_user -->|"authors scene"| node_blender
node_blender -->|"uses add-on"| node_ui
node_ui -->|"dispatches actions"| node_facade
node_facade -->|"dispatches events"| node_engine
node_engine -->|"updates state"| node_state
node_facade -->|"reads status"| node_state
node_ui -->|"runs solver tasks"| node_client
node_ui -->|"encodes scene"| node_encoder
node_encoder -->|"reads assignments"| node_groups
node_client -->|"reads group data"| node_groups
node_client -->|"writes animation"| node_cache
node_client -->|"uses communicator"| node_facade
node_client -.->|"connects remotely"| node_server
node_server -.->|"launches solver"| node_solver
node_solver -.->|"uses formats"| node_formats
node_user -->|"runs Python session"| node_session
node_session -->|"calls Rust bindings"| node_pyapi
node_session -->|"uses frontend modules"| node_frontend
node_mcpclient -->|"requests simulation"| node_mcp
node_mcp -.->|"controls add-on"| node_facade

click node_ui "https://github.com/st-tech/ppf-contact-solver/blob/main/blender_addon/ui/solver.py"
click node_facade "https://github.com/st-tech/ppf-contact-solver/blob/main/blender_addon/core/facade.py"
click node_engine "https://github.com/st-tech/ppf-contact-solver/blob/main/blender_addon/core/engine.py"
click node_state "https://github.com/st-tech/ppf-contact-solver/blob/main/blender_addon/core/state.py"
click node_encoder "https://github.com/st-tech/ppf-contact-solver/blob/main/blender_addon/core/encoder/mesh.py"
click node_client "https://github.com/st-tech/ppf-contact-solver/blob/main/blender_addon/core/client.py"
click node_cache "https://github.com/st-tech/ppf-contact-solver/blob/main/blender_addon/core/pc2.py"
click node_groups "https://github.com/st-tech/ppf-contact-solver/blob/main/blender_addon/models/groups.py"
click node_solver "https://github.com/st-tech/ppf-contact-solver/blob/main/crates/ppf-cts-solver/src/main.rs"
click node_server "https://github.com/st-tech/ppf-contact-solver/blob/main/crates/ppf-cts-server/src/engine.rs"
click node_formats "https://github.com/st-tech/ppf-contact-solver/blob/main/crates/ppf-cts-formats/src/statistics.rs"
click node_pyapi "https://github.com/st-tech/ppf-contact-solver/blob/main/crates/ppf-cts-py/src/session_py.rs"
click node_session "https://github.com/st-tech/ppf-contact-solver/blob/main/frontend/_session_.py"
click node_frontend "https://github.com/st-tech/ppf-contact-solver/blob/main/frontend/__init__.py"
click node_mcp "https://github.com/st-tech/ppf-contact-solver/blob/main/blender_addon/mcp/http_handler.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_ui,node_facade,node_engine,node_state,node_encoder,node_client,node_cache,node_groups,node_user,node_mcpclient toneBlue
class node_solver,node_server,node_formats toneAmber
class node_pyapi,node_session,node_frontend toneMint
class node_mcp toneRose
class node_blender toneIndigo
```

## Components

### Blender Add-on

- [Add-on UI](https://github.com/st-tech/ppf-contact-solver/blob/main/blender_addon/ui/solver.py): `blender_addon/ui/solver.py`
- [Communicator](https://github.com/st-tech/ppf-contact-solver/blob/main/blender_addon/core/facade.py): `blender_addon/core/facade.py`
- [Event Engine](https://github.com/st-tech/ppf-contact-solver/blob/main/blender_addon/core/engine.py): `blender_addon/core/engine.py`
- [App State](https://github.com/st-tech/ppf-contact-solver/blob/main/blender_addon/core/state.py): `blender_addon/core/state.py`
- [Scene Encoder](https://github.com/st-tech/ppf-contact-solver/blob/main/blender_addon/core/encoder/mesh.py): `blender_addon/core/encoder/mesh.py`
- [Solver Client](https://github.com/st-tech/ppf-contact-solver/blob/main/blender_addon/core/client.py): `blender_addon/core/client.py`
- [Animation Cache](https://github.com/st-tech/ppf-contact-solver/blob/main/blender_addon/core/pc2.py): `blender_addon/core/pc2.py`
- [Scene Groups](https://github.com/st-tech/ppf-contact-solver/blob/main/blender_addon/models/groups.py): `blender_addon/models/groups.py`

### Simulation Runtime

- [Contact Solver](https://github.com/st-tech/ppf-contact-solver/blob/main/crates/ppf-cts-solver/src/main.rs): `crates/ppf-cts-solver/src/main.rs`
- [Solver Server](https://github.com/st-tech/ppf-contact-solver/blob/main/crates/ppf-cts-server/src/engine.rs): `crates/ppf-cts-server/src/engine.rs`
- [Scene Formats](https://github.com/st-tech/ppf-contact-solver/blob/main/crates/ppf-cts-formats/src/statistics.rs): `crates/ppf-cts-formats/src/statistics.rs`

### Python API

- [Python Bindings](https://github.com/st-tech/ppf-contact-solver/blob/main/crates/ppf-cts-py/src/session_py.rs): `crates/ppf-cts-py/src/session_py.rs`
- [Python Sessions](https://github.com/st-tech/ppf-contact-solver/blob/main/frontend/_session_.py): `frontend/_session_.py`
- [Python Frontend](https://github.com/st-tech/ppf-contact-solver/blob/main/frontend/__init__.py): `frontend/__init__.py`

### MCP Integration

- [MCP Server](https://github.com/st-tech/ppf-contact-solver/blob/main/blender_addon/mcp/http_handler.py): `blender_addon/mcp/http_handler.py`

### Other components

- **Artist / User**
- **Blender**
- **MCP Client**

## Connections

- Artist / User → Blender: authors scene (evidence: `README.md`)
- Blender → Add-on UI: uses add-on (evidence: `README.md`)
- Add-on UI → Communicator: dispatches actions (evidence: `blender_addon/core/facade.py`)
- Communicator → Event Engine: dispatches events (evidence: `blender_addon/core/facade.py`)
- Event Engine → App State: updates state (evidence: `blender_addon/core/engine.py`)
- Communicator → App State: reads status (evidence: `blender_addon/core/facade.py`)
- Add-on UI → Solver Client: runs solver tasks (evidence: `blender_addon/ui/solver.py`)
- Add-on UI → Scene Encoder: encodes scene (evidence: `blender_addon/ui/solver.py`)
- Scene Encoder → Scene Groups: reads assignments (evidence: `blender_addon/core/encoder/mesh.py`)
- Solver Client → Scene Groups: reads group data (evidence: `blender_addon/core/client.py`)
- Solver Client → Animation Cache: writes animation (evidence: `blender_addon/core/client.py`)
- Solver Client → Communicator: uses communicator (evidence: `blender_addon/core/client.py`)
- Solver Client → Solver Server: connects remotely (evidence: `README.md`)
- Solver Server → Contact Solver: launches solver
- Contact Solver → Scene Formats: uses formats
- Artist / User → Python Sessions: runs Python session (evidence: `README.md`)
- Python Sessions → Python Bindings: calls Rust bindings (evidence: `frontend/_session_.py`)
- Python Sessions → Python Frontend: uses frontend modules (evidence: `frontend/_session_.py`)
- MCP Client → MCP Server: requests simulation (evidence: `README.md`)
- MCP Server → Communicator: controls add-on
