# nachomonereo/meshbrushtool-rhino architecture

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

- Interactive diagram: https://gitdiagram.com/nachomonereo/meshbrushtool-rhino
- Repository: https://github.com/nachomonereo/meshbrushtool-rhino

## Overview

MeshBrushTool is a Rhino sculpting plug-in. The user runs SmoothBrush, selects a Mesh or SubD, and drags in the viewport; brush options control smoothing or inflation, radius, strength, and whether the original is retained. The brush updates geometry interactively, then the command commits the final geometry to the Rhino document. SubD conversion, camera-facing filtering, and stroke handling are visible in the sampled code. The README documents the user workflow and capabilities; unsampled internals are not inferred.

Main entry points: [`SmoothSubMeshCommand.cs`](https://github.com/nachomonereo/meshbrushtool-rhino/blob/master/SmoothSubMeshCommand.cs) (SmoothBrush command), [`SmoothBrush.cs`](https://github.com/nachomonereo/meshbrushtool-rhino/blob/master/SmoothBrush.cs) (Mesh and SubD sculpting), [`BaseBrush.cs`](https://github.com/nachomonereo/meshbrushtool-rhino/blob/master/BaseBrush.cs) (Brush input and options)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Command and interaction"]
  node_command["SmoothBrush command"]
  node_input["Brush input and options<br/>[BaseBrush.cs]"]
end

subgraph group_sculpt["Sculpting engine"]
  node_engine["Mesh and SubD sculpting<br/>[SmoothBrush.cs]"]
end

subgraph group_host["Rhino document"]
  node_document[("Rhino document")]
  node_plugin["Rhino plug-in<br/>[MeshBrushTool.cs]"]
end

node_user(("Rhino user"))

node_user -->|"runs"| node_command
node_command -->|"selects geometry"| node_document
node_command -->|"creates and paints"| node_engine
node_command -->|"starts interaction"| node_input
node_input -->|"dispatches brush strokes"| node_engine
node_engine -->|"replaces geometry"| node_document
node_command -->|"commits final geometry"| node_document

click node_command "https://github.com/nachomonereo/meshbrushtool-rhino/blob/master/SmoothSubMeshCommand.cs"
click node_input "https://github.com/nachomonereo/meshbrushtool-rhino/blob/master/BaseBrush.cs"
click node_engine "https://github.com/nachomonereo/meshbrushtool-rhino/blob/master/SmoothBrush.cs"
click node_plugin "https://github.com/nachomonereo/meshbrushtool-rhino/blob/master/MeshBrushTool.cs"

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_command,node_input,node_user toneBlue
class node_engine toneAmber
class node_document,node_plugin toneMint
```

## Components

### Command and interaction

- [SmoothBrush command](https://github.com/nachomonereo/meshbrushtool-rhino/blob/master/SmoothSubMeshCommand.cs): `SmoothSubMeshCommand.cs`
- [Brush input and options](https://github.com/nachomonereo/meshbrushtool-rhino/blob/master/BaseBrush.cs): `BaseBrush.cs`

### Sculpting engine

- [Mesh and SubD sculpting](https://github.com/nachomonereo/meshbrushtool-rhino/blob/master/SmoothBrush.cs): `SmoothBrush.cs`

### Rhino document

- **Rhino document**
- [Rhino plug-in](https://github.com/nachomonereo/meshbrushtool-rhino/blob/master/MeshBrushTool.cs): `MeshBrushTool.cs`

### Other components

- **Rhino user**

## Connections

- Rhino user → SmoothBrush command: runs (evidence: `README.md`)
- SmoothBrush command → Rhino document: selects geometry (evidence: `SmoothSubMeshCommand.cs`)
- SmoothBrush command → Mesh and SubD sculpting: creates and paints (evidence: `SmoothSubMeshCommand.cs`)
- SmoothBrush command → Brush input and options: starts interaction (evidence: `SmoothSubMeshCommand.cs`)
- Brush input and options → Mesh and SubD sculpting: dispatches brush strokes (evidence: `BaseBrush.cs`)
- Mesh and SubD sculpting → Rhino document: replaces geometry (evidence: `SmoothBrush.cs`)
- SmoothBrush command → Rhino document: commits final geometry (evidence: `SmoothSubMeshCommand.cs`)
