Point Cloud Visualizer

Display, edit, filter, render, convert, generate and export colored point cloud PLY files.

Works with any Binary or ASCII PLY file with ‘x, y, z, nx, ny, nz, red, green, blue’ vertex values. Vertex normals and colors are optional. Text based file formats, such as .txt, .xyz, .pts, .csv, can be imported.

PCV

PCV

PCV


Contents

Installation

Optional - install Open3D library to use features from Extras panel

Open3D - A Modern Library for 3D Data Processing: http://www.open3d.org/. Open3D is released under the MIT license. Currently supported Open3D version is 0.10.0.0.

Extras

Open3D is not yet available for Python 3.9 included in Blender 2.93. Use Blender 2.92.

or install by yourself running following script from blender text editor:

import bpy
import subprocess
bpp = bpy.app.binary_path_python
subprocess.call([bpp, "-m", "ensurepip", ])
subprocess.call([bpp, "-m", "pip", "install", "-U", "pip", ])
subprocess.call([bpp, "-m", "pip", "install", "-U", "open3d==0.10.0.0", ])
# verify..
import open3d

General Use

Panels

Main reference

Main

Select ply file to load together with main Draw and Erase buttons. Click Center View At Points to move 3d viewport camera to fit points in its view.

Helpers reference

Add Menu

Import Menu

You can also add PCV instance from Add or Import menus. Go 3D Viewport > Add > Point Cloud Visualizer or File > Import > Point Cloud Visualizer choose ply or ascii type from submenu, select file(s) in file browser and run helper to make empty object with loaded points from file. If more files is selected, it will make separate empty for each file. For ascii import, you need to create data format preset first in Import panel and then use that preset in ascii helper, otherwise it will try to guess data format, but may not be always correct, depends on data format.

Shader reference

Shader

Adjust percentage of points Display, point Size and Alpha. Shader type and its options (if any). Shader extras - Clip to set clipping planes, point Normals and Bounding Box.

Available shaders:

Clip

Shader

Shader

Planes can be enabled/disabled independently with eye icon, first 3 values are plane normal (x, y, z), last value is plane distance from origin. These can be set from different object bounding box, choose object from scene in Object and hit Set Clip Planes From Object Bounding Box, object can then be hidden/deleted, set values will stay until operator is executed again. X reset all the settings to their defaults. When Clip Planes Auto Update is enabled, object bounding box and resulting planes are recalculated on each redraw. Clipping can be then animated for viewport and render as well. Please note, only Fast shader ignores clipping planes settings.

Shader

Normals

Shader

Bounding Box

Shader

version 1.0.0 all shaders:

Shaders

version 1.2.0 new added shaders:

Shaders

version 1.4.0 new added shaders:

Shaders

Uses default MatCaps that comes with Blender, custom user MatCaps are supported too.

Please note, using MatCap shaders creates image(s) in blender data where original MatCap image is loaded and cloned to new image to prevent accidental modification of original MatCap image.

Shaders

Load reference

Load

Here are options for ply loading, loaded data post-processing and safety checks.

To use partial load, first enable clicking checkbox Partial Load and set method. For extra large clouds with ordered data, you can choose Slice method which will load only a continuous part of points. To extract points from whole file you can use Spaced or Random. Spaced first load all points to system memory and then evenly spaced points from all are chosen and the rest is discarded to free system memory. This can be used when you are able to fit all points into system memory, but you don’t need to draw them all and it is still quite fast. Random method is slow, but much less system memory is needed to load subset of points. Points are read from file randomly and only single point is read each time until requested percentage is met.

Data post-processing lets you choose default color if points does not have any, convert 16bit colors, apply gamma correction, shuffle points (to be used with Shader > Display), you can disable storing of raw loaded data to save memory or disable automatic drawing after load to check number of loaded points first before drawing to prevent crashes from low gpu memory.

Safety lets you set maximum number of points to display regardless how many points are loaded to prevent crashes from low gpu memory.

Import reference

Import

Import points from text file formats such as .txt, .xyz, .pts, .csv, etc. Any plain text file with data organized into table with same number of items in a row. Select file, specify separator, number of header lines (if any) and each column data type and click Import. For convenience you can preview first 10 lines in file checking File Contents Preview. Preview tries to split columns with chosen separator on the fly. Alternatively you can click Guess Data Format to prefill columns types based on simple rules, but because except .pts there is no official data format specification, always verify the result. You can also save current column setup, header lines and separator properties as preset using preset widget.

Import also uses Partial Load and Post-load Processing options from Load panel, except Convert 16bit Colors property.

Notes on color values: by default rgb color is used for imported data, if you want to import other value like intensity from laser scanners, use Grey data type for its column and set rgb columns to Ignore. To import such value in false colors / heat map, use Value type instead.

Import

Example setup for .pts file import to get intesity column as greyscale.

