# Viewing Point Clouds

#### Sample Datasets:

{% file src="<https://2416497028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOPPBWdanG78xVyb6w4vq%2Fuploads%2F0PiwUZtCdLNZIOQwSWSp%2F737_Public.csv?alt=media&token=c8f592d8-13c2-481a-aaa1-d2ddcd7109b5>" %}

{% file src="<https://2416497028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOPPBWdanG78xVyb6w4vq%2Fuploads%2FWdez789fT62KREzxr463%2FWayzataBayPublic.csv?alt=media&token=5a962848-a501-4bf1-8995-d1796d9c8ea9>" %}

### CloudCompare Import

1. Export your sonar data from SonarView as a CSV (or use one of the samples)
2. Open CloudCompare
3. **Drag** the CSV from your file explorer onto CloudCompare's 3D viewport (the main part of the window). A dialog will appear
4. To view the data in CloudCompare, the fields must be assigned correctly as shown below. \
   Note: changing 'Skip Lines' will clear any columns you have assigned, so make that change first.&#x20;

| Setting    | Value   |
| ---------- | ------- |
| Skip Lines | 1       |
| Column 3   | coord.Z |
| Column 4   | coord.X |
| Column 5   | coord.Y |

<figure><img src="https://2416497028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOPPBWdanG78xVyb6w4vq%2Fuploads%2FyA9sKmsRSzBCLOWW7qRQ%2Fimage.png?alt=media&#x26;token=7d2230f5-e7be-4bc6-bb41-a668957ec957" alt=""><figcaption></figcaption></figure>

Click **Apply** to import the point cloud. You should see something like this;

<figure><img src="https://2416497028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOPPBWdanG78xVyb6w4vq%2Fuploads%2FUxxvd1E6Jb3RkXwZgh85%2Fimage.png?alt=media&#x26;token=e0189df3-b1a9-40ca-9ad6-36a28088a262" alt=""><figcaption></figcaption></figure>

The color of the points is determined by the ping number. In order to color the points by their height, we need to generate a scalar field containing the height of the point. This can be accomplished in two ways:

1. Open your CSV in a spreadsheet program (Excel, LibreOffice Calc), copy column 3 (Z position),  paste it as a new column (after the ping number column), save the CSV, and then import to Cloud Compare as described above. Designate your new column as a scalar field. After importing, you will be able to use the scalar field to color the points.&#x20;
2. Use CloudCompare's rasterize tool to generate a new point cloud with the scalar field.&#x20;

   1. Open the Rasterize tool &#x20;

      <figure><img src="https://2416497028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOPPBWdanG78xVyb6w4vq%2Fuploads%2F4dwpBx4QdNuJYoF9AjTZ%2Fimage.png?alt=media&#x26;token=37b7af63-6284-4f64-8570-ec270f182265" alt=""><figcaption></figcaption></figure>

   2. Set the following settings:
      1. Choose step size (in meters), this will vary depending on your needs, for this example 0.2m is used.&#x20;
      2. Set the active layer to **Z Values**.&#x20;
      3. Direction: Z
      4. Cell height: Minimum
      5. Project SFs: minimum value.&#x20;
      6. The Fill With setting depends on your needs. Leave Empty will most accurately represent the original point cloud. Kriging will generate new points to fill gaps, which can produce a satisfying result. &#x20;

   <figure><img src="https://2416497028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOPPBWdanG78xVyb6w4vq%2Fuploads%2F0lIPxWk9c0TsIDjEfL6H%2Fimage.png?alt=media&#x26;token=078bc393-d898-46b7-8d44-71ee1dd978cf" alt=""><figcaption></figcaption></figure>

   <figure><img src="https://2416497028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOPPBWdanG78xVyb6w4vq%2Fuploads%2FmXFgayQ4jIsqFex7jrib%2Fimage.png?alt=media&#x26;token=2afd8b73-6a70-40d5-abd5-a67789134c3d" alt=""><figcaption></figcaption></figure>
3. Click **Export -> Cloud** to save the new point cloud, which will be automatically colored by height.&#x20;

### Working with Point Clouds

The point cloud can be made more readable and visually appealing by changing the color scale of the new point cloud. The Viridis color scale is used in this image.&#x20;

<figure><img src="https://2416497028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOPPBWdanG78xVyb6w4vq%2Fuploads%2Fy9jKWCduA6PRfrP1SADs%2Fimage.png?alt=media&#x26;token=a5cf8d16-252b-4e40-bbcc-3b634afa49ee" alt=""><figcaption></figcaption></figure>

Increasing the point size can make it easier to see the points when zoomed in:&#x20;

<figure><img src="https://2416497028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOPPBWdanG78xVyb6w4vq%2Fuploads%2FKinipwmsx9o3AB5viGky%2Fimage.png?alt=media&#x26;token=8ba5d782-aa32-40f9-b8a7-970bc54bdced" alt=""><figcaption></figcaption></figure>

Trimming the display range (of the color scale) can help emphasize a feature:

<figure><img src="https://2416497028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOPPBWdanG78xVyb6w4vq%2Fuploads%2FW3tqPPWi20vw5sPhp0fs%2Fimage.png?alt=media&#x26;token=6e2f4c41-544c-48bf-a7c1-c9cec02810e0" alt=""><figcaption></figcaption></figure>
