# Editing Point Cloud Data

## 1. Overview

This document describes how to edit, clean up, and merge `.e57` point cloud files using **CloudCompare** — an open-source 3D point cloud and mesh processing tool. It covers the GUI workflow on macOS, Windows, and Ubuntu, and the headless command-line workflow useful for automation and CI pipelines.

The workflow is relevant whenever a captured scan needs to be trimmed (e.g. removing irrelevant scan stations, the operator, or environmental noise), or when multiple partial scans need to be combined into a single deliverable `.e57` for downstream consumers (Unity, Unreal, mapping back-ends, VPS pipelines, etc.).

### 1.1 What is .e57?

E57 is an open, vendor-neutral file format (ASTM E2807) for storing 3D imaging data — point clouds, images, and metadata produced by laser scanners and other 3D imaging systems. A single `.e57` typically contains multiple scans ("scan stations") stored as separate child clouds inside one container file.

### 1.2 Prerequisites

* A Mac, Windows, or Ubuntu workstation with at least 8 GB RAM (16 GB+ recommended for large scans).
* CloudCompare v2.13 or newer. Screenshots in this document are from v2.14.beta on macOS.
* One or more `.e57` files to work with.
* For the CLI section: terminal access and the CloudCompare binary on PATH (or its full install path).

***

## 2. Installing CloudCompare

Download the latest stable release for your operating system from the official site: <https://www.cloudcompare.org/release/>

### Platform-specific notes

* **macOS:** Download the `.dmg`, drag CloudCompare into `/Applications`. On first launch, right-click → Open to bypass Gatekeeper if the build is unsigned.
* **Windows:** Use the `.exe` installer. The installer adds CloudCompare to the Start menu and (optionally) the system PATH — enable the PATH option if you plan to use the CLI.
* **Ubuntu / Linux:** Install via Snap (`sudo snap install cloudcompare`) or build from source from the GitHub repository for the latest features.

***

## 3. Editing an .e57 in the GUI

The GUI flow is the simplest way to inspect, trim, and re-export a point cloud. The high-level steps are: open the file → inspect the DB Tree → delete or hide unwanted child clouds → save the parent back out as `.e57`.

### Step 1 — Launch CloudCompare

1. Open the CloudCompare application from the OS launcher.
2. You will see the empty workspace shown below — the **DB Tree** (top-left), **Properties** panel (bottom-left), the **3D View**, and the **Console** at the bottom.

<figure><img src="/files/LQjfxNryOXNecVDuXBrt" alt=""><figcaption></figcaption></figure>

*Figure 1 — CloudCompare main window on first launch.*

### Step 2 — Import the .e57 file

1. Go to **File → Open** (`⌘O` on macOS, `Ctrl+O` on Windows/Linux).
2. Browse to your `.e57` file and confirm.
3. If a **Global Shift / Scale** dialog appears (common for geo-referenced scans with very large coordinates), accept the suggested shift. This avoids floating-point precision issues during display.
4. After loading, the DB Tree shows the parent `.e57` node with one or more child clouds (one per scan station).

{% hint style="info" %}
Each child cloud in the DB Tree corresponds to a separate scan station inside the `.e57`. Toggle the checkbox to the left of any cloud to hide/show it in the 3D view without deleting it — useful for quickly identifying which station holds the data you want to remove.
{% endhint %}

### Step 3 — Delete or trim unwanted parts

There are two common operations:

* **Delete entire child clouds** (e.g. an entire scan station that captured the wrong area).
* **Crop a portion of a cloud** (e.g. remove the operator or background noise from one station).

#### 3.a Deleting full child clouds

1. In the DB Tree, click the first cloud you want to remove.
2. Shift-click or `⌘`/`Ctrl`-click to multi-select additional clouds.
3. Right-click the selection and choose **Delete** from the context menu (see figure below).
4. Confirm the deletion. The clouds are removed from the project (the original file on disk is unchanged until you save).

<figure><img src="/files/mzBT3vZ7FNzpNopqqV42" alt="" width="375"><figcaption></figcaption></figure>

*Figure 2 — Multi-select clouds in the DB Tree and choose Delete.*

#### 3.b Cropping inside a cloud (Segment tool)

1. Select the cloud you want to trim.
2. Activate the **Segment** tool (Edit → Segment, or the scissors icon).
3. Left-click in the 3D view to draw a polygon around the area you want to keep (or remove). Right-click to close the polygon.
4. Press **`I`** to keep points inside the polygon, or **`O`** to remove them. Press the green checkmark to confirm.
5. CloudCompare creates two children: `<name>.segmented` and `<name>.remaining`. Delete whichever one you don't want to keep.

### Step 4 — Save the cleaned file

1. In the DB Tree, select the **parent node** (the top-level `.e57` entry). Selecting the parent ensures all remaining children are exported together.
2. Go to **File → Save** (`⌘S` / `Ctrl+S`).

<figure><img src="/files/YS44dnC8uq5FAsLotkb9" alt=""><figcaption></figcaption></figure>

