# aihdproduction/samcloud architecture

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

- Interactive diagram: https://gitdiagram.com/aihdproduction/samcloud
- Repository: https://github.com/aihdproduction/samcloud

## Overview

SAMcloud is a local photogrammetry and building-modeling application. Users create a project from drone, camera, or 360 imagery; reconstruct and optionally scale or georeference it; classify and refine the resulting point cloud; then review and export LAS, DXF, and indoor IFC outputs, with optional web sharing. The graph follows README-documented workflow stages and preserves major export and review capabilities. Some subsystem relationships are documented rather than verified from source excerpts; those edges cite the README, and unsampled internals are not expanded.

Main entry points: [`samcloud/dxf/pipeline.py`](https://github.com/aihdproduction/samcloud/blob/main/samcloud/dxf/pipeline.py) (DXF generation), [`samcloud/engine/pipeline.py`](https://github.com/aihdproduction/samcloud/blob/main/samcloud/engine/pipeline.py) (COLMAP pipeline), [`samcloud/app/application.py`](https://github.com/aihdproduction/samcloud/blob/main/samcloud/app/application.py) (Guided interface), [`samcloud/core/project_manager.py`](https://github.com/aihdproduction/samcloud/blob/main/samcloud/core/project_manager.py) (Project management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Capture and projects"]
  node_entry["Application entry<br/>[main.py]"]
  node_ui["Guided interface<br/>[application.py]"]
  node_project["Project management<br/>[project_manager.py]"]
  node_project_paths["Workspace paths<br/>[paths.py]"]
  node_panorama["Panorama preparation<br/>[panorama.py]"]
  node_video["Video preparation<br/>[video.py]"]
  node_storage["Project storage<br/>[storage.py]"]
  node_i18n["Interface languages<br/>[i18n.py]"]
  node_global_config["Configuration loader<br/>[configuration.py]"]
end

subgraph group_reconstruction["Reconstruction and classification"]
  node_reconstruction["COLMAP pipeline<br/>[pipeline.py]"]
  node_classification["Semantic classification<br/>[service.py]"]
  node_class_profiles["Class profiles<br/>[profiles.py]"]
  node_refinement["Geometric refinement<br/>[refine.py]"]
  node_drone_contracts["Drone data contracts<br/>[contracts.py]"]
end

subgraph group_review["Review and control"]
  node_scale["Scale and control points<br/>[repository.py]"]
  node_viewer["Cloud review<br/>[preview.py]"]
  node_dxf_ui["DXF review controls<br/>[dxf_controller.py]"]
end

subgraph group_plans["Plans and building models"]
  node_dxf_pipeline["DXF generation<br/>[pipeline.py]"]
  node_las_source["Classified cloud input<br/>[las_source.py]"]
  node_ortho["Orthophoto clean plans<br/>[plan.py]"]
  node_symbols["Plan symbols<br/>[symbols.py]"]
  node_building_plan["Shared building plan<br/>[plan_model.py]"]
  node_dxf_config["DXF settings<br/>[config.py]"]
  node_dxf_cancel["DXF progress control<br/>[cancel.py]"]
  node_dxf_layers["DXF layer mapping<br/>[layers.py]"]
  node_dxf_result["DXF result cache<br/>[result.py]"]
end

subgraph group_delivery["Export and sharing"]
  node_ifc["IFC building export<br/>[export.py]"]
  node_las_export["LAS export<br/>[export_las.py]"]
  node_share["Web sharing<br/>[ui.py]"]
  node_cloudflare["Cloudflare R2<br/>[cloudflare_r2.py]"]
end

node_user(("Project user"))

node_user -->|"starts workflow"| node_ui
node_entry -->|"launches"| node_ui
node_ui -->|"creates project"| node_project
node_project -->|"uses workspace"| node_project_paths
node_project -->|"prepares capture"| node_panorama
node_panorama -->|"uses video frames"| node_video
node_user -->|"submits imagery"| node_reconstruction
node_reconstruction -->|"applies tag scale or GCP"| node_scale
node_reconstruction -->|"classifies cloud"| node_classification
node_classification -->|"uses class profile"| node_class_profiles
node_classification -->|"refines classes"| node_refinement
node_reconstruction -->|"stores project outputs"| node_storage
node_user -->|"reviews cloud"| node_viewer
node_ui -->|"opens plan review"| node_dxf_ui
node_dxf_ui -->|"requests plan"| node_dxf_pipeline
node_dxf_pipeline -->|"reads classified cloud"| node_las_source
node_dxf_pipeline -->|"loads settings"| node_dxf_config
node_dxf_pipeline -->|"maps layers"| node_dxf_layers
node_dxf_pipeline -->|"checks progress"| node_dxf_cancel
node_dxf_pipeline -->|"produces results"| node_dxf_result
node_las_source -->|"feeds clean plan"| node_ortho
node_ortho -->|"uses plan symbols"| node_symbols
node_ortho -->|"persists building model"| node_building_plan
node_building_plan -->|"exports indoor model"| node_ifc
node_user -->|"starts LAS export"| node_las_export
node_user -->|"publishes project"| node_share
node_share -->|"uploads to bucket"| node_cloudflare
node_ui -->|"uses translations"| node_i18n
node_project -->|"loads defaults"| node_global_config
node_reconstruction -->|"uses drone data"| node_drone_contracts

click node_entry "https://github.com/aihdproduction/samcloud/blob/main/main.py"
click node_ui "https://github.com/aihdproduction/samcloud/blob/main/samcloud/app/application.py"
click node_project "https://github.com/aihdproduction/samcloud/blob/main/samcloud/core/project_manager.py"
click node_project_paths "https://github.com/aihdproduction/samcloud/blob/main/samcloud/core/paths.py"
click node_panorama "https://github.com/aihdproduction/samcloud/blob/main/samcloud/acquisition/panorama.py"
click node_video "https://github.com/aihdproduction/samcloud/blob/main/samcloud/acquisition/video.py"
click node_reconstruction "https://github.com/aihdproduction/samcloud/blob/main/samcloud/engine/pipeline.py"
click node_scale "https://github.com/aihdproduction/samcloud/blob/main/samcloud/control_points/repository.py"
click node_classification "https://github.com/aihdproduction/samcloud/blob/main/samcloud/classification/service.py"
click node_class_profiles "https://github.com/aihdproduction/samcloud/blob/main/samcloud/classification/profiles.py"
click node_refinement "https://github.com/aihdproduction/samcloud/blob/main/samcloud/engine/geometry/refine.py"
click node_storage "https://github.com/aihdproduction/samcloud/blob/main/samcloud/core/storage.py"
click node_viewer "https://github.com/aihdproduction/samcloud/blob/main/samcloud/viewer/preview.py"
click node_dxf_ui "https://github.com/aihdproduction/samcloud/blob/main/samcloud/app/dxf_controller.py"
click node_dxf_pipeline "https://github.com/aihdproduction/samcloud/blob/main/samcloud/dxf/pipeline.py"
click node_las_source "https://github.com/aihdproduction/samcloud/blob/main/samcloud/dxf/las_source.py"
click node_ortho "https://github.com/aihdproduction/samcloud/blob/main/samcloud/ortho/plan.py"
click node_symbols "https://github.com/aihdproduction/samcloud/blob/main/samcloud/ortho/vector/symbols.py"
click node_building_plan "https://github.com/aihdproduction/samcloud/blob/main/samcloud/bim/plan_model.py"
click node_ifc "https://github.com/aihdproduction/samcloud/blob/main/samcloud/bim/export.py"
click node_las_export "https://github.com/aihdproduction/samcloud/blob/main/samcloud/engine/export_las.py"
click node_share "https://github.com/aihdproduction/samcloud/blob/main/samcloud/share/ui.py"
click node_cloudflare "https://github.com/aihdproduction/samcloud/blob/main/samcloud/share/providers/cloudflare_r2.py"
click node_i18n "https://github.com/aihdproduction/samcloud/blob/main/samcloud/app/i18n.py"
click node_drone_contracts "https://github.com/aihdproduction/samcloud/blob/main/samcloud/drone/contracts.py"
click node_dxf_config "https://github.com/aihdproduction/samcloud/blob/main/samcloud/dxf/config.py"
click node_dxf_cancel "https://github.com/aihdproduction/samcloud/blob/main/samcloud/dxf/cancel.py"
click node_dxf_layers "https://github.com/aihdproduction/samcloud/blob/main/samcloud/dxf/layers.py"
click node_dxf_result "https://github.com/aihdproduction/samcloud/blob/main/samcloud/dxf/result.py"
click node_global_config "https://github.com/aihdproduction/samcloud/blob/main/samcloud/core/configuration.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_entry,node_ui,node_project,node_project_paths,node_panorama,node_video,node_storage,node_i18n,node_global_config,node_user toneBlue
class node_reconstruction,node_classification,node_class_profiles,node_refinement,node_drone_contracts toneAmber
class node_scale,node_viewer,node_dxf_ui toneMint
class node_dxf_pipeline,node_las_source,node_ortho,node_symbols,node_building_plan,node_dxf_config,node_dxf_cancel,node_dxf_layers,node_dxf_result toneRose
class node_ifc,node_las_export,node_share,node_cloudflare toneIndigo
```

## Components

### Capture and projects

- [Application entry](https://github.com/aihdproduction/samcloud/blob/main/main.py): `main.py`
- [Guided interface](https://github.com/aihdproduction/samcloud/blob/main/samcloud/app/application.py): `samcloud/app/application.py`
- [Project management](https://github.com/aihdproduction/samcloud/blob/main/samcloud/core/project_manager.py): `samcloud/core/project_manager.py`
- [Workspace paths](https://github.com/aihdproduction/samcloud/blob/main/samcloud/core/paths.py): `samcloud/core/paths.py`
- [Panorama preparation](https://github.com/aihdproduction/samcloud/blob/main/samcloud/acquisition/panorama.py): `samcloud/acquisition/panorama.py`
- [Video preparation](https://github.com/aihdproduction/samcloud/blob/main/samcloud/acquisition/video.py): `samcloud/acquisition/video.py`
- [Project storage](https://github.com/aihdproduction/samcloud/blob/main/samcloud/core/storage.py): `samcloud/core/storage.py`
- [Interface languages](https://github.com/aihdproduction/samcloud/blob/main/samcloud/app/i18n.py): `samcloud/app/i18n.py`
- [Configuration loader](https://github.com/aihdproduction/samcloud/blob/main/samcloud/core/configuration.py): `samcloud/core/configuration.py`

### Reconstruction and classification

- [COLMAP pipeline](https://github.com/aihdproduction/samcloud/blob/main/samcloud/engine/pipeline.py): `samcloud/engine/pipeline.py`
- [Semantic classification](https://github.com/aihdproduction/samcloud/blob/main/samcloud/classification/service.py): `samcloud/classification/service.py`
- [Class profiles](https://github.com/aihdproduction/samcloud/blob/main/samcloud/classification/profiles.py): `samcloud/classification/profiles.py`
- [Geometric refinement](https://github.com/aihdproduction/samcloud/blob/main/samcloud/engine/geometry/refine.py): `samcloud/engine/geometry/refine.py`
- [Drone data contracts](https://github.com/aihdproduction/samcloud/blob/main/samcloud/drone/contracts.py): `samcloud/drone/contracts.py`

### Review and control

- [Scale and control points](https://github.com/aihdproduction/samcloud/blob/main/samcloud/control_points/repository.py): `samcloud/control_points/repository.py`
- [Cloud review](https://github.com/aihdproduction/samcloud/blob/main/samcloud/viewer/preview.py): `samcloud/viewer/preview.py`
- [DXF review controls](https://github.com/aihdproduction/samcloud/blob/main/samcloud/app/dxf_controller.py): `samcloud/app/dxf_controller.py`

### Plans and building models

- [DXF generation](https://github.com/aihdproduction/samcloud/blob/main/samcloud/dxf/pipeline.py): `samcloud/dxf/pipeline.py`
- [Classified cloud input](https://github.com/aihdproduction/samcloud/blob/main/samcloud/dxf/las_source.py): `samcloud/dxf/las_source.py`
- [Orthophoto clean plans](https://github.com/aihdproduction/samcloud/blob/main/samcloud/ortho/plan.py): `samcloud/ortho/plan.py`
- [Plan symbols](https://github.com/aihdproduction/samcloud/blob/main/samcloud/ortho/vector/symbols.py): `samcloud/ortho/vector/symbols.py`
- [Shared building plan](https://github.com/aihdproduction/samcloud/blob/main/samcloud/bim/plan_model.py): `samcloud/bim/plan_model.py`
- [DXF settings](https://github.com/aihdproduction/samcloud/blob/main/samcloud/dxf/config.py): `samcloud/dxf/config.py`
- [DXF progress control](https://github.com/aihdproduction/samcloud/blob/main/samcloud/dxf/cancel.py): `samcloud/dxf/cancel.py`
- [DXF layer mapping](https://github.com/aihdproduction/samcloud/blob/main/samcloud/dxf/layers.py): `samcloud/dxf/layers.py`
- [DXF result cache](https://github.com/aihdproduction/samcloud/blob/main/samcloud/dxf/result.py): `samcloud/dxf/result.py`

### Export and sharing

- [IFC building export](https://github.com/aihdproduction/samcloud/blob/main/samcloud/bim/export.py): `samcloud/bim/export.py`
- [LAS export](https://github.com/aihdproduction/samcloud/blob/main/samcloud/engine/export_las.py): `samcloud/engine/export_las.py`
- [Web sharing](https://github.com/aihdproduction/samcloud/blob/main/samcloud/share/ui.py): `samcloud/share/ui.py`
- [Cloudflare R2](https://github.com/aihdproduction/samcloud/blob/main/samcloud/share/providers/cloudflare_r2.py): `samcloud/share/providers/cloudflare_r2.py`

### Other components

- **Project user**

## Connections

- Project user → Guided interface: starts workflow
- Application entry → Guided interface: launches (evidence: `main.py`)
- Guided interface → Project management: creates project
- Project management → Workspace paths: uses workspace (evidence: `samcloud/core/project_manager.py`)
- Project management → Panorama preparation: prepares capture
- Panorama preparation → Video preparation: uses video frames (evidence: `samcloud/acquisition/panorama.py`)
- Project user → COLMAP pipeline: submits imagery
- COLMAP pipeline → Scale and control points: applies tag scale or GCP (evidence: `samcloud/engine/pipeline.py`)
- COLMAP pipeline → Semantic classification: classifies cloud
- Semantic classification → Class profiles: uses class profile (evidence: `samcloud/classification/service.py`)
- Semantic classification → Geometric refinement: refines classes
- COLMAP pipeline → Project storage: stores project outputs (evidence: `samcloud/engine/pipeline.py`)
- Project user → Cloud review: reviews cloud
- Guided interface → DXF review controls: opens plan review (evidence: `samcloud/app/application.py`)
- DXF review controls → DXF generation: requests plan (evidence: `samcloud/app/dxf_controller.py`)
- DXF generation → Classified cloud input: reads classified cloud (evidence: `samcloud/dxf/pipeline.py`)
- DXF generation → DXF settings: loads settings (evidence: `samcloud/dxf/pipeline.py`)
- DXF generation → DXF layer mapping: maps layers (evidence: `samcloud/dxf/pipeline.py`)
- DXF generation → DXF progress control: checks progress (evidence: `samcloud/dxf/pipeline.py`)
- DXF generation → DXF result cache: produces results (evidence: `samcloud/dxf/pipeline.py`)
- Classified cloud input → Orthophoto clean plans: feeds clean plan (evidence: `samcloud/ortho/plan.py`)
- Orthophoto clean plans → Plan symbols: uses plan symbols (evidence: `samcloud/ortho/plan.py`)
- Orthophoto clean plans → Shared building plan: persists building model (evidence: `samcloud/bim/plan_model.py`)
- Shared building plan → IFC building export: exports indoor model
- Project user → LAS export: starts LAS export
- Project user → Web sharing: publishes project
- Web sharing → Cloudflare R2: uploads to bucket (evidence: `samcloud/share/ui.py`)
- Guided interface → Interface languages: uses translations (evidence: `samcloud/app/application.py`)
- Project management → Configuration loader: loads defaults (evidence: `samcloud/core/project_manager.py`)
- COLMAP pipeline → Drone data contracts: uses drone data (evidence: `samcloud/engine/pipeline.py`)
