# cloudcompare/cloudcompy architecture

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

- Interactive diagram: https://gitdiagram.com/cloudcompare/cloudcompy
- Repository: https://github.com/cloudcompare/cloudcompy

## Overview

CloudComPy is a Python interface to CloudCompare. Its main workflow is to initialize the module, load a point cloud, compute or filter data, work with coordinates and scalar fields through NumPy, then save the result. The tree also exposes geometry, registration, sampling, plugin algorithms, and a lightweight viewer. Edges follow the README’s workflow or explicit source-index imports; plugin and viewer interactions not established by the excerpts are omitted.

Main entry points: [`pybind11/cloudComPy.cpp`](https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/cloudComPy.cpp) (CloudComPy API), [`pybind11/ccPointCloudPy.cpp`](https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/ccPointCloudPy.cpp) (Point Clouds), [`pybind11/conversions.hpp`](https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/conversions.hpp) (Data Conversion), [`pyAPI/initCC.h`](https://github.com/cloudcompare/cloudcompy/blob/master/pyAPI/initCC.h) (CloudCompare Init)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Python and Core API"]
  node_module["CloudComPy API<br/>[cloudComPy.cpp]"]
  node_init["CloudCompare Init<br/>[initCC.h]"]
  node_runtime["Native Operations<br/>[pyCC.cpp]"]
  node_conversion["Data Conversion<br/>[conversions.hpp]"]
  node_io["Cloud File I/O<br/>[pyCC.h]"]
end

subgraph group_data["Cloud Data"]
  node_pointcloud["Point Clouds<br/>[ccPointCloudPy.cpp]"]
  node_scalar["Scalar Fields<br/>[ScalarFieldPy.cpp]"]
  node_mesh["Meshes<br/>[ccMeshPy.cpp]"]
  node_geometry["Geometry Objects<br/>[ccPrimitivesPy.cpp]"]
end

subgraph group_analysis["Analysis Tools"]
  node_sampling["Cloud Sampling"]
  node_distance["Distance Analysis"]
  node_geometric["Geometric Analysis"]
  node_registration["Registration"]
end

subgraph group_extensions["Plugins and Viewer"]
  node_pcl["PCL Algorithms<br/>[PCL_DocStrings.hpp]"]
  node_poisson["Poisson Reconstruction<br/>[PoissonReconPy.cpp]"]
  node_ransac["RANSAC Shapes<br/>[RANSAC_SDPy.cpp]"]
  node_canupo["CANUPO Classification<br/>[CanupoPy.cpp]"]
  node_sra["SRA Mapping<br/>[SRAPy.cpp]"]
  node_viewer["Light Viewer<br/>[viewerPy.cpp]"]
end

node_python(("Python User"))

node_python -->|"imports"| node_module
node_python -->|"initializes"| node_init
node_python -->|"loads and saves"| node_io
node_python -->|"uses"| node_pointcloud
node_python -->|"uses"| node_scalar
node_python -->|"calls"| node_sampling
node_module -->|"exposes"| node_runtime
node_module -->|"includes"| node_conversion
node_pointcloud -->|"converts arrays"| node_conversion
node_python -.->|"uses"| node_mesh
node_python -.->|"uses"| node_geometry
node_python -.->|"calls"| node_distance
node_python -.->|"calls"| node_geometric
node_python -.->|"calls"| node_registration
node_python -.->|"uses optionally"| node_pcl
node_python -.->|"calls optionally"| node_poisson
node_python -.->|"calls optionally"| node_ransac
node_python -.->|"calls optionally"| node_canupo
node_python -.->|"calls optionally"| node_sra
node_python -.->|"uses optionally"| node_viewer

click node_module "https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/cloudComPy.cpp"
click node_init "https://github.com/cloudcompare/cloudcompy/blob/master/pyAPI/initCC.h"
click node_runtime "https://github.com/cloudcompare/cloudcompy/blob/master/pyAPI/pyCC.cpp"
click node_conversion "https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/conversions.hpp"
click node_io "https://github.com/cloudcompare/cloudcompy/blob/master/pyAPI/pyCC.h"
click node_pointcloud "https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/ccPointCloudPy.cpp"
click node_scalar "https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/ScalarFieldPy.cpp"
click node_mesh "https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/ccMeshPy.cpp"
click node_geometry "https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/ccPrimitivesPy.cpp"
click node_sampling "https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/cloudSamplingToolsPy.cpp"
click node_distance "https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/distanceComputationToolsPy.cpp"
click node_geometric "https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/geometricalAnalysisToolsPy.cpp"
click node_registration "https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/registrationToolsPy.cpp"
click node_pcl "https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/PCL/PCL_DocStrings.hpp"
click node_poisson "https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/PoissonRecon/PoissonReconPy.cpp"
click node_ransac "https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/RANSAC_SD/RANSAC_SDPy.cpp"
click node_canupo "https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/Canupo/CanupoPy.cpp"
click node_sra "https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/SRA/SRAPy.cpp"
click node_viewer "https://github.com/cloudcompare/cloudcompy/blob/master/viewer/viewerPy.cpp"

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_module,node_init,node_runtime,node_conversion,node_io,node_python toneBlue
class node_pointcloud,node_scalar,node_mesh,node_geometry toneAmber
class node_sampling,node_distance,node_geometric,node_registration toneMint
class node_pcl,node_poisson,node_ransac,node_canupo,node_sra,node_viewer toneRose
```

## Components

### Python and Core API

- [CloudComPy API](https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/cloudComPy.cpp): `pybind11/cloudComPy.cpp`
- [CloudCompare Init](https://github.com/cloudcompare/cloudcompy/blob/master/pyAPI/initCC.h): `pyAPI/initCC.h`
- [Native Operations](https://github.com/cloudcompare/cloudcompy/blob/master/pyAPI/pyCC.cpp): `pyAPI/pyCC.cpp`
- [Data Conversion](https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/conversions.hpp): `pybind11/conversions.hpp`
- [Cloud File I/O](https://github.com/cloudcompare/cloudcompy/blob/master/pyAPI/pyCC.h): `pyAPI/pyCC.h`

### Cloud Data

- [Point Clouds](https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/ccPointCloudPy.cpp): `pybind11/ccPointCloudPy.cpp`
- [Scalar Fields](https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/ScalarFieldPy.cpp): `pybind11/ScalarFieldPy.cpp`
- [Meshes](https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/ccMeshPy.cpp): `pybind11/ccMeshPy.cpp`
- [Geometry Objects](https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/ccPrimitivesPy.cpp): `pybind11/ccPrimitivesPy.cpp`

### Analysis Tools

- [Cloud Sampling](https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/cloudSamplingToolsPy.cpp): `pybind11/cloudSamplingToolsPy.cpp`
- [Distance Analysis](https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/distanceComputationToolsPy.cpp): `pybind11/distanceComputationToolsPy.cpp`
- [Geometric Analysis](https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/geometricalAnalysisToolsPy.cpp): `pybind11/geometricalAnalysisToolsPy.cpp`
- [Registration](https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/registrationToolsPy.cpp): `pybind11/registrationToolsPy.cpp`

### Plugins and Viewer

- [PCL Algorithms](https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/PCL/PCL_DocStrings.hpp): `pybind11/PCL/PCL_DocStrings.hpp`
- [Poisson Reconstruction](https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/PoissonRecon/PoissonReconPy.cpp): `pybind11/PoissonRecon/PoissonReconPy.cpp`
- [RANSAC Shapes](https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/RANSAC_SD/RANSAC_SDPy.cpp): `pybind11/RANSAC_SD/RANSAC_SDPy.cpp`
- [CANUPO Classification](https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/Canupo/CanupoPy.cpp): `pybind11/Canupo/CanupoPy.cpp`
- [SRA Mapping](https://github.com/cloudcompare/cloudcompy/blob/master/pybind11/SRA/SRAPy.cpp): `pybind11/SRA/SRAPy.cpp`
- [Light Viewer](https://github.com/cloudcompare/cloudcompy/blob/master/viewer/viewerPy.cpp): `viewer/viewerPy.cpp`

### Other components

- **Python User**

## Connections

- Python User → CloudComPy API: imports
- Python User → CloudCompare Init: initializes
- Python User → Cloud File I/O: loads and saves
- Python User → Point Clouds: uses
- Python User → Scalar Fields: uses
- Python User → Cloud Sampling: calls
- CloudComPy API → Native Operations: exposes (evidence: `pybind11/cloudComPy.cpp`)
- CloudComPy API → Data Conversion: includes
- Point Clouds → Data Conversion: converts arrays (evidence: `pybind11/ccPointCloudPy.cpp`)
- Python User → Meshes: uses
- Python User → Geometry Objects: uses
- Python User → Distance Analysis: calls
- Python User → Geometric Analysis: calls
- Python User → Registration: calls
- Python User → PCL Algorithms: uses optionally
- Python User → Poisson Reconstruction: calls optionally
- Python User → RANSAC Shapes: calls optionally
- Python User → CANUPO Classification: calls optionally
- Python User → SRA Mapping: calls optionally
- Python User → Light Viewer: uses optionally
