When picking PointCloud3DTileContent, why is _parsedContent is undefined?

Hello,

I am visualizing point clouds in Cesium using Cesium3DTiles.
I created a Widget that allows me to pick the tiles like this:

handler.setInputAction(function(mouse) {
    var pickedObject = that._scene.pick(mouse.position);
}, ScreenSpaceEventType.LEFT_DOUBLE_CLICK);

Debugging shows that pickedObject is an object with the 'primitive' property, which is a PointCloud3DTileContent.
Usually, I can find the positions of every single point in the '_parsedContent' of the PointCloud3DTileContent. But pickedObject.primitive._parsedContent is undefined.

Why is it undefined? I am picking a point which exists in the current frame.

I hope you can help me.

Kind regards,
Anne

_parsedContent contains all the data when the point cloud is first loaded, but is deleted once the data is uploaded to the GPU so there aren’t two copies of the data. I guess another way of saying this is it’s not currently possible to retrieve point data via picking currently.

Also I’m curious if you have a specific use case in mind. Are you just trying to get the point’s position? Do you also need point properties?

Thanks for your answer.

I’m getting the position using pickPosition(). I don’t want to pick just one point, but select a group of points. When I only pick one point, I get problems if that point dissappears when I zoom out. So I try to select a group of points by picking one point and then create a “bounding sphere” around that point and declare that every other point within that sphere is selected, too. So I am not really selecting points but space that contains points.

So I would need the point itself or at least be able to search the k-d-tree for all neighbor points.
The use case consist of real-time editing point clouds. At least editing some properties, like visibility or category (roof, tree, etc.). Saving those changes is another thing and not part of my current project.

Do you have any hint or advice for me?

I’m not sure I can recommend anything too concretely right now, and I sort of feel the type of editing capabilities you want will have to be coded directly in PointCloud3DTileContent. If you need the positions you can un-comment the line that sets the parsedContent to undefined. You could also investigate using the styling language but I don’t think this is really the right approach.

For editing the best direction at the moment would be to check out the PointCloudBatched demo and the description here. When points are assigned batch ids they can be grouped and their properties/colors/visibility can be changed in a much more flexible way. This will allow pointCloud.getFeature to be accessible. In the worst case you may have to give each point a unique batch id … I’m not sure how large your point clouds are but this could be really inefficient. Even then dynamically changing batch ids to separate points into groups would require some code modifications.

That’s my thought process right now, good luck with this.

For the PointCloudBatched demo, go to the 3D Tiles Sandcastle (http://localhost:8080/Apps/Sandcastle/index.html?src=3D%20Tiles.html&label=Showcases) and change the tileset to PointCloudBatched. It’s a little hard to see but it demonstrates mouse picking of groups of points.

Thanks a lot for your suggestions!

As a workaround I’m using scene.pickPosition() to get the position, and then use scene.pick() to get the PointCloud3DTileContent, and there apply a uniform vec3 to its shader, so at least I can visualize the picked points via distance and color.

I’ll see how that batchID works for my usecases. :slight_smile: