# standardcyborg/standardcyborgcocoa architecture

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

- Interactive diagram: https://gitdiagram.com/standardcyborg/standardcyborgcocoa
- Repository: https://github.com/standardcyborg/standardcyborgcocoa

## Overview

This repository is an iOS TrueDepth 3D-scanning SDK, with a C++ geometry/reconstruction core, reusable scanning and preview UI, and demo/iteration apps. The main user flow is to start a scan, capture depth and color, reconstruct a point cloud, preview or mesh it, then save or share the result. The README documents these broad capabilities; sampled excerpts show portions of the scan and preview flow. Several implementation files are not in the supplied tree, so those subsystems use supported enclosing-directory paths and uncertain links are omitted.

Main entry points: [`StandardCyborgUI/StandardCyborgUI/Sources/ScanningViewController.swift`](https://github.com/standardcyborg/standardcyborgcocoa/blob/master/StandardCyborgUI/StandardCyborgUI/Sources/ScanningViewController.swift) (Scan controller), [`StandardCyborgFusion/Sources/StandardCyborgFusion`](https://github.com/standardcyborg/standardcyborgcocoa/tree/master/StandardCyborgFusion/Sources/StandardCyborgFusion) (Live reconstruction), [`StandardCyborgExample/StandardCyborgExample/ViewController.swift`](https://github.com/standardcyborg/standardcyborgcocoa/blob/master/StandardCyborgExample/StandardCyborgExample/ViewController.swift) (Example app), [`StandardCyborgUI/StandardCyborgUI/Sources/ScenePreviewViewController.swift`](https://github.com/standardcyborg/standardcyborgcocoa/blob/master/StandardCyborgUI/StandardCyborgUI/Sources/ScenePreviewViewController.swift) (Scene preview)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Capture and scanning"]
  node_scanner_ui["Scan controller"]
  node_camera_manager["Camera manager"]
  node_scan_renderer["Live scan renderer"]
  node_haptics["Scan feedback"]
end

subgraph group_fusion["Reconstruction and geometry"]
  node_reconstruction["Live reconstruction"]
  node_offline["Offline reconstruction"]
  node_fusion_api["Reconstruction API"]
  node_mesh_texturing["Meshing and texturing<br/>[MeshUvMap.cpp]"]
  node_geometry["3D geometry<br/>[Geometry.cpp]"]
  node_scene_graph["Scene graph<br/>[SceneGraph.cpp]"]
  node_poisson["Poisson reconstruction<br/>[FEMTree.h]"]
end

subgraph group_presentation["Preview and export"]
  node_preview["Scene preview"]
  node_preview_helper["Mesh preview helper"]
  node_scene_format["glTF handling<br/>[tiny_gltf.h]"]
end

subgraph group_apps["Apps and iteration"]
  node_example["Example app"]
  node_iterative_app["TrueDepth iteration app"]
  node_iterative_preview["Scan preview and sharing"]
end

node_user(("Scanner"))
node_camera["TrueDepth camera"]

node_user -->|"starts scan"| node_scanner_ui
node_scanner_ui -.->|"configures capture"| node_camera_manager
node_camera -.->|"supplies frames"| node_camera_manager
node_scanner_ui -->|"renders scan"| node_scan_renderer
node_scanner_ui -->|"signals state"| node_haptics
node_scanner_ui -.->|"drives capture"| node_reconstruction
node_reconstruction -.->|"implements"| node_fusion_api
node_offline -.->|"reconstructs offline"| node_reconstruction
node_reconstruction -.->|"produces geometry"| node_geometry
node_mesh_texturing -.->|"processes mesh"| node_geometry
node_poisson -.->|"supports reconstruction"| node_reconstruction
node_geometry -.->|"populates scene"| node_scene_graph
node_preview -->|"delegates meshing"| node_preview_helper
node_preview -.->|"displays scene"| node_scene_graph
node_example -->|"starts scanning"| node_scanner_ui
node_example -->|"presents result"| node_preview
node_example -.->|"saves scene"| node_scene_format
node_iterative_app -->|"opens preview"| node_iterative_preview

click node_scanner_ui "https://github.com/standardcyborg/standardcyborgcocoa/blob/master/StandardCyborgUI/StandardCyborgUI/Sources/ScanningViewController.swift"
click node_camera_manager "https://github.com/standardcyborg/standardcyborgcocoa/blob/master/StandardCyborgUI/StandardCyborgUI/Sources/CameraManager.swift"
click node_scan_renderer "https://github.com/standardcyborg/standardcyborgcocoa/blob/master/StandardCyborgUI/StandardCyborgUI/Sources/DefaultScanningViewRenderer.swift"
click node_haptics "https://github.com/standardcyborg/standardcyborgcocoa/blob/master/StandardCyborgUI/StandardCyborgUI/Sources/ScanningHapticFeedbackEngine.swift"
click node_reconstruction "https://github.com/standardcyborg/standardcyborgcocoa/tree/master/StandardCyborgFusion/Sources/StandardCyborgFusion"
click node_offline "https://github.com/standardcyborg/standardcyborgcocoa/blob/master/StandardCyborgFusion/Sources/include/StandardCyborgFusion/SCOfflineReconstructionManager.h"
click node_fusion_api "https://github.com/standardcyborg/standardcyborgcocoa/blob/master/StandardCyborgFusion/Sources/include/StandardCyborgFusion/SCReconstructionManager.h"
click node_mesh_texturing "https://github.com/standardcyborg/standardcyborgcocoa/blob/master/StandardCyborgFusion/Sources/StandardCyborgFusion/Algorithm/MeshUvMap.cpp"
click node_geometry "https://github.com/standardcyborg/standardcyborgcocoa/blob/master/scsdk/Sources/standard_cyborg/src/sc3d/Geometry.cpp"
click node_scene_graph "https://github.com/standardcyborg/standardcyborgcocoa/blob/master/scsdk/Sources/standard_cyborg/src/scene_graph/SceneGraph.cpp"
click node_poisson "https://github.com/standardcyborg/standardcyborgcocoa/blob/master/CppDependencies/PoissonRecon/Sources/include/PoissonRecon/FEMTree.h"
click node_preview "https://github.com/standardcyborg/standardcyborgcocoa/blob/master/StandardCyborgUI/StandardCyborgUI/Sources/ScenePreviewViewController.swift"
click node_preview_helper "https://github.com/standardcyborg/standardcyborgcocoa/blob/master/StandardCyborgUI/StandardCyborgUI/Sources/SCMeshingHelper.swift"
click node_scene_format "https://github.com/standardcyborg/standardcyborgcocoa/blob/master/CppDependencies/tinygltf/include/tiny_gltf.h"
click node_example "https://github.com/standardcyborg/standardcyborgcocoa/blob/master/StandardCyborgExample/StandardCyborgExample/ViewController.swift"
click node_iterative_app "https://github.com/standardcyborg/standardcyborgcocoa/blob/master/TrueDepthFusion/ScanningViewController.swift"
click node_iterative_preview "https://github.com/standardcyborg/standardcyborgcocoa/blob/master/TrueDepthFusion/ScanPreviewViewController.swift"

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_scanner_ui,node_camera_manager,node_scan_renderer,node_haptics toneBlue
class node_reconstruction,node_offline,node_fusion_api,node_mesh_texturing,node_geometry,node_scene_graph,node_poisson toneAmber
class node_preview,node_preview_helper,node_scene_format toneMint
class node_example,node_iterative_app,node_iterative_preview toneRose
class node_user,node_camera toneIndigo
```

## Components

### Capture and scanning

- [Scan controller](https://github.com/standardcyborg/standardcyborgcocoa/blob/master/StandardCyborgUI/StandardCyborgUI/Sources/ScanningViewController.swift): `StandardCyborgUI/StandardCyborgUI/Sources/ScanningViewController.swift`
- [Camera manager](https://github.com/standardcyborg/standardcyborgcocoa/blob/master/StandardCyborgUI/StandardCyborgUI/Sources/CameraManager.swift): `StandardCyborgUI/StandardCyborgUI/Sources/CameraManager.swift`
- [Live scan renderer](https://github.com/standardcyborg/standardcyborgcocoa/blob/master/StandardCyborgUI/StandardCyborgUI/Sources/DefaultScanningViewRenderer.swift): `StandardCyborgUI/StandardCyborgUI/Sources/DefaultScanningViewRenderer.swift`
- [Scan feedback](https://github.com/standardcyborg/standardcyborgcocoa/blob/master/StandardCyborgUI/StandardCyborgUI/Sources/ScanningHapticFeedbackEngine.swift): `StandardCyborgUI/StandardCyborgUI/Sources/ScanningHapticFeedbackEngine.swift`

### Reconstruction and geometry

- [Live reconstruction](https://github.com/standardcyborg/standardcyborgcocoa/tree/master/StandardCyborgFusion/Sources/StandardCyborgFusion): `StandardCyborgFusion/Sources/StandardCyborgFusion`
- [Offline reconstruction](https://github.com/standardcyborg/standardcyborgcocoa/blob/master/StandardCyborgFusion/Sources/include/StandardCyborgFusion/SCOfflineReconstructionManager.h): `StandardCyborgFusion/Sources/include/StandardCyborgFusion/SCOfflineReconstructionManager.h`
- [Reconstruction API](https://github.com/standardcyborg/standardcyborgcocoa/blob/master/StandardCyborgFusion/Sources/include/StandardCyborgFusion/SCReconstructionManager.h): `StandardCyborgFusion/Sources/include/StandardCyborgFusion/SCReconstructionManager.h`
- [Meshing and texturing](https://github.com/standardcyborg/standardcyborgcocoa/blob/master/StandardCyborgFusion/Sources/StandardCyborgFusion/Algorithm/MeshUvMap.cpp): `StandardCyborgFusion/Sources/StandardCyborgFusion/Algorithm/MeshUvMap.cpp`
- [3D geometry](https://github.com/standardcyborg/standardcyborgcocoa/blob/master/scsdk/Sources/standard_cyborg/src/sc3d/Geometry.cpp): `scsdk/Sources/standard_cyborg/src/sc3d/Geometry.cpp`
- [Scene graph](https://github.com/standardcyborg/standardcyborgcocoa/blob/master/scsdk/Sources/standard_cyborg/src/scene_graph/SceneGraph.cpp): `scsdk/Sources/standard_cyborg/src/scene_graph/SceneGraph.cpp`
- [Poisson reconstruction](https://github.com/standardcyborg/standardcyborgcocoa/blob/master/CppDependencies/PoissonRecon/Sources/include/PoissonRecon/FEMTree.h): `CppDependencies/PoissonRecon/Sources/include/PoissonRecon/FEMTree.h`

### Preview and export

- [Scene preview](https://github.com/standardcyborg/standardcyborgcocoa/blob/master/StandardCyborgUI/StandardCyborgUI/Sources/ScenePreviewViewController.swift): `StandardCyborgUI/StandardCyborgUI/Sources/ScenePreviewViewController.swift`
- [Mesh preview helper](https://github.com/standardcyborg/standardcyborgcocoa/blob/master/StandardCyborgUI/StandardCyborgUI/Sources/SCMeshingHelper.swift): `StandardCyborgUI/StandardCyborgUI/Sources/SCMeshingHelper.swift`
- [glTF handling](https://github.com/standardcyborg/standardcyborgcocoa/blob/master/CppDependencies/tinygltf/include/tiny_gltf.h): `CppDependencies/tinygltf/include/tiny_gltf.h`

### Apps and iteration

- [Example app](https://github.com/standardcyborg/standardcyborgcocoa/blob/master/StandardCyborgExample/StandardCyborgExample/ViewController.swift): `StandardCyborgExample/StandardCyborgExample/ViewController.swift`
- [TrueDepth iteration app](https://github.com/standardcyborg/standardcyborgcocoa/blob/master/TrueDepthFusion/ScanningViewController.swift): `TrueDepthFusion/ScanningViewController.swift`
- [Scan preview and sharing](https://github.com/standardcyborg/standardcyborgcocoa/blob/master/TrueDepthFusion/ScanPreviewViewController.swift): `TrueDepthFusion/ScanPreviewViewController.swift`

### Other components

- **Scanner**
- **TrueDepth camera**

## Connections

- Scanner → Scan controller: starts scan
- Scan controller → Camera manager: configures capture
- TrueDepth camera → Camera manager: supplies frames
- Scan controller → Live scan renderer: renders scan (evidence: `StandardCyborgUI/StandardCyborgUI/Sources/DefaultScanningViewRenderer.swift`)
- Scan controller → Scan feedback: signals state (evidence: `StandardCyborgUI/StandardCyborgUI/Sources/ScanningViewController.swift`)
- Scan controller → Live reconstruction: drives capture
- Live reconstruction → Reconstruction API: implements
- Offline reconstruction → Live reconstruction: reconstructs offline
- Live reconstruction → 3D geometry: produces geometry
- Meshing and texturing → 3D geometry: processes mesh
- Poisson reconstruction → Live reconstruction: supports reconstruction
- 3D geometry → Scene graph: populates scene
- Scene preview → Mesh preview helper: delegates meshing (evidence: `StandardCyborgUI/StandardCyborgUI/Sources/ScenePreviewViewController.swift`)
- Scene preview → Scene graph: displays scene
- Example app → Scan controller: starts scanning (evidence: `StandardCyborgExample/StandardCyborgExample/ViewController.swift`)
- Example app → Scene preview: presents result (evidence: `StandardCyborgExample/StandardCyborgExample/ViewController.swift`)
- Example app → glTF handling: saves scene
- TrueDepth iteration app → Scan preview and sharing: opens preview (evidence: `TrueDepthFusion/ScanningViewController.swift`)
