a=0.5;k=1.0;k'=0.5;m=1.0;d=1.0;h=0.1;l=1.0;
T=4Pi/(Sqrt[(k+2k')/m]-Sqrt[k/m]);sep=0.5;

x1[t_]:=a/2(Cos[Sqrt[k/m]t]-Cos[Sqrt[(k+2k')/m]t]);
x2[t_]:=a/2(Cos[Sqrt[k/m]t]+Cos[Sqrt[(k+2k')/m]t]);
Obj1=Cuboid[{x1[t]-d/2-h/2,0-h/2,0-h/2},{x1[t]-d/2+h/2,0+h/2,0+h/2}];
Obj2=Cuboid[{x2[t]+d/2-h/2,0-h/2,0-h/2},{x2[t]+d/2+h/2,0+h/2,0+h/2}];
ListAnimate[Table[
	Show[
		Graphics3D[{Obj1,Obj2}],
		
ParametricPlot3D[{u,
                  h/2 Cos[30(l-x1[t])/l u],
                  h/2 Sin[30(l-x1[t])/l u]
                 },
                 {u,-d/2-l,x1[t]-d/2},
                 DisplayFunction->Identity
],
ParametricPlot3D[{u,
                  h/2 Cos[30(l+x2[t])/l u],
                  h/2 Sin[30(l+x2[t])/l u]
                 },
                 {u,+d/2+l,x2[t]+d/2},
                 DisplayFunction->Identity
],
ParametricPlot3D[{u,
                  h/2 Cos[50(l+x1[t]-x2[t])/l u],
                  h/2 Sin[50(l+x1[t]-x2[t])/l u]
                 },
                 {u,x1[t]-d/2,x2[t]+d/2},
                 DisplayFunction->Identity
]

	],{t,0,T,sep}
]
]