Picking a point in a cloud

Everything DG Kernel: Technical discussions and issues
Post Reply
Aaron Ht
Posts: 1
Joined: Fri Aug 16, 2024 4:03 am

Picking a point in a cloud

Post by Aaron Ht »

Hello,

Is it possible to select/find a point in a point cloud? I can open the set via .csv file OK. So far in my experiments only selection of the whole object works despite I use zoom on and select a single point with a rectangle.

Thank you
Prashant Kande
Posts: 65
Joined: Tue Jun 18, 2024 6:12 am

Re: Picking a point in a cloud

Post by Prashant Kande »

Hi Aaron

We do not have it currently in the core, but it is easy to implement in an application:

Determine the selection rectangle on the screen in pixels, say from mouse down and mouse up events. Loop by all points in the cloud and take its projection to the screen using IView_DG.ProjectToScreen(). If it is inside the rectangle, the 3D point can be listed as selected.

Regards
Prashant Kande
Posts: 65
Joined: Tue Jun 18, 2024 6:12 am

Re: Picking a point in a cloud

Post by Prashant Kande »

Forgot to mention:
The point should be global. Ones stored in the cloud have coordinates relative to the local frame of the entity. So, you need to do:

Code: Select all

IFrame_DG frame = iEntityTheCloud.GetLocation();
PointDg ptGlobal = frame.ToGlobal(pointFromTheGeometry);
PairIntDg pairPixels = iView.ProjectToScreen(ptGlobal);
//...
Post Reply