p = 0.2
q = 0.2617993877991494
f(x) = 1 + cos(x)
g(x) = sin(x)
h(x) = 2 * sin(x / 2)
list1 = Sequence(Sequence[Polygon[(cos(t) + 1, sin(t), s), (cos(t + q) + 1, sin(t + q), s), (cos(t + q) + 1, sin(t + q), s + p), (cos(t) + 1, sin(t), s + p)], t, 0, 6.28319 - q, q], s, -4, 4 - p, p)
list2 = Sequence(Segment[(f(t), g(t), h(t)), (f(t + p), g(t + p), h(t + p))], t, -6.28319, 6.28319, p)
O = (0, 0, 0)
a = Sphere(O, 2)
t = 0.9 (slider from 0 to 12.566370614359172, step 0.1)
P: (f(t), g(t), h(t))
f_x = Derivative(f, x)
g_x = Derivative(g, x)
h_x = Derivative(h, x)
f_{xx} = Derivative(f_x, x)
g_{xx} = Derivative(g_x, x)
h_{xx} = Derivative(h_x, x)
l: sqrt(f_x(t)^(2) + g_x(t)^(2) + h_x(t)^(2))
u = Vector(P, (f(t) + f_x(t) / l, g(t) + g_x(t) / l, h(t) + h_x(t) / l))
m: sqrt(f_{xx}(t)^(2) + g_{xx}(t)^(2) + h_{xx}(t)^(2))
v = Vector(P, (f(t) + f_{xx}(t) / m, g(t) + g_{xx}(t) / m, h(t) + h_{xx}(t) / m))
n: (y(u) * z(v) - y(v) * z(u), z(u) * x(v) - z(v) * x(u), x(u) * y(v) - x(v) * y(u))
w = Vector(P, (f(t) + x(n), g(t) + y(n), h(t) + z(n)))