g[t_] := Which[
0≤(τ=t)<1, {-Cos[3π τ], Sin[3 π τ], 2τ-1},
0≤(τ-=1)<1, {2-Cos[π τ], 0, 1+Sin[π τ]},
0≤(τ-=1)<1, {3, 0, 1-2τ},
0≤(τ-=1)<1,  {2+Cos[π τ],0,-1-Sin[π τ]},
0≤(τ-=1)<1,  {Cos[3π τ], -Sin[3 π τ], 2τ-1},
0≤(τ-=1)<1, {-2+Cos[π τ], 0, 1+Sin[π τ]},
0≤(τ-=1)<1, {-3, 0, 1-2τ},
0≤(τ-=1)≤1,  {-2-Cos[π τ],0,-1-Sin[π τ]}
]

g1[t_] := g[t] /. {
{x_,y_,z_} /; -1≤z≤1 :> {x,y,3z},
{x_,y_,z_} /; z>1 :> {x,y,z+2},
{x_,y_,z_} /; z<-1 :> {x,y,z-2}
}

Manipulate[
Graphics3D[Tube[
Table[g[t], {t, 0,8, 0.01}], 0.1
], PlotRange->{All, All,{-2.1, Z}}],
{{Z, 2.1}, -2.1,2.1}
]

Manipulate[
Graphics3D[Tube[
Table[g[t], {t, 0,8, 0.1}], 0.1
], PlotRange->{All, All,{Z-0.01, Z+0.01}}],
{{Z, 2.1}, -2.1,2.1}
]

Manipulate[
Graphics3D[Tube[
Table[g1[t], {t, 0,8, 0.01}], 0.1
], PlotRange->{All, All,{-4.1, Z}}],
{{Z, 4.1}, -4.1,4.1}
]