Closed ctbur closed 2 years ago
The normal converters can only convert PhPoint
instances. I think it would be good if you could use the same converter that is used for the PhTree itself. I see two options:
1) Extend one of the existing converters and add pre()
/post()
functions for scalars. This could then be used to also create the PhTree itself.
2) Adapt the filter to work with PhPoint
s.
<
/ >
to identify/create the closest corner point of the node to the sphere center. The result is an internal point. (It is safe to compare internal scalars, but it is not safe to add/substract/multiply/... them).Thanks. Approach 2. worked and gave a much cleaner result. We actually just need to clamp the center point in the node's AABB to get the closest distance, so only comparisons are needed, no calculations.
LGTM. Nice contribution, thanks!
Changes
Add the
FilterSphere
filter than can filter points for a sphere given a center and a radius.Unfortunately I had to use a scalar converter that needs to be hand-picked and match the multidimensional converter used in the tree. Please let me know how it can be improved.
Verification
Added a test case.