Skip to main content
1 of 2
Daniel Huber
  • 56.4k
  • 2
  • 24
  • 66

Assuming a tube with the z axis as axis and with radius 1. If we bend the tube, we assume that the axis keeps its length, but one half of the tube is compressed and the other stretched. Assuming that the centers of curvature lay on a line with x==cen, z==0, we may define a helper function that calculates the new positions of a point.

cen = 10;
bend[{x_, y_, z_}] := 
 Module[{phi = ArcTan[cen - x, z]}, {x + (cen - x) (1 - Cos[phi]), 
   y, (cen - x) Sin[phi]}]

For clarity, we assemble the points to lines along the tube parallel to the axis:

n = 10;
dat0 = Table[Append[#, z] & /@ CirclePoints[n], {z, 0, 10}] // 
   Transpose;
Graphics3D[Line /@ dat0, Axes -> True]

enter image description here

Now we replace the positions of the points by their bend positions:

dat1 = Map[bend, dat0, {2}];
Graphics3D[Line /@ dat1, Axes -> True]

enter image description here

Daniel Huber
  • 56.4k
  • 2
  • 24
  • 66