BA_PointCloud icon indicating copy to clipboard operation
BA_PointCloud copied to clipboard

Measurement from point cloud

Open TuomasK1989 opened this issue 4 years ago • 7 comments

What would be the easiest and most accurate way of taking measurement (point xyz coordinates) from this point cloud rendering system? I guess raycasting is not working.

TuomasK1989 avatar Jun 08 '20 16:06 TuomasK1989

Hi. I'm not sure if I understand your question. What do you mean by "taking measurement"? I imagine you might mean selecting a point by clicking. In that case, my framework does not provide a way to do this. If you want to implement this yourself, you can iterate over the octree nodes and check which ones intersect the ray through the selected pixel. There is also a fancy GPU-based way to do this. Checkout chapter 5.3.1 of Markus Schütz's Potree-Master-Thesis for more info: https://publik.tuwien.ac.at/files/publik_252607.pdf (however I'm not sure how hard or easy it would be to implement this in Unity).

SFraissTU avatar Jun 08 '20 17:06 SFraissTU

Hi, Thanks for the hints. that is exactly what I meant. What do You think that could this be on the development roadmap as I am a novice when it comes to coding this stuff? In my opinion this is a must feature that users can pick points and measure distances from surveyed point clouds.

TuomasK1989 avatar Jun 16 '20 08:06 TuomasK1989

I have now managed to get the node/gameobjects names that are intersecting ray. Now would need to get the point data that is inside each octree node. Can I somehow list all points that are inside a node using nodes name? Also I would like to use only rendered points so is this possible to do without reloading data into memory?

TuomasK1989 avatar Jun 23 '20 05:06 TuomasK1989

Hi! Here are some hints that might be useful for you:

  • If you have a Node-object, its points should be accessible via the property VerticesToStore. The coordinates of the points in this array are relative to the origin of the bounding box of the node.
  • If a node is rendered, all of its points are rendered.
  • If you want to know whether a node is rendered, V2TraversalThread has an attribute "visibleNodes", which is a set of all the nodes that are currently being displayed (just take care about synchronization, as this is constantly updated).

SFraissTU avatar Jun 23 '20 12:06 SFraissTU

Hi,

@SFraissTU Thanks for having time to answer to my question. At the moment I only have gameobjects and their names and I am trying to find a way how to access Node-object and the VerticesToStore. Can I somehow get Node-object with the gameobjects name?

TuomasK1989 avatar Jun 30 '20 09:06 TuomasK1989

Hi! Sorry for my late response. Yes that should be possible. The game object name has the syntax "[pointcloudname]/r[nodeaddress] ([#points])" In V2Renderer there is the attribute rootNodes. The root node of each point cloud is in there. You can iterate over the root nodes and check if node.metadata.cloudName is equal to [pointcloudname] to find the right root node. Once you have the right root node, you can find the right child using the digits of the address. If the address is empty, then the root node is the desired node. Otherwise, you can get there through the children. For example if the nodeaddress is "2431", then that node is rootNode.getChild(2).getChild(4).getChild(3).getChild(1).

SFraissTU avatar Jul 12 '20 13:07 SFraissTU

Hi, I managed to get this work relatively fine. I added reference pointer to the node itself during the gameobject creation so that every gameobject has corresponding node component in it.

TuomasK1989 avatar Aug 14 '20 12:08 TuomasK1989