I am trying to define a decorator that draws a screw between the two connected points. Until now this is what I have:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations}
\pgfdeclaredecoration{screw}{initial}
{
\state{initial}[width=1.5pt,next state=midd]
{
% First line
\pgfpathlineto{\pgfpoint{0.0pt}{3.0pt}}
\pgfpathlineto{\pgfpoint{1.5pt}{1.5pt}}
% Second line
\pgfpathmoveto{\pgfpoint{0.0pt}{0.0pt}}
\pgfpathlineto{\pgfpoint{0.0pt}{-3.0pt}}
\pgfpathlineto{\pgfpoint{1.5pt}{-1.5pt}}
}
\state{midd}[width=3.2pt]
{
% First line
\pgfpathmoveto{\pgfpoint{0pt}{1.5pt}}
\pgfpathlineto{\pgfpoint{0.6pt}{2.0pt}}
\pgfpathlineto{\pgfpoint{1.6pt}{1.5pt}}
\pgfpathlineto{\pgfpoint{2.6pt}{1.0pt}}
\pgfpathlineto{\pgfpoint{3.2pt}{1.5pt}}
% Second line
\pgfpathmoveto{\pgfpoint{0pt}{-1.5pt}}
\pgfpathlineto{\pgfpoint{0.6pt}{-2.0pt}}
\pgfpathlineto{\pgfpoint{1.6pt}{-1.5pt}}
\pgfpathlineto{\pgfpoint{2.6pt}{-1.0pt}}
\pgfpathlineto{\pgfpoint{3.2pt}{-1.5pt}}
}
\state{final}
{
%\pgfpathlineto{\pgfpointdecoratedpathlast}
\pgfpathmoveto{\pgfpoint{0pt}{1.5pt}}
\pgfpathlineto{\pgfpoint{2.0pt}{0pt}}
\pgfpathlineto{\pgfpoint{0pt}{-1.5pt}}
}
}
\begin{document}
\begin{tikzpicture}[scale=1]
\draw[decorate,decoration=screw] (0,100pt) -- (0,0);
\end{tikzpicture}
\end{document}
I would like to be able to change the amplitude and the spacing of the threads, too. How can I do this?

coildecoration and seeing how it introduces parameters. – Andrew Swann Aug 16 '16 at 14:24pic- not a picture. Is your question solved? If so, it would be better to present your solution as an answer, rather than incorporating it into the question. The question space is best reserved for ... , well, for questions, really ;). – cfr Aug 18 '16 at 22:53