Irregular shaped point clouds
I need to display an irregular shaped point cloud (xyz points) surface in 3d, with contours/isolines. In the examples using heightmaps, data is always either square or rectangular.  Should I be using a heightmap, or some other type of mesh to display these surfaces? For example if my cloud of points forms a circle, I want only show those points within the circle in the 3d surface and not draw anything outside the circle.
It is currently not possible to create a 3D surface from irregular point cloud. Also contour lines can be calculated only from height map.

But you may be able to convert a point cloud into height data - a 2-dimensional array where each array element contains a height value. This may be created from point cloud by going through each position and first determine into which array element the position would go (for example convert x,z => array[xIndex, yIndex]; xIndex = ((x - xMin) / (xMax - xMin)) * arrayXDimension). Then add the y values into the array (and have another array that will count the number of items in each array item - this is needed to average the value at the end). I hope that is this not described in too complicated way.

When you have that you can use a height map to show the surface and calculate contour lines.

I have just updated the contour lines sample so that the sample shows how to hide the parts of the surface with zero values (see the updated code on GitHub: and

This is not ideal but depanding on the data may in same case give you results that are good enough.
Andrej Benedik
Thanks for the example--that seems to work fine for what I want to accomplish.  I currently have a 2D version (not using Powertoys) where I triangulate the point cloud and use the triangles and vertex elevations to return elevations at any arbitrary point within the cloud. I also use the triangulation to calculate contours.  I'm hoping to do all of that with Powertoys in 3d.  I am assuming I can also somehow return the elevation of any arbitrary point within the heightmap with Powertoys directly.    I also wanted to turn off the wirebox axis', and there is checkbox for that in the example, but it didn't seem to work. You could turn of the scale, but not the wirebox.  I know you can do that from your other examples, so that part is just FYI.  Thanks very much for your time.

Forum Jump:

Users browsing this thread:
1 Guest(s)