Notes on performance: loading data from text files is slow, after import, it is recomended to use Export panel to export loaded data as binary .ply and use that for fastest loading next time blend is opened.

Edit reference

Edit

Quasi point cloud Edit Mode. Hit Enable Edit Mode and all points will be converted to helper mesh with vertices and entered to mesh edit mode. You can transform, delete and duplicate vertices using regular Blender’s tools. If you want update displayed points, hit Update, when you are finished editing hit End to update points for a last time and delete helper mesh. You can also adjust point cloud overlay size and alpha. If something went wrong, select main object with cloud and hit Cancel to reload original points, return interface to regular mode and attempt to clean helper mesh if it is still available. Center Origin and Apply Transformation operators works without entering Edit mode. Center Origin will center point cloud at object center and Apply Transformation will apply container object transformation on points and resets transformation of container.

Edit

While in Edit Mode helper mesh vertices can be selected by point color, Eye icon set points overlay opaque for easy color selecting with eyedropper.

Select Color

Point color of selected vertices can also be changed.

Set Color

Filter reference

Filter

Filter current point cloud, all changes are only temporary, original data are still intact. To keep changes, you have to export cloud as ply file.

Simplify reference

Simplify Simplify

Simplify point cloud to exact number of evenly distributed samples. All loaded points are processed. There are two methods to choose from.

Simplify

Project reference

Project

Project points on mesh (or object convertible to mesh) surface. Projects point along their normals until it hit surface or Search Distance is reached. You can choose between Positive (along normal direction), Negative (vice versa) or both. Optionally you can Discard Unprojectable points that was not possible to project and after projection Shift points a fixed distance along normal (positive value) or the other way around (negative value). Projected points can be optionally colorized by vertex colors, uv texture and vertex group from target mesh and their normals can be set from mesh surface they hit. When Project Position is disabled, points positions are not changed, but depending on other options their normals can be realigned or color copied from mesh.

Project

Transfer Colors reference

Project

Transfer colors from point to Target mesh object vertex colors or UV texture. By default, color is taken from closest point, optionally you average point colors in set radius. Transfer colors to UV texture requires non-overlapping UV layout fully contained in unit square on target mesh and material with active Image Texture node with loaded image to operate on. Extending margins on UV texture uses blender baking system and requires Cycles to be set as render engine.

Project

Crop reference

Crop

Fast crop points by object bounding box. Crop points inside bounding box or outside.

Crop

Boolean reference

Boolean

Intersect or Exclude points with mesh object. Mesh have to be non-manifold.

Boolean

Color Adjustment reference

Color Adjustment

To use, switch shader type to Color Adjustment. Adjust exposure, gamma, brightness, contrast, hue, saturation, value or invert colors. Adjust values as needed with preview in viewport, click Apply to apply colors to points. Click Reset to set all to default value. Shader can be disabled without changes anytime switching to different shader.

Remove Color reference

Remove Color

Remove points with exact/similar color as chosen in color picker (Eyedropper works too). Currently i can’t get to match sampled color from viewport with color in loaded cloud. Floating point error, incorrectly handled Gamma (at my side for sure), color management in Blender’s viewport or any combination of all, or something else.. Anyway, if you leave at least one delta at hue/saturation/value (whatever works best for given cloud) it should remove the color you picked. Point selection can be previewed in viewport, can be inverted or canceled. Selection color can be changed for better clarity.

Remove Color

Numeric input can be enabled by checking Use Expression. Input must be valid python expression, use v for point color channel value, leave blank to skip evaluation of channel. Use Type to set value type of your expression, Float uses color values as they are displayed on screen in range 0.0-1.0, Int converts them to 0-255 range. Use bitwise operators for more conditions.

Remove Color

Split reference

Split

Split current point cloud into:

Can be joined back with Join filter.

Join reference

Join

Join selected PCV instances to a new instance while preserving transformations of each instance.

Merge reference

Merge

Load another ply and merge with currently displayed. Hit Merge With Other PLY, select ply file and load. New point will be appended to old, shuffled if shuffle is enabled in Load.

Render reference

Render

Single point cloud or multiple point clouds in separate PCV instances per render/frame are supported. When rendering multiple instances, all must be visible in viewport (i.e. ply is loaded and drawn in viewport) before starting render. Render background can be transparent (if type Point Cloud is used) or 3d viewport with other objects in scene (type Viewport) in their current shading state and viewport shading type (Rendered shading type is not supported). Output image is RGBA 8bit PNG. When using Alpha shader together with alpha per point or when using Global Alpha, enable Depth Sort for better results.

Depth Sort render result on point cloud with alpha per point:

Render

Convert reference

Convert

Convert point cloud to mesh. May result in very large meshes, e.g. 1m point cloud to cubes = 8m poly mesh. Depending on what point cloud data is available and desired mesh type, some options may not be enabled. When Custom Mesh type is used, if mesh without polygons is used, vertex colors will not be set even when checked, for vertex colors, some polygons are required.

