I’m using the minimum distance option on a Ray SOP, and I’m surprised by the results.

For every point on input 1 (box), I want to know the minimum distance to anywhere on the surface of input 2 (sphere).

The sphere has radius 0.3 and the box has radius 0.5. That means the point (0, 0, -.5) is minimally 0.2 away from the surface of the sphere. The Ray SOP correctly calculates this. However, the calculation for (0,0,.5) is 0.8, as if it were calculating to an intersection at the other side of the sphere. Can anyone offer insight? ray_sop_understanding.1.toe (4.61 KB)

Actually, in the case of ‘minimum distance’, normals aren’t required,
but it does seem it’s not acting properly, or well enough.
I’ve logged this as a bug.
Thanks for posting.

Picking up this thread again, what are the latest and greatest ways of doing DFVolume (building a 3D texture of a distance field for a static mesh)? If TD had a sphere collision function we could do a raymarching technique.

I’ve looked into some techniques for similar ideas, and this is all pretty deep into DIY territory. Xenoptik has successfully created 3d octrees of a TD scene as 3d textures for each density, and iirc achieved global illumination with refractions, but it was full of hacks as there are limits to how deep in the opengl pipeline you can get using TD. Heavy preprocessing of sops to stuff values into custom attributes available to shaders seemed to be the key to getting things to work.