Page 1 of 1

Picking a point in a cloud

Posted: Fri Aug 16, 2024 4:07 am
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

Re: Picking a point in a cloud

Posted: Mon Aug 19, 2024 4:02 am
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

Re: Picking a point in a cloud

Posted: Wed Aug 21, 2024 5:28 am
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);
//...