|
Blender V5.3
|
Classes | |
| struct | Node |
| class | NearestQuery |
| class | FilteredNearestQuery |
| class | NearestNQuery |
| class | RadiusQuery |
Concepts | |
| concept | FilterFn |
| concept | QueryType |
Functions | |
| template<typename Query, typename ValueT> | |
| bool | keep_distance (const ValueT distance_sq, const ValueT max_distance_sq) |
| template<typename T> | |
| int | calc_duplicates (const KDTreeNew< T > &tree, typename T::base_type range, Span< int > visit_order, MutableSpan< int > duplicates) |
| template<typename T> | |
| int | calc_duplicates (const KDTreeNew< T > &tree, typename T::base_type range, const IndexMask &visit_order, MutableSpan< int > duplicates) |
| template<typename T> | |
| int | calc_duplicates (const KDTreeNew< T > &tree, const typename T::base_type range, const MutableSpan< int > duplicates) |
| template<typename T, typename ForeachFn> | |
| static int | calc_duplicates_impl (const KDTreeNew< T > &tree, const typename T::base_type range, const MutableSpan< int > duplicates, const ForeachFn foreach_index) |
| template int | calc_duplicates (const KDTreeNew< float2 > &, float, Span< int >, MutableSpan< int >) |
| template int | calc_duplicates (const KDTreeNew< float3 > &, float, Span< int >, MutableSpan< int >) |
| template int | calc_duplicates (const KDTreeNew< float2 > &, float, const IndexMask &, MutableSpan< int >) |
| template int | calc_duplicates (const KDTreeNew< float3 > &, float, const IndexMask &, MutableSpan< int >) |
| template int blender::kdtree::calc_duplicates | ( | const KDTreeNew< float2 > & | , |
| float | , | ||
| const IndexMask & | , | ||
| MutableSpan< int > | ) |
References calc_duplicates().
| template int blender::kdtree::calc_duplicates | ( | const KDTreeNew< float2 > & | , |
| float | , | ||
| Span< int > | , | ||
| MutableSpan< int > | ) |
References calc_duplicates().
| template int blender::kdtree::calc_duplicates | ( | const KDTreeNew< float3 > & | , |
| float | , | ||
| const IndexMask & | , | ||
| MutableSpan< int > | ) |
References calc_duplicates().
| template int blender::kdtree::calc_duplicates | ( | const KDTreeNew< float3 > & | , |
| float | , | ||
| Span< int > | , | ||
| MutableSpan< int > | ) |
References calc_duplicates().
|
inline |
calc_duplicates visiting the points in the order the tree stores them, measured to be roughly 1.1x to 1.8x faster than providing a separate visit order as the point count increases to ~ 1 million, though that depends on the spatial contiguity of the original point order. The downside is that this ties the result to the internal layout, so it is only meant for callers that don't care which point of a cluster the others merge into. See #KDTreeNew::indices.
Definition at line 484 of file BLI_kdtree_new.hh.
References calc_duplicates(), and blender::KDTreeNew< T >::tree_indices().
| int blender::kdtree::calc_duplicates | ( | const KDTreeNew< T > & | tree, |
| typename T::base_type | range, | ||
| const IndexMask & | visit_order, | ||
| MutableSpan< int > | duplicates ) |
Definition at line 881 of file kdtree.cc.
References blender::BLI_assert(), calc_duplicates(), calc_duplicates_impl(), blender::index_mask::IndexMask::foreach_index_optimized(), blender::index_mask::IndexMask::size(), and blender::KDTreeNew< T >::size().
| int blender::kdtree::calc_duplicates | ( | const KDTreeNew< T > & | tree, |
| typename T::base_type | range, | ||
| Span< int > | visit_order, | ||
| MutableSpan< int > | duplicates ) |
Group points that are within range of each other, favoring speed over quality: each point is merged into the first point that claims it rather than into its closest neighbor. Points are visited in visit_order, which must contain every point in the tree.
Which point of a cluster the others merge into follows from that order alone, since a point claims every unclaimed point in range of it whatever order the search finds them in. Visiting them in a fixed order, their index order for example, therefore keeps the result from depending on the tree's layout and so on where the points are.
| duplicates | Indexed by point index, so it must be large enough for the largest index in the tree. Points with a value of -1 are candidates to be merged into another point. Presetting a point to its own index keeps it from being merged into anything, though it can still become the target other points merge into. When the function returns, a merged point holds the index of the point it was merged into, and a point that others were merged into holds its own index. Points that are neither are left at -1. |
Definition at line 867 of file kdtree.cc.
References blender::BLI_assert(), calc_duplicates(), calc_duplicates_impl(), blender::KDTreeNew< T >::size(), and blender::Span< T >::size().
Referenced by calc_duplicates(), calc_duplicates(), calc_duplicates(), calc_duplicates(), calc_duplicates(), calc_duplicates(), calc_duplicates(), blender::nodes::node_geo_cluster_by_distance_cc::ClusterByDistanceFieldInput::get_varray_for_context(), blender::geometry::mesh_merge_by_distance_all(), blender::geometry::point_merge_by_distance(), blender::TEST(), blender::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), and blender::tests::TEST().
|
static |
Definition at line 835 of file kdtree.cc.
References blender::BLI_assert(), calc_duplicates_impl(), blender::KDTreeNew< T >::foreach_in_radius(), blender::KDTreeNew< T >::points(), blender::MutableSpan< T >::size(), and T.
Referenced by calc_duplicates(), calc_duplicates(), and calc_duplicates_impl().
|
inline |
Whether a distance is close enough for Query to still be interested in it.
Definition at line 433 of file BLI_kdtree_new.hh.
References keep_distance().
Referenced by keep_distance().