# alicevision/meshroom architecture

> Architecture diagram of the GitHub repository alicevision/meshroom, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/alicevision/meshroom
- Repository: https://github.com/alicevision/meshroom

## Overview

##### Main components
- User Interface (UI):
- Located under meshroom/ui and its subdirectories (qml, components, graph editor, Viewer, etc.). This is where the end-user interacts with the software.
- Core Processing Engine:
- Found under meshroom/core (including modules for graph management, task management, node handling, and computation). It orchestrates the 3D reconstruction pipeline.
- Pipeline and Nodes Framework:
- Trees in meshroom/nodes and the related descriptor files under meshroom/core/desc. This represents the modular node-based processing pipeline where each node performs a specific photogrammetry or processing task.
- External Integration:
- Integration with the AliceVision library (as required in the README and launch instructions), which provides the photogrammetry computer vision functionality.
- Command-Line Tools:
- Utilities and batch executables in the bin/ directory (such as meshroom_batch, meshroom_compute, etc.) for non-interactive 3D reconstruction and advanced automation.
- Submitters and Distributed Processing:
- Modules under meshroom/submitters are used for task submission (e.g., to a simple farm or cluster environment).
- Supporting Infrastructure:
- Build and dependency files (e.g., CMakeLists.txt, setup.py, docker/) along with configuration files for CI, documentation (docs/), and testing (tests/) indicate supporting components for development, deployment, and quality assurance.

##### Relationships and Interactions
- “Pipeline/Nodes Framework” as a modular layer plugged into the Core Engine. Here, each node (described by meshroom/core/desc and actual code in meshroom/nodes) is a distinct component that can be extended by custom nodes.
- Incorporate a “Command-Line Interface” block that interacts directly with the core engine (through scripts in bin/) to execute batch jobs or debug tasks.
- Optionally, include the “Submitters Module” which mediates between the basic node execution and distributed computing resources, especially for scaling compute-intensive tasks.

##### Architectural Patterns and Principles
- Modularity & Extensibility: Clearly show the separation between UI, core, and node modules. Indicate extensibility points for custom pipelines and custom nodes.
- MVC/MVVM: Although not strictly enforced, the separation of UI (view, via QML), business logic (core engine), and data (graph and pipeline nodes) is evident. Note the delegation of responsibilities.
- Plugin Architecture: Emphasize how new functionalities (custom nodes) can be added by simply placing them under the correct module and setting the appropriate environment variable.
- Containerization & CI/CD: Represent the Docker configurations and GitHub workflows as part of the project's build, test, and deployment infrastructure.

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "User Interface Layer"
        UI["User Interface (QML, Components, Graph Editor, Viewer)"]:::ui
    end

    subgraph "Core Processing Engine"
        CE["Core Engine (Graph Management, Task Manager, Node Handler)"]:::core
    end

    subgraph "Pipeline/Nodes Framework"
        NN["Nodes Implementation (Photogrammetry Tasks)"]:::pipeline
        ND["Node Descriptors"]:::pipeline
    end

    subgraph "External Services"
        EX["External Library (AliceVision)"]:::external
    end

    subgraph "Command-Line Interface"
        CLI["CLI Tools (meshroom_batch, meshroom_compute)"]:::cli
    end

    subgraph "Distributed Processing"
        SUB["Submitters Module (Task Submission)"]:::submitters
    end

    subgraph "Supporting Infrastructure"
        INF1["CI/CD & Build Configurations"]:::infra
        INF2["Containerization (Docker)"]:::infra
        INF3["Documentation"]:::infra
        INF4["Testing"]:::infra
    end

    UI -->|"triggers"| CE
    CLI -->|"executes"| CE
    CE -->|"manages"| NN
    CE -->|"manages"| ND
    CE -->|"calls"| EX
    SUB -->|"submitsTasksTo"| CE
    INF1 -->|"supports"| CE
    INF2 -->|"supports"| CE
    INF3 -->|"supports"| CE
    INF4 -->|"supports"| CE

    classDef ui fill:#f9d5e5,stroke:#c94c4c,stroke-width:2px;
    classDef core fill:#d5e8d4,stroke:#82b366,stroke-width:2px;
    classDef pipeline fill:#dae8fc,stroke:#6c8ebf,stroke-width:2px;
    classDef external fill:#fff2cc,stroke:#d6b656,stroke-width:2px;
    classDef cli fill:#fce5cd,stroke:#e69138,stroke-width:2px;
    classDef submitters fill:#ead1dc,stroke:#b854a1,stroke-width:2px;
    classDef infra fill:#d5d5d5,stroke:#8a8a8a,stroke-width:2px;

    click UI "https://github.com/alicevision/meshroom/tree/develop/meshroom/ui"
    click CE "https://github.com/alicevision/meshroom/tree/develop/meshroom/core"
    click NN "https://github.com/alicevision/meshroom/tree/develop/meshroom/nodes"
    click ND "https://github.com/alicevision/meshroom/tree/develop/meshroom/core/desc"
    click CLI "https://github.com/alicevision/meshroom/tree/develop/bin/"
    click SUB "https://github.com/alicevision/meshroom/tree/develop/meshroom/submitters"
    click INF1 "https://github.com/alicevision/meshroom/tree/develop/.github/"
    click INF2 "https://github.com/alicevision/meshroom/tree/develop/docker/"
    click INF3 "https://github.com/alicevision/meshroom/tree/develop/docs/"
    click INF4 "https://github.com/alicevision/meshroom/tree/develop/tests/"
```