*Figure 3 — File → Save with the parent node selected.*

3. In the save dialog, enter a file name (e.g. `Cropped`) and choose **E57 cloud (\*.e57)** from the format dropdown. Click **Save**.

<figure><img src="/files/NjfVAr7yWyoleYcGffum" alt=""><figcaption></figcaption></figure>

*Figure 4 — Save dialog with file format set to E57 cloud (\*.e57).*

4. If prompted with E57 export options (compression, sensor info, normals, colors), accept the defaults unless you have a specific downstream constraint.

{% hint style="warning" %}
Always select the **PARENT** node before saving. Saving with only one child selected will export only that single cloud, not the full edited dataset.
{% endhint %}

***

## 4. Command-Line Workflow

CloudCompare ships with a powerful command-line mode that is ideal for automation, batch jobs, and CI pipelines. The CLI is invoked through the same binary as the GUI — it just runs headless when command-line flags are supplied.

### 4.1 Locating the binary

* **macOS:** `/Applications/CloudCompare.app/Contents/MacOS/CloudCompare`
* **Windows:** `C:\Program Files\CloudCompare\CloudCompare.exe`
* **Linux (Snap):** `cloudcompare.CloudCompare`

For brevity, the examples below use `cloudcompare` — substitute the full path or alias the binary in your shell, e.g.:

```bash
# macOS example - add to ~/.zshrc
alias cloudcompare="/Applications/CloudCompare.app/Contents/MacOS/CloudCompare"
```

### 4.2 Merging two .e57 files

This is the most common automation use case — combining multiple captures into a single deliverable `.e57`.

```bash
cloudcompare \
  -C_EXPORT_FMT E57 \
  -O "./Cloud_1.e57" \
  -O "./Cloud_2.e57" \
  -MERGE_CLOUDS \
  -SAVE_CLOUDS FILE "./SF_2.e57"
```

#### Flag reference

| Flag                       | Purpose                                       | Notes                                               |
| -------------------------- | --------------------------------------------- | --------------------------------------------------- |
| `-O <path>`                | Open a file. Repeat for multiple inputs.      | Order matters — inputs are loaded in sequence.      |
| `-C_EXPORT_FMT <FMT>`      | Set the default export format.                | Supported: E57, LAS, PLY, BIN, ASC, etc.            |
| `-MERGE_CLOUDS`            | Merge all currently loaded clouds into one.   | Run after all `-O` flags.                           |
| `-SAVE_CLOUDS FILE <path>` | Save the current cloud to a specific path.    | Without `FILE`, CloudCompare auto-names the output. |
| `-SS <method>`             | Subsample points (RANDOM / SPATIAL / OCTREE). | Useful before merging large clouds.                 |
| `-AUTO_SAVE OFF`           | Disable auto-saving intermediate steps.       | Recommended in pipelines to avoid clutter.          |
| `-SILENT`                  | Suppress GUI dialogs.                         | Essential for headless / CI runs.                   |

### 4.3 Useful CLI variants

#### Convert .e57 to .ply

```bash
cloudcompare \
  -SILENT \
  -O "./scan.e57" \
  -C_EXPORT_FMT PLY \
  -SAVE_CLOUDS FILE "./scan.ply"
```

#### Subsample then merge

```bash
cloudcompare \
  -AUTO_SAVE OFF \
  -C_EXPORT_FMT E57 \
  -O "./Cloud_1.e57" -SS SPATIAL 0.01 \
  -O "./Cloud_2.e57" -SS SPATIAL 0.01 \
  -MERGE_CLOUDS \
  -SAVE_CLOUDS FILE "./merged_subsampled.e57"
```

#### Batch-merge a folder of .e57 files (bash)

```bash
#!/usr/bin/env bash
set -euo pipefail

INPUT_DIR="./scans"
OUTPUT="./merged.e57"

INPUTS=()
for f in "$INPUT_DIR"/*.e57; do
  INPUTS+=("-O" "$f")
done

cloudcompare \
  -SILENT \
  -AUTO_SAVE OFF \
  -C_EXPORT_FMT E57 \
  "${INPUTS[@]}" \
  -MERGE_CLOUDS \
  -SAVE_CLOUDS FILE "$OUTPUT"

echo "Wrote $OUTPUT"
```

{% hint style="info" %}
**CLI tip:** Add `-SILENT` to suppress GUI dialogs and `-AUTO_SAVE OFF` to prevent CloudCompare from writing intermediate files to your working directory. Both are essential for clean CI runs.
{% endhint %}

***

## 5. References

* CloudCompare official site: <https://www.cloudcompare.org/>
* CloudCompare CLI documentation: <https://www.cloudcompare.org/doc/wiki/index.php/Command_line_mode>
* E57 format reference (libE57): <http://www.libe57.org/>
* ASTM E2807 standard for E57: <https://www.astm.org/e2807-11r19.html>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.multiset.ai/workflow/editing-point-cloud-data.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
