I'd like to draw multi-segment "wavy" paths, so I tried both the standard snake
decoration, and the very promising complete sines
one as well, but in both cases, the segment endpoints are not kept.
Here's an illustration of what I mean. The first rectangle is drawn from single-segment paths, and look great (especially the complete sines
one at the bottom). However, when drawing two segments, or a whole rectangle, in one go, the wavy segments don't end at the intended segment endpoints.
\documentclass[margin=3mm,tikz]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}
\input{sine.tex} %% From https://tex.stackexchange.com/a/60757/2113
\begin{document}
\begin{tikzpicture}
\tikzset
{ wavy/.style={red, decorate, sharp corners, decoration={snake, amplitude=0.4mm}}
, siny/.style={blue, decorate, sharp corners, decoration={complete sines, amplitude=1mm}}
}
\newcommand{\test}[1]{
\begin{scope}[shift={(0,0)}]
\draw (0,0) -- ++ (1,0);
\draw[#1] (0,0) -- ++ (1,0);
\draw (1,0) -- ++ (0,1);
\draw[#1] (1,0) -- ++ (0,1);
\draw (1,1) -- ++ (-1,0);
\draw[#1] (1,1) -- ++(-1,0);
\draw (0,1) -- (0,0);
\draw[#1] (0,1) -- (0,0);
\end{scope}
\begin{scope}[shift={(2,0)}]
\draw (0,0) -- ++ (1,0) -- ++ (0,1);
\draw[#1] (0,0) -- ++ (1,0) -- ++ (0,1);
\end{scope}
\begin{scope}[shift={(4,0)}]
\draw (0,0) rectangle ++ (1,1);
\draw[#1] (0,0) rectangle ++ (1,1);
\end{scope}
}
\begin{scope}[shift={(0,0)}]
\test{wavy}
\end{scope}
\begin{scope}[shift={(0,-2)}]
\test{siny}
\end{scope}
\end{tikzpicture}
\end{document}
Is there a way to get results matching the first column? I'd like to clip by these paths so I think I need to draw them as one multi-segment path.