Point Cloud Visualizer

and now for something completely different… it’s… some updates

0.9.14 external api improvements
0.9.13 faster normals drawing (normals are now drawn with geometry shader and not precomputed values, so any change is almost instant)
0.9.12 ply sequence, external api

Sequence

pcv-anim

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.

Point Cloud Visualizer

  • 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.

External API

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

import bpy
import numpy as np
from 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()
3 Likes

and one more
0.9.15 selection preview for remove color filter
after calculation, selected points for removal are draw in red (can be changed in preferences), then you can delete them, try again or deselect

3 Likes

and another…
0.9.16 boolean filters

Boolean

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

2 Likes

I have seen your artwork… it was… wow. Very slick. :smiley:

I hear you on the calculation speed regarding previewing.

Yes! Sharing…

fixed bug when hue was close to 0.0 or 1.0, it wasn’t considering ‘negative’ delta hue and delta hue over 1.0, so another update:

0.9.17 fixes

1 Like

ok, what was fixed, is fixed again, too lazy to increment version number, so if anyone needs it, install fresh from repo…

Hi guys, sorry for the noob question but I can find the addons in “preferences-addons”, i just installed the 2.80 and still moving the first little steps into this software, and using a lot the “point clouds” format I would really try this addon

Hi carbon2! Thanks a lot for this incredible add-on!
I am new to Blender, I decided to finally migrate from 3Ds Max!! I’ve been working around with your add-on for the last days and really find it amazing!
I have a problem that might sound stupid:
Somehow, once I convert the ply file into tetrahedron, cube, etc. it all becomes grey (as in your example). My question is: Is there a way to recover the texture and apply it onto the converted file?
Many thanks

hi, to open blender preferences go Edit > Preferences…
(https://docs.blender.org/manual/en/dev/editors/preferences/introduction.html)
and to install an addon go to Addons section, click Install.. and locate addon file
(https://docs.blender.org/manual/en/dev/editors/preferences/addons.html)
in case of PCV, download github repo clicking download > download zip, then unzip and from blender preferences locate view3d_point_cloud_visualizer.py file, then enable clicking the checkbox next to its name in addons list

if you convert it with Colors checked in Convert panel, result mesh will have vertex colors assigned. to verify, you can go to Vertex Paint mode to see colors in viewport. to use them in rendering you need to plug Attribute node with name of vertex colors filled in (should be named Col) in Color input on shader

Works great! Thanks a lot :slight_smile:

update: 0.9.18 point cloud generation


Generate

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

Point Cloud Visualizer

  • Source - Points generation source
  • 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.
  • Approximate Number Of Points - Number of points to generate, some algorithms may not generate exact number of points.
  • Seed - Random number generator seed
  • Colors
    • 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
  • Color - Constant color
  • Exact Number of Samples - 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
2 Likes

0.9.19 point cloud generation from vertices and particles

5 Likes

another update:
0.9.20 ui changes, poisson disk sampling generation, size and alpha available in edit mode, various fixes, removed manual depth sorting during render

  • PCV have its own tab now
  • added poisson disk sampling to cloud generation, but beware, it is very slow, but it can generate colors from uv texture, vertex colors, vertex group, like other generators, but it’s slow…
  • point size and alpha is now available during edit mode
  • opengl rendering is now much faster because i sorted out :slight_smile: how to leave depth sorting on opengl instead doing it in python
  • addon file is now space_view3d_point_cloud_visualizer.py to match naming conventions

2 Likes

0.9.21 preferences

in last update i moved pcv to its own tab, which with its full name took a lot of vertical space, so now you can choose between full name or ‘PCV’ and also with custom tab name choose one of existing, like ‘View’ to get the same (almost) behavior as before…


Addon Preferences:

Point Cloud Visualizer

  • 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
2 Likes

0.9.22 extra debug shaders
depth, normal and position extra debug shaders, also fixed display of normals as lines not being affected by alpha…
now i am out of new ideas…

2 Likes

Wonderful work…very impressive add on. I am not sure if you could create a View Limit Box? Or Section Tool for the pointcloud? This allows the modeler to view only small slices or areas at a time as the modeler works to match the edges. Example images shown below of other software packages approach to the same issue.


Boolean

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

Thank you for your reply. Your suggestion does work.
What I was suggesting is a Live sectioning tool. As you slide the faces in and out the view of the cloud would be sliced.
This would be very useful in all of blender. You could use the Outliner to check on or off the objects that would be sliced by the Interactive Section box (See the handles in the image above) you can push and pull them to resize and interactively slice the View of the data and not a permit slice.
I am still taking Python courses and writing simple code. I hope to be able to be of some help on these types of projects in the future.

hi, i’ll have a look at it, looks like something that can be done at shader level… for now use boolean as suggested. i have an idea how to make it significantly faster on dense clouds in works…

1 Like