inline capped cylinder distance function
inline torus distance compute