Basically this is a trajectory planning problem. As shown in figure below, how can I ensure that in moving from a point (x,y,z) to another point within torus, I don't get out of that torus region?
go from (1) to (2) and from (2) to (3) without getting out of torus region