# derkleineli/meshpad-release architecture

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

- Interactive diagram: https://gitdiagram.com/derkleineli/meshpad-release
- Repository: https://github.com/derkleineli/meshpad-release

## Overview

MeshPad is an interactive sketch-conditioned mesh creation and editing application, alongside code for training its addition and deletion models. The user workflow is to draw or erase sketch strokes, then request a mesh addition or deletion and inspect the updated mesh. The graph includes documented training and rendering capabilities; demo internals and unsampled model/engine wiring are not expanded beyond what the available excerpts support.

Main entry points: [`demo/gradio_demo.py`](https://github.com/derkleineli/meshpad-release/blob/master/demo/gradio_demo.py) (Gradio demo), [`meshpad/models/meshpad_addition.py`](https://github.com/derkleineli/meshpad-release/blob/master/meshpad/models/meshpad_addition.py) (Add part), [`meshpad/models/meshpad_deletion.py`](https://github.com/derkleineli/meshpad-release/blob/master/meshpad/models/meshpad_deletion.py) (Delete part), [`train_addition.py`](https://github.com/derkleineli/meshpad-release/blob/master/train_addition.py) (Addition trainer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Interactive editing"]
  node_demo["Gradio demo<br/>[gradio_demo.py]"]
  node_sketch["Sketch input<br/>[gradio_demo.py]"]
  node_addition["Add part"]
  node_deletion["Delete part"]
end

subgraph group_models["Mesh models"]
  node_base["Shared model base<br/>[base.py]"]
  node_add_shape["Addition ShapeOPT"]
  node_del_shape["Deletion ShapeOPT"]
end

subgraph group_training["Model training"]
  node_add_engine["Addition training<br/>[engine_addition.py]"]
  node_del_engine["Deletion training<br/>[engine_deletion.py]"]
  node_add_train["Addition trainer<br/>[train_addition.py]"]
  node_del_train["Deletion trainer<br/>[train_deletion.py]"]
  node_dataset["OBJ dataset"]
  node_arguments["Training options<br/>[argsparser.py]"]
end

subgraph group_rendering["Mesh representation"]
  node_renderer["Sketch renderer<br/>[pyrender_sketch.py]"]
  node_add_preprocess["Addition preprocessing<br/>[engine_addition.py]"]
  node_del_preprocess["Deletion preprocessing<br/>[engine_deletion.py]"]
  node_mesh["Mesh result"]
end

node_artist(("Artist"))
node_radio["RADIO vision model"]

node_artist -->|"uses"| node_demo
node_demo -->|"edits"| node_sketch
node_sketch -->|"updates sketch"| node_demo
node_demo -->|"requests addition"| node_addition
node_demo -->|"requests deletion"| node_deletion
node_addition -->|"generates mesh"| node_mesh
node_deletion -->|"edits mesh"| node_mesh
node_add_train -->|"parses options"| node_arguments
node_del_train -->|"parses options"| node_arguments
node_add_train -->|"loads dataset"| node_dataset
node_del_train -->|"loads dataset"| node_dataset
node_add_train -->|"initializes model"| node_addition
node_del_train -->|"initializes model"| node_deletion
node_add_train -->|"starts training"| node_add_engine
node_del_train -->|"starts training"| node_del_engine
node_add_engine -->|"prepares batches"| node_add_preprocess
node_del_engine -->|"prepares batches"| node_del_preprocess
node_add_preprocess -->|"renders sketches"| node_renderer
node_del_preprocess -->|"renders sketches"| node_renderer
node_add_preprocess -->|"reads batches"| node_dataset
node_del_preprocess -->|"reads batches"| node_dataset
node_addition -->|"uses"| node_base
node_deletion -->|"uses"| node_base
node_base -->|"extracts features"| node_radio
node_addition -->|"uses decoder"| node_add_shape
node_deletion -->|"uses decoder"| node_del_shape

click node_demo "https://github.com/derkleineli/meshpad-release/blob/master/demo/gradio_demo.py"
click node_sketch "https://github.com/derkleineli/meshpad-release/blob/master/demo/gradio_demo.py"
click node_addition "https://github.com/derkleineli/meshpad-release/blob/master/meshpad/models/meshpad_addition.py"
click node_deletion "https://github.com/derkleineli/meshpad-release/blob/master/meshpad/models/meshpad_deletion.py"
click node_add_engine "https://github.com/derkleineli/meshpad-release/blob/master/meshpad/engine_addition.py"
click node_del_engine "https://github.com/derkleineli/meshpad-release/blob/master/meshpad/engine_deletion.py"
click node_add_train "https://github.com/derkleineli/meshpad-release/blob/master/train_addition.py"
click node_del_train "https://github.com/derkleineli/meshpad-release/blob/master/train_deletion.py"
click node_dataset "https://github.com/derkleineli/meshpad-release/blob/master/meshpad/dataset/obj_folder_dataset.py"
click node_arguments "https://github.com/derkleineli/meshpad-release/blob/master/meshpad/utils/argsparser.py"
click node_base "https://github.com/derkleineli/meshpad-release/blob/master/meshpad/models/base.py"
click node_add_shape "https://github.com/derkleineli/meshpad-release/blob/master/meshpad/models/shape_opt_addition.py"
click node_del_shape "https://github.com/derkleineli/meshpad-release/blob/master/meshpad/models/shape_opt_deletion.py"
click node_renderer "https://github.com/derkleineli/meshpad-release/blob/master/meshpad/utils/pyrender_sketch.py"
click node_add_preprocess "https://github.com/derkleineli/meshpad-release/blob/master/meshpad/engine_addition.py"
click node_del_preprocess "https://github.com/derkleineli/meshpad-release/blob/master/meshpad/engine_deletion.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_demo,node_sketch,node_addition,node_deletion toneBlue
class node_base,node_add_shape,node_del_shape toneAmber
class node_add_engine,node_del_engine,node_add_train,node_del_train,node_dataset,node_arguments toneMint
class node_renderer,node_add_preprocess,node_del_preprocess,node_mesh toneRose
class node_artist,node_radio toneIndigo
```

## Components

### Interactive editing

- [Gradio demo](https://github.com/derkleineli/meshpad-release/blob/master/demo/gradio_demo.py): `demo/gradio_demo.py`
- [Sketch input](https://github.com/derkleineli/meshpad-release/blob/master/demo/gradio_demo.py): `demo/gradio_demo.py`
- [Add part](https://github.com/derkleineli/meshpad-release/blob/master/meshpad/models/meshpad_addition.py): `meshpad/models/meshpad_addition.py`
- [Delete part](https://github.com/derkleineli/meshpad-release/blob/master/meshpad/models/meshpad_deletion.py): `meshpad/models/meshpad_deletion.py`

### Mesh models

- [Shared model base](https://github.com/derkleineli/meshpad-release/blob/master/meshpad/models/base.py): `meshpad/models/base.py`
- [Addition ShapeOPT](https://github.com/derkleineli/meshpad-release/blob/master/meshpad/models/shape_opt_addition.py): `meshpad/models/shape_opt_addition.py`
- [Deletion ShapeOPT](https://github.com/derkleineli/meshpad-release/blob/master/meshpad/models/shape_opt_deletion.py): `meshpad/models/shape_opt_deletion.py`

### Model training

- [Addition training](https://github.com/derkleineli/meshpad-release/blob/master/meshpad/engine_addition.py): `meshpad/engine_addition.py`
- [Deletion training](https://github.com/derkleineli/meshpad-release/blob/master/meshpad/engine_deletion.py): `meshpad/engine_deletion.py`
- [Addition trainer](https://github.com/derkleineli/meshpad-release/blob/master/train_addition.py): `train_addition.py`
- [Deletion trainer](https://github.com/derkleineli/meshpad-release/blob/master/train_deletion.py): `train_deletion.py`
- [OBJ dataset](https://github.com/derkleineli/meshpad-release/blob/master/meshpad/dataset/obj_folder_dataset.py): `meshpad/dataset/obj_folder_dataset.py`
- [Training options](https://github.com/derkleineli/meshpad-release/blob/master/meshpad/utils/argsparser.py): `meshpad/utils/argsparser.py`

### Mesh representation

- [Sketch renderer](https://github.com/derkleineli/meshpad-release/blob/master/meshpad/utils/pyrender_sketch.py): `meshpad/utils/pyrender_sketch.py`
- [Addition preprocessing](https://github.com/derkleineli/meshpad-release/blob/master/meshpad/engine_addition.py): `meshpad/engine_addition.py`
- [Deletion preprocessing](https://github.com/derkleineli/meshpad-release/blob/master/meshpad/engine_deletion.py): `meshpad/engine_deletion.py`
- **Mesh result**

### Other components

- **Artist**
- **RADIO vision model**

## Connections

- Artist → Gradio demo: uses
- Gradio demo → Sketch input: edits
- Sketch input → Gradio demo: updates sketch
- Gradio demo → Add part: requests addition
- Gradio demo → Delete part: requests deletion
- Add part → Mesh result: generates mesh
- Delete part → Mesh result: edits mesh
- Addition trainer → Training options: parses options
- Deletion trainer → Training options: parses options
- Addition trainer → OBJ dataset: loads dataset
- Deletion trainer → OBJ dataset: loads dataset
- Addition trainer → Add part: initializes model
- Deletion trainer → Delete part: initializes model
- Addition trainer → Addition training: starts training
- Deletion trainer → Deletion training: starts training
- Addition training → Addition preprocessing: prepares batches
- Deletion training → Deletion preprocessing: prepares batches
- Addition preprocessing → Sketch renderer: renders sketches
- Deletion preprocessing → Sketch renderer: renders sketches
- Addition preprocessing → OBJ dataset: reads batches
- Deletion preprocessing → OBJ dataset: reads batches
- Add part → Shared model base: uses
- Delete part → Shared model base: uses
- Shared model base → RADIO vision model: extracts features
- Add part → Addition ShapeOPT: uses decoder
- Delete part → Deletion ShapeOPT: uses decoder
