What is the way to go from point 1 to 2 while remaining in the region defined by half torus?

17 Views Asked by At

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