Query results and helpers shared by PointCloudBVH and PointCloudHashGrid.
Both structures answer the same queries with the same Hit type, so code written against one works with the other. A point is identified by its cloud index: its position in the positions array the structure was built from. Per-point user data lives in the caller's own array, indexed by it.
template<class T >
| std::size_t EBGeometry::PointCloud::closestPointsBruteForce |
( |
const Vec3T< T > * |
a_positions, |
|
|
const uint32_t |
a_numPoints, |
|
|
const Vec3T< T > & |
a_query, |
|
|
const std::size_t |
a_k, |
|
|
Hit< T > * |
a_out, |
|
|
const uint32_t |
a_exclude = InvalidIndex |
|
) |
| |
|
inlinenoexcept |
The a_k points of a cloud nearest to a query point, by a full scan.
An O(N) reference for checking PointCloudBVH and PointCloudHashGrid, never a hot path. It follows their result contract: the buffer is filled in ascending order of distance, and the count found is returned. For a self-query (the nearest other points to cloud point i), pass that point's position as a_query and i as a_exclude. Callable on the host and on a device.
- Template Parameters
-
| T | Floating-point precision. |
- Parameters
-
| [in] | a_positions | Point positions, indexed by cloud index. May be null if a_numPoints is 0. |
| [in] | a_numPoints | Number of points. |
| [in] | a_query | Query point. |
| [in] | a_k | Number of neighbors wanted. Must be > 0. |
| [out] | a_out | Buffer of at least a_k Hits. |
| [in] | a_exclude | Cloud index never to report, or InvalidIndex. |
- Returns
- The number of neighbors found: min(a_k, number of points not excluded).