I want to get a consistent zigzag line that will be used to mimic a physical spring.
\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-coil,multido}
\usepackage[nomessages]{fp}
\FPset\CoilArm{.2}
\FPset\Windings{7}
\psset
{
coilarm=\CoilArm,
linejoin=1,
}
\def\System#1#2{% #1: total length includes the arms, #2: coil width
\FPeval\CoilWidth{trunc(#2,9)}%
\FPeval\CoilHeight{trunc((#1-2*CoilArm)/(CoilWidth*Windings),9)}%
\pszigzag[coilwidth=\CoilWidth,coilheight=\CoilHeight](1,0)(1,-#1)%
\ignorespaces
}
\begin{document}
\begin{pspicture}(13,-7)
\multido{\nx=0+1.25,\nl=2.50+.50,\nw=1.00+-0.10}{10}{\rput(\nx,0){\System{\nl}{\nw}}}
\end{pspicture}
\end{document}
In the figure below, the red cross represents inconsistent zigzag lines as its top end begins with a different orientation of segment.

I have increased the precision of trunc by choosing a large number of digit. But it does not seem to work. How to solve this issue?
Facts
One method to get rid of this inconsistency is by choosing a constant coilwidth. However, with constant coilwidth the animation will not look realistic anymore. That is the problem.
