The code below makes a bank of cylinders (acceptable). I am trying to make two more banks of cylinders at right angles to this. The second is in a parallel plane such that looking normal through both there are empty square apertures. The third is a bank with cylinders normal to the plane which penetrate the square apertures.
I have tried a variety of rotations and can't seem to master the transforms needed.
The goal is to create a mesh which can be parameterized such that the cylinders are thin and don't get close to touching in one expression, or the cylinders are thick and overlap in another.
One way to think about this is the arrangement of subway tubes in New York City where they must pass without touching, including the elevator shafts going down to the platforms.
MWE
\documentclass[12pt]{article}
\usepackage{tikz}
\usetikzlibrary{backgrounds,shapes}
\listfiles
\begin{document}
\newcommand\Cylinder[3]{%
\begin{scope}
\tikzset{every node/.style={
cylinder,
rotate=#3,
draw,
cylinder uses custom fill,
cylinder end fill=white!25!black,
cylinder body fill=white!60!black,
minimum height=10cm,
minimum width=0.1cm,
opacity=.4}}
\node at (#1,#2) {};
\end{scope}
}
\begin{tikzpicture}
[background rectangle/.style={fill=yellow!45!white},
show background rectangle]
\foreach \y in {0,1,2,3,4,5,6,7,8,9}{
\Cylinder{0}{\y}{0}
}
\end{tikzpicture}
\end{document}
Thank you S.c.!!!!!! After guidance by S.c. Here is a MWE doing almost exactly what I wanted.
\documentclass[12pt]{article}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usetikzlibrary{backgrounds,shapes}
\tikzset{pics/simple 3d cylinder/.style={code={
\tikzset{simple 3d cylinder/.cd,#1}
\def\pv##1{\pgfkeysvalueof{/tikz/simple 3d cylinder/##1}}%
\tdplotsetrotatedcoords{\pv{alpha}}{\pv{beta}}{0}
\begin{scope}[tdplot_rotated_coords]
\draw[simple 3d cylinder/mantle,line width=2*\pv{r}*1cm]
(0,0,-\pv{h}/2) -- (0,0,\pv{h}/2);
\pgfmathtruncatemacro{\itest}{sign(
sin(\tdplotmaintheta)*sin(\tdplotmainphi)*cos(\pv{alpha})*sin(\pv{beta})
-1*sin(\tdplotmaintheta)*cos(\tdplotmainphi)*sin(\pv{alpha})*sin(\pv{beta})
+cos(\tdplotmaintheta)*cos(\pv{beta})
)}
\unless\ifnum\itest=0
\path[fill,simple 3d cylinder/mantle]
plot[variable=\t,domain=0:360,smooth cycle]
({\pv{r}*cos(\t)},{\pv{r}*sin(\t)},{-\itest*\pv{h}/2});
\path[fill,simple 3d cylinder/top]
plot[variable=\t,domain=0:360,smooth cycle]
({\pv{r}*cos(\t)},{\pv{r}*sin(\t)},{\itest*\pv{h}/2});
\fi
\end{scope}
}},
simple 3d cylinder/.cd,
r/.initial=0.1,
h/.initial=10,
alpha/.initial=0,
beta/.initial=0,
top/.style={fill=gray},
mantle/.style={black}
}
\listfiles
\begin{document}
% TODO build chopstick mesh up from the bottom to satisfy hiddenness
\tdplotsetmaincoords{70}{126}
\noindent
\begin{tikzpicture}[tdplot_main_coords,scale=0.95]
% actin vertical
\path foreach \X in {0,...,10} {
(-0.5,\X-0.5,-5)
pic{
simple 3d cylinder=
{mantle/.style={blue},h=12}
}
};
% actin horizontal
\path foreach \X in {0,...,10} {
(0,4.5,-\X)
pic{
simple 3d cylinder=
{mantle/.style={red},h=12,alpha=90,beta=90}
}
};
% Calcium crosslink
\foreach \Z in {0,...,10} { \foreach \Y in {0,...,10} {
\shade [ball color=gray] (-0.2,\Y-0.3,-\Z-0.1)
circle [radius=0.2cm]; % 0.2 some, 0.7 complete
}}
% neurofibril
\path foreach \X in {1,...,10} {
(3.5,-0.5,-\X)
pic{
simple 3d cylinder=
{h=9.2,beta=90}
}
};
\end{tikzpicture}
\noindent\rule{\textwidth}{1pt}
\end{document}


