|
EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
|
Query results and helpers shared by PointCloudBVH and PointCloudHashGrid. More...
Classes | |
| struct | FromArray |
| A source of point positions for the builds that take one (PointCloudHashGrid::build()): an array of Vec3T, read as it is. More... | |
| struct | Hit |
| One query result: the cloud index of a matched point and its squared distance. More... | |
| class | KBest |
| The k nearest points seen so far, kept sorted in a caller-supplied buffer. More... | |
Functions | |
| template<class T > | |
| std::size_t | 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) noexcept |
| The a_k points of a cloud nearest to a query point, by a full scan. | |
| template<class T > | |
| Hit< T > | closestPointBruteForce (const Vec3T< T > *a_positions, const uint32_t a_numPoints, const Vec3T< T > &a_query, const uint32_t a_exclude=InvalidIndex) noexcept |
| The point of a cloud nearest to a query point, by a full scan. | |
Variables | |
| constexpr uint32_t | InvalidIndex = Math::Limits<uint32_t>::max() |
| The cloud index of "no point": a miss, or a result slot a query could not fill. | |
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.
|
inlinenoexcept |
The point of a cloud nearest to a query point, by a full scan.
closestPointsBruteForce() with a_k = 1; a miss if every point is excluded or the cloud is empty.
| T | Floating-point precision. |
| [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_exclude | Cloud index never to report, or 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.
| T | Floating-point precision. |
| [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. |
|
inlineconstexpr |
The cloud index of "no point": a miss, or a result slot a query could not fill.
A cloud holds fewer points than this (the constructors check it), so it never names a real point.