Similar to the custom "human" shape resp. the tikzpeople package I'm now looking for nice computer shapes. I'm drawing some diagram showing the collaboration and communication of humans through some server infrastructure. Is there maybe some package for such shapes similar to tikzpeople?
Maybe something like these:
or it can also be as sophisticated as these
So far I could only find this one from texample resp. TeX.SE but this doesn't really satisfy me.
% Three-tier data center architecture
% Author: Claudio Fiandrino
% from http://www.texample.net/tikz/examples/network-topology/ resp. https://tex.stackexchange.com/a/158860/11820
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{backgrounds,calc,shadings,shapes.arrows,shapes.symbols,shadows}
\makeatletter
\pgfkeys{/pgf/.cd,
parallelepiped offset x/.initial=2mm,
parallelepiped offset y/.initial=2mm
}
\pgfdeclareshape{parallelepiped}
{
\inheritsavedanchors[from=rectangle] % this is nearly a rectangle
\inheritanchorborder[from=rectangle]
\inheritanchor[from=rectangle]{north}
\inheritanchor[from=rectangle]{north west}
\inheritanchor[from=rectangle]{north east}
\inheritanchor[from=rectangle]{center}
\inheritanchor[from=rectangle]{west}
\inheritanchor[from=rectangle]{east}
\inheritanchor[from=rectangle]{mid}
\inheritanchor[from=rectangle]{mid west}
\inheritanchor[from=rectangle]{mid east}
\inheritanchor[from=rectangle]{base}
\inheritanchor[from=rectangle]{base west}
\inheritanchor[from=rectangle]{base east}
\inheritanchor[from=rectangle]{south}
\inheritanchor[from=rectangle]{south west}
\inheritanchor[from=rectangle]{south east}
\backgroundpath{
% store lower right in xa/ya and upper right in xb/yb
\southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y
\northeast \pgf@xb=\pgf@x \pgf@yb=\pgf@y
\pgfmathsetlength\pgfutil@tempdima{\pgfkeysvalueof{/pgf/parallelepiped
offset x}}
\pgfmathsetlength\pgfutil@tempdimb{\pgfkeysvalueof{/pgf/parallelepiped
offset y}}
\def\ppd@offset{\pgfpoint{\pgfutil@tempdima}{\pgfutil@tempdimb}}
\pgfpathmoveto{\pgfqpoint{\pgf@xa}{\pgf@ya}}
\pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@ya}}
\pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yb}}
\pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@yb}}
\pgfpathclose
\pgfpathmoveto{\pgfqpoint{\pgf@xb}{\pgf@ya}}
\pgfpathlineto{\pgfpointadd{\pgfpoint{\pgf@xb}{\pgf@ya}}{\ppd@offset}}
\pgfpathlineto{\pgfpointadd{\pgfpoint{\pgf@xb}{\pgf@yb}}{\ppd@offset}}
\pgfpathlineto{\pgfpointadd{\pgfpoint{\pgf@xa}{\pgf@yb}}{\ppd@offset}}
\pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@yb}}
\pgfpathmoveto{\pgfqpoint{\pgf@xb}{\pgf@yb}}
\pgfpathlineto{\pgfpointadd{\pgfpoint{\pgf@xb}{\pgf@yb}}{\ppd@offset}}
}
}
\makeatother
\tikzset{
ports/.style={
line width=0.3pt,
top color=gray!20,
bottom color=gray!80
},
server/.style={
parallelepiped,
fill=white, draw,
minimum width=0.35cm,
minimum height=0.75cm,
parallelepiped offset x=3mm,
parallelepiped offset y=2mm,
xscale=-1,
path picture={
\draw[top color=gray!5,bottom color=gray!40]
(path picture bounding box.south west) rectangle
(path picture bounding box.north east);
\coordinate (A-center) at ($(path picture bounding box.center)!0!(path
picture bounding box.south)$);
\coordinate (A-west) at ([xshift=-0.575cm]path picture bounding box.west);
\draw[ports]([yshift=0.1cm]$(A-west)!0!(A-center)$)
rectangle +(0.2,0.065);
\draw[ports]([yshift=0.01cm]$(A-west)!0.085!(A-center)$)
rectangle +(0.15,0.05);
\fill[black]([yshift=-0.35cm]$(A-west)!-0.1!(A-center)$)
rectangle +(0.235,0.0175);
\fill[black]([yshift=-0.385cm]$(A-west)!-0.1!(A-center)$)
rectangle +(0.235,0.0175);
\fill[black]([yshift=-0.42cm]$(A-west)!-0.1!(A-center)$)
rectangle +(0.235,0.0175);
}
},
}
\begin{document}
\begin{tikzpicture}
\node[server](server 1){};
\end{tikzpicture}
\end{document}
The shape unfortunately is not scalable using e.g. minimum size=1.5cm.
Edit: it is scalable using scale=1.5 and also shape transform. But still this server does not look the best ;-)






transform shapeoption :\node[server,scale=1.5,transform shape](server 1){};– AndréC Sep 05 '19 at 16:05\node[server,scale=1.5](server 1){};does it already. What is thetransform shaperesponsible for? – white_gecko Sep 05 '19 at 16:07transform shapeallow to apply transformations tonode– AndréC Sep 05 '19 at 16:11parallelepipedshape if you do not use its anchors. A simplepicwould do. Also be aware thattransform shapedoes not transform line widths. – Sep 05 '19 at 16:18parallelepipedis not any such projection. If you wish to have a real projection, look at section 63 Three Point Perspective Drawing Library of the pgfmanual v3.1.4b. If you do not want perspective,tikz-3dplotis a great tool. You could store the result in a\savebox. Then usingscalein the nodes containing the\saveboxes is enough. notransform shapeis needed. – Sep 05 '19 at 17:46