I am new to tikz and am using it to draw cylinders. I understand how to invoke cylinder body fill to completely fill one, but I also need some cylinders that are only shaded to a certain height. Is there a built in parameter for cylinder that automates this? Looking at p433 of the documentation and searching this forum, I don't see one. If so, I'd like to learn it.
If not, I was thinking I'd just overlay two cylinders---one "body filled" with blue, the other, shorter one filled with white---to achieve the desired effect. I can do that, so I'm not asking for code. I'm more wondering if this is how veteran tikz users think about this problem.
Edit: Adding my (admittedly inelegant) code.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc,shapes,decorations.markings}
% Syntax: \Cylinder{<x-coordinate>}{<y-coordinate>}{<name>}
\newcommand\whitebodyCylinder[3]{%
\tikzset{Cylin/.style={cylinder, shape border rotate = 90, draw, cylinder uses custom fill,
cylinder end fill = white, cylinder body fill = white, minimum height = 4cm,
minimum width = 3cm, opacity = 1, aspect = 2.5}}
\node[Cylin] (#3) at (#1,#2) {};
}
\newcommand\bluebottomCylinder[3]{%
\tikzset{Cylin/.style={cylinder, shape border rotate = 90, draw, cylinder uses custom fill,
cylinder end fill = blue!20, cylinder body fill = blue!20, minimum height =2cm,
minimum width = 3cm, opacity = 1, aspect = 2.5}}
\node[Cylin] (#3) at (#1,#2) {};
\draw[dashed] (#1+1.5,-.5+#2) arc [start angle=0, end angle=180,
x radius=1.5cm, y radius=3mm];
}
\begin{document}
\begin{tikzpicture}
\whitebodyCylinder{0}{0}{}
\bluebottomCylinder{0}{-1}{}
\end{tikzpicture}
\end{document}

