I have object in 3d space created from points $P_i(x, y, z)$ from which I can create triangles, and I need to calulate distance from point X to this object.
I try to take 3 points from smallest distance and calulate height of tetrahedron created from this 3 points and X, but this will be not the distance from the object.
So my question is how to calculate this distance.