Closed manuel-koch closed 1 year ago
Hi @manuel-koch ,
thanks for reporting. Unfortunately, I don't have any issue in my environment:
Did you install distance3d via pip or from source code? (I'd suggest to install the latest master branch.) Could you try numpy 1.23.5?
If all that does not work, could you try to debug this case? What are the values of the variables before this assert is reached, etc.?
I installed distance3d via pip. Retried with numpy==1.23.5 with same assertion error.
Will try to debug next week...
Please test it with the latest commit from master. It contains this commit:
https://github.com/AlexanderFabisch/distance3d/commit/488db39578d7b8d4da7251527083ede721cbd622
I found the assert to be too strict.
Thanks for the hint, I patched the installed python code and the assertion is gone :-) Any plans to do a new release on PyPi for this issue ?
I should do it as soon as possible. You can keep the issue open to remind me.
While adapting to the latest commit, I noticed that functionality moved / API changed.
Could you make this aabb check a public method (again) ?
My former code looked like
# collider_a: colliders.ConvexCollider, collider_b: colliders.ConvexCollider
aabb_a: = collider_a.aabb()
aabb_b = collider_b.aabb()
if not aabb_a.overlaps(aabb_b):
return False
and now I'm using this protected/internal method instead
from distance3d.aabb_tree import _aabb_overlap
# collider_a: colliders.ConvexCollider, collider_b: colliders.ConvexCollider
aabb_a: = collider_a.aabb()
aabb_b = collider_b.aabb()
if not _aabb_overlap(aabb_a, aabb_b):
return False
Previously, we used an external library for aabbtrees. Now we switched to our own implementation in numba.
@MaartenBehn is there any good reason why we did not make the function public? If not, I think we can just remove the underscore.
_aabb_overlap, _sort_aabbs, _merge_aabb, _aabb_volume, _aabb_x_size, _aabb_y_size, _aabb_z_size are all pure helper function used by the aabb_tree code. They don't have any side effects and could be made public if that is prefered.
Thanks. I will only expose aabb_overlap
though. YAGNI.
I've pushed these changes to the master branch and I will now make a new release.
... and I just released 0.8.0.
I'm struggling with an issue when calculating the distance between two overlapping boxes, i.e. one tall box overlaps another box largely. The following snippet triggers an assertion:
Debugger shows values:
search_direction=[-5.95073547e-17, -2.07708528e-08, -2.07708527e-08]
v_len_sq=0.0
Any idea how to avoid such assertion ?
My environment is