If I have a path in TikZ I can easily decorate it relative to its overall extent. However can I also just add the decoration to its edges?
In my example
\documentclass[tikz]{standalone}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}[decoration={
markings,% switch on markings
mark=% actually add a mark
between positions 0 and 1 step 10mm
with
{
\draw (0pt,-2pt) -- (0pt,2pt);
}
}]
\draw [help lines] grid (3,2);
\draw [postaction={decorate}] (0,0) -- (3,1) -- (2,2) -- (2,1) -- cycle;
\end{tikzpicture}
\end{document}
I only want to have the perpendicular lines at (0,0), (3,1), (2,2) and (2,1).

show path constructionand then set[decoration={show path construction, moveto code={}, lineto code={ \draw [-{Bar[]}] (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast); }, curveto code={ \draw [-{Bar[]}] (\tikzinputsegmentfirst) .. controls (\tikzinputsegmentsupporta) and (\tikzinputsegmentsupportb) ..(\tikzinputsegmentlast); }, closepath code={ \draw [-{Bar[]}] (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast); } }], but not sure if this is misuse or not. – TobiBS Oct 12 '20 at 20:36