Point Cloud Visualizer – By Carbon2
Original post author
Display, edit, filter, render, convert, generate and export colored point cloud PLY files.
Works with any PLY file with ‘x, y, z, nx, ny, nz, red, green, blue’ vertex values. Vertex normals and colors are optional. pcv-0.8.9.gif600×646
- Install and activate addon in a usual way.
- Add any object type to scene.
- Go to 3d View Sidebar (N) >
Point Cloud Visualizertab, click file browser icon, select ply file, click
Reloadbutton next to it reloads ply from disk.
Drawbutton to display point cloud,
Eraseto hide point cloud. Adjust percentage of displayed points with
Display, point size with
Sizeand point transparency with
- Display point normals as lines – click
Normalicon, adjust line length with
Lengthnext to it.
- Transforming parent object transforms point cloud as well.
Illumination‘adds’ single artificial light on points, you can edit its direction and strength. Works only when vertex normals are present.
- When vertex colors are missing, cloud will be displayed in uniform gray, in that case you can enable
Illuminationto have better cloud view
Display– percentage of displayed points
Size– point size in pixels
Alpha– global points alpha
Normals– display point normals as lines, adjust line length with
Lengthnext to it
Illumination– enable extra illumination, works only when vertex normals can be loaded
Light Direction– illumination light direction
Light Intensity– illumination light intensity
Shadow Intensity– illumination shadow intensity
Depth– enable depth debug shader
Brightness– depth shader color brightness
Contrast– depth shader color contrast
False Colors– display depth shader in false colors
Color A– depth shader false colors front color
Color B– depth shader false colors back color
Normal– enable normal debug shader
Position– enable position debug shader
Shader with 6 clipping planes. 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.
pcv-0.9.28-clip-viewport.png1000×650 308 KB
Enable Clipping Planes Shader– enable shader
Plane 0– plane 0 normal (x, y, z), plane 0 distance from origin
Plane 1– plane 1 normal (x, y, z), plane 1 distance from origin
Plane 2– plane 2 normal (x, y, z), plane 2 distance from origin
Plane 3– plane 3 normal (x, y, z), plane 3 distance from origin
Plane 4– plane 4 normal (x, y, z), plane 4 distance from origin
Plane 5– plane 5 normal (x, y, z), plane 5 distance from origin
Object– object to use as bounding box source
Set Clip Planes From Object Bounding Box– set planes from selected object bounding box
X– reset all the settings to their defaults
Quasi point cloud Edit Mode. Hit
Start and all points
are 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. 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.
- To save edited point cloud, you have to use
Exportfeature and check
Use Viewport Pointsbecause edits are only in memory, if you close Blender, edits will be lost.
- Point normals are not changed (at this time), if you rotate points, normals will be still oriented as before.
- New points can be reliably (for now) created by duplicating existing points. If you create new points, they will all have the same random normal and random color.
Start – Start edit mode, create helper object and switch to it
Overlay Alpha – Overlay point alpha
Overlay Size – Overlay point size
Update – Update displayed cloud from edited mesh
End – Update displayed cloud from edited mesh, stop edit mode and remove helper object
Cancel – Stop edit mode, try to remove helper object and reload original point cloud
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. pcv-0.9.16-filter.png214×621
Simplify point cloud to exact number of evenly distributed samples. All loaded points are processed. Higher samples counts may take a long time to finish. Surely there are better (and faster) tools for the job, but… Basically it takes some random point and set as accepted sample, then another set of random candidates, measure distance from already accepted samples and stores the one that is most distant as another accepted, repeat until number of samples is reached.
Samples– Number of points in simplified point cloud, best result when set to less than 20% of points, when samples has value close to total expect less points in result
Candidates– Number of candidates used during resampling, the higher value, the slower calculation, but more even
Simplify– run operator
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
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.
Object– Mesh or object convertible to mesh
Search Distance– Maximum search distance in which to search for surface
Positive– Search along point normal forwards
Negative– Search along point normal backwards
Discard Unprojectable– Discard points which didn’t hit anything
Colorize– Colorize projected points
Source– Color source for projected point cloud
Vertex Colors– Use active vertex colors from target
UV Texture– Use colors from active image texture node in active material using active UV layout from target
Vertex Group Monochromatic– Use active vertex group from target, result will be shades of grey
Vertex Group Colorized– Use active vertex group from target, result will be colored from red (1.0) to blue (0.0) like in weight paint viewport
Shift– Shift points after projection above (positive value) or below (negative value) surface
Project– execute operator
Intersect or Exclude points with mesh object. Mesh have to be non-manifold.
Object– Mesh or object convertible to mesh
Intersect– Keep points inside mesh, remove points outside
Exclude– Keep points outside mesh, remove points inside
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.
Color– Color to remove from point cloud
Δ Hue– Delta hue
Δ Saturation– Delta saturation
Δ Value– Delta value
Select Color– Run operator and display selected points in viewport for review
Delete Selected– Delete selected points
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 preferences.
Merge With Other PLY– run operator
Join current active point cloud with another on different object. Object transformations are applied to clouds to look the same as before joining.
Object– select object with another point cloud to join
Join– run operator
Adjust exposure, gamma, brightness, contrast, hue, saturation, value or invert colors. Click
Enable to enable color adjustment shader, adjust values as needed, click
Apply to apply colors to points. Click
Reset to set all to default value. Shader can be disabled without changes anytime unchecking
Enable. When color adjustment shader is enabled, all other shaders are disabled.
Enabled– Enable color adjustment shader, other shaders will be overrided until disabled
Exposure– formula: color = color * (2 ** value)
Gamma– formula: color = color ** (1 / value)
Brightness– formula: color = (color – 0.5) * contrast + 0.5 + brightness
Contrast– formula: color = (color – 0.5) * contrast + 0.5 + brightness
Hue– formula: color.h = (color.h + (value % 1.0)) % 1.0
Saturation– formula: color.s += value
Value– formula: color.v += value
Invert– formula: color = 1.0 – color
Reset– Reset color adjustment values
Apply– Apply color adjustments to points, reset and exit
Currently only sigle point cloud per render/frame is supported. Output image is RGBA 8bit PNG – transparent background with colored point cloud, which can be composed over something else later.
- Blend file has to be saved
- Load and display ply first.
- Make a camera and adjust as needed.
- Select cloud parent object, set point size with
Sizeor percentage of rendered points with
- Set render path in
- Set render image size with
- At default resolution settings are taken from scene, to make them independent, click chain icon next to properties, correct aspect ratio is not calculated, if you link properties again, values are copied from scene.
Illuminationis enabled it will be rendered as well
- If one of debug shaders is enabled, it will be rendered instead of regular shader
Count– percentage of rendered points
Size– point render size in pixels
Supersampling– Render larger image and then resize back to anti-alias, 1 – disabled, 2 – render 200%, 3 – render 300%, etc.
Smooth Circles– Currently works only for basic shader with/without illumination and generally is much slower than Supersampling, use only when Supersampling fails
Output– path where to save rendered images,
#characters defines the position and length of frame numbers, image is always saved, filetype is always png, accepts relative paths, upon hitting
Renderpath is validated, changed to absolute and written back
Resolution X– image width in pixels
Resolution Y– image height in pixels
Resolution %– percentage scale for resolution
Resolution Linked– when enabled, settings are taken from scene, if not they are independent on scene, but aspect ratio is not calculated
Render smoothing/anti-aliasing notes:
Supersampling for most of the time with lowest value (to be exact,
works great) that look still good. If you run into problems due to very
large supersampled image sizes Blender or hardware cannot handle, you
can try to disable
Supersampling and use
to draw smooth points directly in target resolution, but you are
limited to basic shader and points before drawing have to be depth
sorted manually which can be very slow with large point counts.
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.
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.
Type– Instance mesh type, Vertex, Equilateral Triangle, Tetrahedron, Cube or Ico Sphere
Subset– Use all points or random subset of by given percentage
Size– Mesh instance size, internal instanced mesh has size 1.0 so if you set size to 0.01, resulting instances will have actual size of 0.01 event when cloud is scaled
Align To Normal– Align instance to point normal, e.g. tetrahedron point will align to normal, triangle plane will align to normal etc.
Colors– Assign point color to instance vertex colors, each instance will be colored by point color (except vertices)
Sphere Subdivisions– Conversion to instancer / particles only, number of subdivisions of particle system instanced ico sphere
Source– Points generation source
Vertices– Use mesh vertices
Surface– Use triangulated mesh surface
Particles– Use active particle system
(Source: Particles)– Particles source selection
(Source: Particles)– Use all particles
(Source: Particles)– Use only alive particles
(Source: Surface)– Point generating algorithm
Weighted Random In Triangle– Average triangle areas to approximate number of random points in each to get even distribution of points. If some very small polygons are left without points, increase number of samples. Mesh is triangulated before processing, on non-planar polygons, points will not be exactly on original polygon surface.
Poisson Disk Sampling– Warning: slow, very slow indeed… Uses Weighted Random In Triangle algorithm to pregenerate samples with all its inconveniences.
Approximate Number Of Points
(Source: Surface)– Number of points to generate, some algorithms may not generate exact number of points.
(Source: Surface)– Random number generator seed
(Source: Vertices, Surface, Particles)– Color source for generated point cloud
Constant Color– Use constant color value
Vertex Colors– Use active vertex colors
UV Texture– Generate colors from active image texture node in active material using active UV layout
Vertex Group Monochromatic– Use active vertex group, result will be shades of grey
Vertex Group Colorized– Use active vertex group, result will be colored from red (1.0) to blue (0.0) like in weight paint viewport
(Source: Vertices, Surface, Particles)– Constant color
Exact Number of Samples
(Source: Surface, Algorithm: Triangle)– Generate exact number of points, if selected algorithm result is less points, more points will be calculated on random polygons at the end, if result is more points, points will be shuffled and sliced to match exact value
(Source: Surface, Algorithm: Poisson)– Poisson Disk minimal distance between points, the smaller value, the slower calculation
(Source: Surface, Algorithm: Poisson)– Poisson Disk presampling exponent, lower values are faster but less even, higher values are slower exponentially
Particles, for generating colors (apart from
Constant color), non-overlapping UV layout is required (can be really bad, useless for real production).
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. Transformation and axis conversion
can be applied on both loaded and viewport points.
Use Viewport Points– When checked, export points currently displayed in viewport or when unchecked, export data loaded from original ply file
Visible Points Only– Export currently visible points only (controlled by ‘Display’ on main panel)
Apply Transformation– Apply parent object transformation to points
Convert Axes– Convert from blender (y forward, z up) to forward -z, up y axes
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
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
Preload Sequence– Load all matching ply files
Cycle Forever– Cycle frames if timeline is longer than number of loaded frames
Clear Sequence– Clear all loaded and return object to regular state i.e. you can load another ply, changes are kept etc.
To display point cloud data from other addons/custom scripts.
import bpy import numpy as np from space_view3d_point_cloud_visualizer import PCVControl o = bpy.context.active_object c = PCVControl(o) n = 100 vs = np.random.normal(0, 2, (n, 3)) ns = np.array([[0.0, 0.0, 1.0]] * n) cs = np.random.random((n, 3)) # draw points c.draw(vs, ns, cs)
# if some data like normals/colors are not available c.draw(vs, None, None) c.draw(vs, , ) c.draw(vs) # it is also possible to pass nothing in which case nothing is drawn c.draw()
# to stop any drawing c.erase() # to return object control to user c.reset()
Default– Default color to be used upon loading PLY to cache when vertex colors are missing
Normal– Display color for vertex normals lines
Selection– Display color for selection
Shuffle Points– Shuffle points upon loading, display percentage is more useable if points are shuffled, disabled if you plan to export ply and you need to keep point order
Convert 16bit Colors– Convert 16bit colors to 8bit, applied when Red channel has ‘uint16’ dtype
Gamma Correct 16bit Colors– When 16bit colors are encountered apply gamma as ‘c ** (1 / 2.2)’
Tab Name– To have PCV in its own separate tab, choose one
Custom Tab Name– Check if you want to have PCV in custom named tab or in existing tab
Name– Custom PCV tab name, if you choose one from already existing tabs it will append to that tab
- 0.9.30 join filter, ui tweaks, fixes
- 0.9.28 clipping planes from object bounding box, faster all numpy export, many minor fixes
- 0.9.27 render supersampling and draw smooth circles
- 0.9.26 color adjustment fixes
- 0.9.25 color adjustment, faster boolean
- 0.9.24 project colors
- 0.9.23 fixes
- 0.9.22 extra debug shaders
- 0.9.21 preferences
- 0.9.20 ui changes, poisson disk sampling generation, size and alpha available in edit mode, various fixes, removed manual depth sorting during render
- 0.9.19 point cloud generation from vertices and particles
- 0.9.18 point cloud generation from mesh surface
- 0.9.17 fixes
- 0.9.16 boolean filters
- 0.9.15 selection preview for remove color filter
- 0.9.14 external api improvements
- 0.9.13 faster normals drawing
- 0.9.12 ply sequence, external api
- 0.9.11 merge filter
- 0.9.10 ui
- 0.9.9 point cloud global alpha
- 0.9.8 basic editing
- 0.9.7 project point cloud on mesh surface
- 0.9.6 ply exporting now uses original or viewport data
- 0.9.5 simplify and remove color filters
- 0.9.4 export ply
- 0.9.3 conversion to instancer
- 0.9.2 load ply with 16bit colors
- 0.9.1 all new render settings
- 0.9.0 conversion to particles
- 0.8.14 fixes
- 0.8.13 fixes
- 0.8.12 fixes
- 0.8.11 ui tweaks
- 0.8.10 fixes
- 0.8.9 ui tweaks, code cleanup
- 0.8.8 refactored convert to mesh
- 0.8.7 fixed vcols bug in convert
- 0.8.6 ui tweaks, a few minor optimizations
- 0.8.5 convert to mesh all or subset
- 0.8.4 preferences, ui tweaks
- 0.8.3 display normals
- 0.8.2 fixed shader unknown attribute name
- 0.8.1 fixed ply with alpha, fixed convert to mesh when normals or colors are missing
- 0.8.0 convert to mesh
- 0.7.2 ui tweaks
- 0.7.1 viewport performance fixes
- 0.7.0 ascii ply support
- 0.6.6 fixed drawing after undo/redo
- 0.6.5 point cloud illumination
- 0.6.4 refactored draw handlers, fixed occasional crash on erase
- 0.6.3 added percentage of rendered points, fixed render colors to look the same as in viewport
- 0.6.2 fixed point size display in viewport, separated view and render point size
- 0.6.1 single cloud rendering almost completely rewritten to be better and faster
- 0.6.0 single cloud rendering
- 0.5.2 refactored some logic, removed icons from buttons
- 0.5.1 load ply without vertex colors, uniform grey will be used
- 0.5.0 performance improvements using numpy for loading and processing data
- 0.4.6 fixed crash when parent object is deleted while drawing, fixed removal of loaded data when parent is deleted
- 0.4.5 added ‘Display’ percentage, better error handling during .ply loading
- 0.4.0 almost complete rewrite for blender 2.80, performance improvements using shaders, simplified ui
- 0.3.0 new ply loader, can be used with any binary ply file with vertex coordinates and colors
- 0.2.0 display percentage
- 0.1.0 first release
- If you duplicate object with cloud, duplicate will still control the original one until you load a different one. Currently there is no reliable way (as far as i know) to get unique id of an object and therefore no way to tell to which object stored properties (e.g. path to ply) belong.