Closed cpind closed 2 years ago
Thanks for the report and the fix! Our of curiosity are you able to share how you're using the library? It's always helpful to understand how the project is being used.
I'm building a tool to generate automatic exploded views of CAD models. The viewer is built with Three.js and it relies on an explosion graph for the CAD model. To compute the explosion graph I need to know the distance between each parts or which one are in contact. This is where I use your lib. How it integrate smoothly with Three.js was what got me to use it.
I have couple more fixes to issues that I've run into, I'll submit, just need a bit of a cleaning first.
Thank you for the lib ;-)
Just merged! Let me know what other issues you're looking in to.
Thanks for the fix! And if you can share the work you're doing at some point I'd love to see it.
Hi,
I'm running into an unexpected behaviour with the
bvh.closestPointToGeometry
. Below is a failing test case created to replicate the issue.Test uses the
bvh.closestPointToGeometry
to compute distance between 2 sphere of radius 1, where one sphere is positioned at originnew Vector3(0, 0, 0)
and the other atnew Vector3(3, 0, 0)
. Hence the distance is expected to be closed to1
. Problem is that sometimes distance is way greater than that.The issue only arise for sphere with a greater number of triangles. In test below the 2 first test case passes, ie for
new SphereBufferGeometry(1, 8, 4);
andnew SphereBufferGeometry(1, 16, 8)
but fails fornew SphereBufferGeometry(1, 32, 16)
.Result: