How can I pimp my tube?
\documentclass{scrartcl}
% needs logicpuzzle bundle v1.8
% http://mirrors.ctan.org/graphics/pgf/contrib/logicpuzzle/logicpuzzle.sty
% or replace logicpuzzle -> battleship
\usepackage{logicpuzzle}
\makeatletter
\definecolor{LPlgrey}{rgb}{.8,.8,.8}
\definecolor{LPtgrey}{rgb}{.7,.7,.7}
\definecolor{LPgrey}{rgb}{.5,.5,.5}
\def\myscale{.7}
\newcommand*\LPtunnel%
{%
\begin{tikzpicture}[scale=\myscale]
\fill[color=black] (0,0) -- (0,1) -- (.4,.5) -- (.4,0) -- cycle;
\fill[color=LPgrey] (0,1) -- (1,1) -- (1,.5) -- (.4,.5) -- cycle;
\fill[color=LPlgrey] (.40,0) rectangle (1,.5);
\end{tikzpicture}
}%
\newcommand*\tunnel[2]{\LP@setcellcontent{#1}{#2}{\LPtunnel}}
\newcommand*\tube[3]%
{%
\def\tubepath{%
(#1.5,#2.5)
\foreach \dir in {#3}%
{%
\ifnum\dir=2%
--++(0,-1)%
\fi%
\ifnum\dir=4%
--++(-1,0)%
\fi%
\ifnum\dir=6%
--++(1,0)%
\fi%
\ifnum\dir=8%
--++(0,1)%
\fi%
};}%
\begin{puzzlebackground}
\pgfsetcornersarced{\pgfpoint{3mm}{3mm}}
\draw[color=LPtgrey, line width=.4cm*\myscale] \tubepath;%
\end{puzzlebackground}
}%
\makeatother
\begin{document}
\begin{logicpuzzle}[scale=\myscale]
\tunnel{1}{1}
\tunnel{5}{5}
\tube{1}{1}{6,6,6,6,8,8,8,4,2,4,4,4,8,8,6,6,6,6}
\end{logicpuzzle}
\end{document}
Can I add a decoration like in this picture?
I know I can add a shading (kind of 3D effect) to a rectangle. But it is also possible for such a complex path with a shading based on the angle?
Another important point: It must survive scaling.
Best Answer
Something like that ?