Calculating center line of curved pipe

632 Views Asked by At

I want to have have a disk move vertically through a curved pipe. The pipe shape and size will be constant, the overall position and rotation in a 3d space will be random. Is it possible to calculate the centerline of this pipe piece to act as a path for the disk? Is there a function that takes the pipe's position and rotation, and the disk's current position and rotation, and returns where the disk should move to in the next frame?

Here are some instances of the pipes orientation in a 3d space: enter image description here

Here are the measurements of the curved pipe and the circles that define it: The pipe is a 30 degree turn. enter image description here