I want to create an animation with a spring. The winding must be kept constant to make more realistic animation.
The following MWE illustrates the current situation of \pszigzag where it cannot produce a coil with reliable constant winding. I set 7 (a prime number) for the winding but the output oscillates; the output windings are sometimes 6.5 and sometimes 7. The red arrows also show the end corners changing from up to down. Please carefully see the image below and compare among them.

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-coil,multido}
\usepackage[nomessages]{fp}
\FPset\CoilArm{0.5}
\FPset\CoilWidth{.5}
\FPset\Windings{7}
\psset{coilarm=\CoilArm,coilwidth=\CoilWidth,linecolor=blue,linewidth=2\pslinewidth}
\def\SetFactorByLength#1{% #1: total length includes the arms
\FPeval\Factor{round((#1-2*CoilArm)/(CoilWidth*Windings):3)}\ignorespaces
}
\begin{document}
\begin{pspicture}[showgrid](15,-11)
\multido{\ix=5+1,\iy=-1+-1}{10}{%
\SetFactorByLength{\ix}
\pszigzag[coilheight=\Factor](0,\iy)(\ix,\iy)}
\end{pspicture}
\end{document}
Is it possible to get a coil with stable number of windings?

