# Point Clouds and Blender

Points are treated as the vertices of a mesh, this allows them to be manipulated point clouds as if they were any other object inside Blender - conversely, this means that they cannot be rendered properly without some physicality first.&#x20;

This page is not a guide for Blender, instead it introduces a base workflow for working with Point Clouds in Blender.

***

## Importing

It is recommended to process all of your point clouds in a dedicated point cloud processing software like CloudCompare first.

**Point clouds are to be in a .ply format.**\
The .ply file format is a standard static 3d data - i.e. static textured objects.\
Point clouds are represented as geometric vertex data, with vertex attributes that represents the scalar field attributes.

Drag and drop or import via the File menu.

***

## Editing

Use Edit Mode to edit point cloud objects as mesh vertices.\
Note that you have to be in vertex/point selection mode to interact with the data.

By default, selection in Blender only works for non-occluded objects, so to select-through, x-ray view must be toggled on.

<figure><img src="https://1820679795-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LXautSvCbUco5Lv7YrH%2Fuploads%2Fiaa1D2MJulayUO9hJ7a0%2Fedit%20mode.PNG?alt=media&#x26;token=7d123d1d-79f2-4c80-a8c9-c2cacfb5b83d" alt=""><figcaption></figcaption></figure>

***

## Physicality

As point clouds are the same as mesh vertices in Blender, they can be given physicality via geometry instancing using particle systems or Geometry Nodes.

This is an example of a Geometry Nodes setup to draw basic spheres at each vertex location using the [Mesh to Points ](https://docs.blender.org/manual/en/latest/modeling/geometry_nodes/mesh/operations/mesh_to_points.html)node. For all intents and purposes, these are mesh spheres, but technically this is an optimised point renderer.

<figure><img src="https://1820679795-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LXautSvCbUco5Lv7YrH%2Fuploads%2F14qdCUQ8vk6wvUb7ep2F%2Fimage.png?alt=media&#x26;token=19aac321-db70-4e31-b0ec-86d90be9d5ea" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Note that this setup only works for Blender's Cycles render engine; for EEVEE, you can instance geometry on the points using a [Instance on Points](https://docs.blender.org/manual/en/latest/modeling/geometry_nodes/instances/instance_on_points.html) workflow.
{% endhint %}

***

## Materiality

When instancing on vertices, these objects need a material to be re-applied.

Below is an example of the Shader setup and updated basic Geometry Nodes setup for rendering basic point colour.&#x20;

#### Shader

As the scalar field attributes of the point cloud are stored as vertex attributes, the shader uses an attribute node to pull out these properties. Note that the names are case sensitive.

<figure><img src="https://1820679795-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LXautSvCbUco5Lv7YrH%2Fuploads%2FOBFY1EdeeoyUogEMkgcm%2Fshader.png?alt=media&#x26;token=d642927d-df05-4032-baaa-8bdff3166455" alt=""><figcaption></figcaption></figure>

#### Geometry Nodes

Re-assign with Set Material, use the drop-down list to find your material.

<figure><img src="https://1820679795-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LXautSvCbUco5Lv7YrH%2Fuploads%2FZK8bYYlXG5hcYiHhjsaN%2Fgn-shader.PNG?alt=media&#x26;token=c0ffd7b2-180b-4d9e-b30e-b2820853b2b6" alt=""><figcaption><p>Simple shaded shader with one sun.</p></figcaption></figure>

***

## Scalar Field Attributes

Use the spreadsheet view to view these attributes numerically:

<figure><img src="https://1820679795-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LXautSvCbUco5Lv7YrH%2Fuploads%2FlOim7LrIH38nd8F3WxhD%2Fspreadsheet.png?alt=media&#x26;token=5e4742e4-c550-4900-b64d-90075fd89195" alt=""><figcaption></figcaption></figure>

#### Shader

In the Shader, access other attributes the same way as colour, by specifying the corresponding attribute name.

<figure><img src="https://1820679795-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LXautSvCbUco5Lv7YrH%2Fuploads%2Fm0mpVv2irZlvV0nivket%2Fimage.png?alt=media&#x26;token=bad11801-38de-4a05-bb21-f03d5720aa82" alt=""><figcaption><p>You can use the colour in emission with a value over 1 to render the points with 'flat' shading, where the points will be mostly unaffected by other lights.</p></figcaption></figure>

**Geometry Nodes**

In Geometry Nodes, attributes can be accessed via the [Named Attribute](https://docs.blender.org/manual/en/latest/modeling/geometry_nodes/geometry/read/named_attribute.html) node; pick from the drop-down or enter the field manually (case-sensitive).

<figure><img src="https://1820679795-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LXautSvCbUco5Lv7YrH%2Fuploads%2F7O5bnNsVVQ3hvBBVI1Kz%2Fsf-gn.PNG?alt=media&#x26;token=6a7ad7ac-f91a-466f-9e62-e6c193d5f13e" alt=""><figcaption><p>Viewer nodes can be used to preview data at any stage of the graph.</p></figcaption></figure>

***

## Rendering

Change the rendering engine to Cycles, and enable GPU if possible.

The scene can be set up as in a standard scene; camera, lights, other VFX; and render.

<figure><img src="https://1820679795-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LXautSvCbUco5Lv7YrH%2Fuploads%2FYf7pSzBsvmCEJV1uWQbc%2Frender-blender.png?alt=media&#x26;token=417a8986-70dc-4827-858c-ee2eaa960dbc" alt=""><figcaption></figcaption></figure>
