[pstricks] multiple switch possible?
Herbert Voss
Herbert.Voss at alumni.TU-Berlin.DE
Wed Sep 17 10:57:50 CEST 2003
Patrick Drechsler sagte:
> I'm looking for a way to display a switch between more than 3 objects
> (\switch and \Tswitch only appear to connect 2 and 3
> points/objects). Is this possible with PSTricks?
there are different possibilities
Herbert
> \documentclass{article}
\usepackage{pst-circ}
\begin{document}
%
\begin{pspicture}(5,6)
\psgrid[subgriddiv=1,griddots=10]
% resistor nodes:
\pnode(1,6){atop}
\pnode(1,4){amid}
\pnode(2,2){abot}
\pnode(2,6){btop}
\pnode(2,4){bmid}
\pnode(2.3,2.1){bbot}
\pnode(3,6){ctop}
\pnode(3,4){cmid}
\pnode(2.7,2.1){cbot}
\pnode(4,6){dtop}
\pnode(4,4){dmid}
\pnode(3,2){dbot}
\pnode(2.5,3){switchbottom}
% battery and lamp nodes:
\pnode(5,6){battery1}
\pnode(5,3){battery2}
\pnode(5,0){lamp}
% switch:
\pnode(2.5,0){myswitch}
% setup:
\resistor(atop)(amid){}
\psline[arrows=-o](amid)(abot)
\resistor(btop)(bmid){}
\psline[arrows=-o](bmid)(bbot)
\resistor(ctop)(cmid){}
\psline[arrows=-o](cmid)(cbot)
\resistor(dtop)(dmid){}
\psline[arrows=-o](dmid)(dbot)
\wire(atop)(battery1)
\battery(battery1)(battery2){}
\lamp(battery2)(lamp){}
\wire(lamp)(myswitch)
% not good...:
\switch(myswitch)(switchbottom){}
\psline[linecolor=white](2.5,2)(2.5,3)
\end{pspicture}
\end{document}
--
Dr.-Ing Herbert Voss
Herbert.Voss at alumni.TU-Berlin.DE
More information about the PSTricks
mailing list