Conversion to instancer specifics: points are converted to triangle mesh object, vertex colors are baked to texture, extra instanced sphere object is added as child object of main mesh, material using baked colors is added to sphere and each instance inherits color of corresponding face it is instanced from.

Conversion to particles specifics: points are converted to triangle mesh object, vertex colors are baked to texture, particle system is added to mesh with one particle on each face, extra instanced sphere added as child object of main mesh and particle system is set to render that sphere, material using baked colors is added to sphere and each instance inherits color of corresponding face it emit from. Result is regular particle system which can be further edited, e.g. instance mesh changed, physics added etc.

Conversion to Geometry Nodes does not create any geometry node system yet, since currently there is no way to use color to colorize instanced mesh on points. This conversion type is available only in Blender 2.93+.

Conversion to Geometry Nodes in Blender 3.0+ adds Cube as instanced object and instances are colorized by proximity. This is not ideal, because instances are merged before thay are colorized as one big mesh, but in current state of Geometry Nodes this is the only way to colorize instances.

Convert

Generate reference

Generate

Generate point cloud from mesh (or object convertible to mesh) surface or volume. To store point cloud, use Export to save as ply file.

When Source is Particles, for generating colors (apart from Constant color), non-overlapping UV layout is required.

Generate

Generate

Export reference

Export

Export current point cloud as binary ply file with several options. If exporting modified (filtered) points, check Use Viewport Points, otherwise you will not get modified points. If exporting viewport points colors may slightly differ (i mean, they will look the same, they will not be identical because of rounding error). Transformation and axis conversion can be applied on both loaded and viewport points.

Extras reference

Voxel Downsample reference

Voxel Downsample

Voxel downsampling uses a regular voxel grid to create a uniformly downsampled point cloud from an input point cloud. Size of grid is set with Voxel Size.

Voxel Downsample

Estimate Normals reference

Estimate Normals

Compute normals of point cloud. Normals are oriented with respect to the existing point cloud normals if provided.

Estimate Normals

To orient resulting normals correctly, Direction or Camera Location (as location of another object in scene) can be used.

Estimate Normals

Point Set Registration reference

Align points from multiple PCV instances to match using several algorithms, both global and local (local methods require pre-alignment). Select all PCV instances and from active Run Registration. Container objects transformation will be adjusted based on result, point cloud data will not be changed. Active PCV instance acts as base point cloud and other selected will try to aling to it. When finished, you can join all points to one clicking Join Selected, this will create new PCV instance with all points joined to one and this result needs to be saved in Export panel or will be lost when Blender is closed.

Point Set Registration

Available methods:

Surface Reconstruction reference

Surface Reconstruction

Perform Poisson Surface Reconstruction on point cloud.

Surface Reconstruction

Sequence reference

Sequence

Load sequence of ply files to play in viewport. Load first frame as regular file and when Preload Sequence is clicked it tries to load all ply files matching selected ply filename, e.g. you select sequence-001.ply and all sequence-###.ply will be loaded from directory. Only last number in filename is considered. Numbers should start at 1. All other features works when animation is not playing, but all changes are lost when you change frame to another.

Sequence

3D Viewport Menu reference

Menu

Batch control PCV instances from 3d viewport. You can influence all, selected or active PCV instances and control drawing to viewport, loading operators and synchronize display shader properties.

Preferences reference

Preferences

To view, go Edit > Preferences > Add-ons > 3D View: Point Cloud Visualizer and click triangle next to name. Here you can choose tab name for PCV.

API

To display point cloud data from other addons/custom scripts.

# import
import bpy
import numpy as np
from space_view3d_point_cloud_visualizer.mechanist import PCVOverseer

# get object to use
o = bpy.context.object
# register
pcv = PCVOverseer(o)

# make some example data
n = 1000
vs = np.random.normal(0, 2, (n, 3))
ns = np.array([[0.0, 0.0, 1.0]] * n)
cs = np.random.random((n, 3))

# load data
pcv.load(vs, ns, cs, )
# and draw data to viewport
pcv.draw()

# to stop drawing to viewport
# pcv.erase()
# to stop using object and clear loaded data
# pcv.free()

Changelog

Bugs? Suggestions?

Here: https://blenderartists.org/t/point-cloud-visualizer/


Reference

annotations: property, enum, operator

Main (panel)

Helpers (menus)

Shader (sub-panel)

Load (sub-panel)

Import (sub-panel)

Edit (sub-panel)

Filter (sub-panel)

Render (sub-panel)

Convert (sub-panel)

Generate (sub-panel)

Export (sub-panel)

Sequence (sub-panel)

Extras (sub-panel)

3D Viewport Menu (popup panel)

Preferences (add-on preferences panel)

To view, go Edit > Preferences > Add-ons > 3D View: Point Cloud Visualizer and click triangle next to name