I want to make a small technical drawing in tikz
. Cuts in technical drawings are shown with a handwritten line which is realized with the "pencildraw" (derived from another question here). The rest should be straight lines. Because it is a cut, the pattern "north east lines" should fill the whole form.
I added a minimal example here:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{positioning}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{patterns}
\begin{document}
\begin{tikzpicture}[
pencildraw/.style={
decorate,
decoration={random steps,segment length=4pt, amplitude=0.8pt}
},
line cap= round
]
\draw[pencildraw,pattern = north east lines] (0,0) --(2,0)(0,2) --(2,2);
\draw[pattern = north east lines] (0,0) to (0,2)(2,0) to (2,2);
\fill[pattern = north east lines] (0,0) rectangle (2,2);
\end{tikzpicture}
\end{document}
With this approach, the north west lines draw over the handwritten line. Also, the boundaries are not one continuous line, which makes the ends look terrible in cases.