[pstricks] Suggestion for pst-circ

Alan Ristow ristow at ece.gatech.edu
Thu Oct 11 17:31:06 CEST 2007

Hi all,

I recently created a circuit diagram with pst-circ (nice work, by the 
way -- it was far easier than I anticipated). However, I noticed that 
when resistors are drawn with dipolestyle=zigzag the point where the 
resistor and the wire join is not very smooth. I made a minor change to 
\pst at draw@dipole (only a couple of arrow styles from "-" to "-C") and 
find the result much more satisfactory.

My hacked version of \pst at draw@dipole appears below, with my changes 
flagged by a comment. I have no idea whether my change might mess up 
other symbols, but if it does not I would like to suggest that 
Christophe and/or Herbert incorporate it into the package. (I also note 
that I only changed the arrow styles for two of the \pcline commands 
after the final \else, so the code for parallel circuits still needs 
updating and testing.)

Just an idea I thought I'd share....


     \def\pst at draw@dipole#1#2#3#4#5{%
       \if\psk at I@label\@empty\else\psset{intensity=true}\fi
       \if\psk at tension@label\@empty\else\psset{tension=true}\fi
       \ifx\psk at Dconvention\pst at Dconvention@generator
         \Pst at Dconventiontrue
         \ifx\psk at Dconvention\pst at Dconvention@receptor
           \Pst at Dconventionfalse
       \ncput[nrot=:U]{\pnode{dipole at M}}
       \ifPst at parallel
         \pcline[arrows=-,linestyle=none,fillstyle=none](#2)(dipole at M)
         \ncput[npos=\psk at parallel@sep]{\pnode{dipole@@1}}
         \pcline[arrows=-,linestyle=none,fillstyle=none](#3)(dipole at M)
         \ncput[npos=\psk at parallel@sep]{\pnode{dipole@@2}}
\pcline[arrows=-,linestyle=none,fillstyle=none,offset=\psk at parallel@arm](dipole@@1)(dipole@@2)
         \pcline[arrows=-](dipole@@@1)(dipole at 1)
         \pcline[arrows=-](dipole at 2)(dipole@@@2)
         \ifPst at parallel@node
\pcline[arrows=-,linestyle=none,fillstyle=none,offset=\psk at label@offset](dipole@@@1)(dipole@@@2)
         \ncput[nrot=\psk at label@angle]{#4}
         \pst at intensity{dipole@@@1}{dipole@@@2}
         \pst at tension{dipole@@@1}{dipole@@@2}
\pcline[arrows=-,linestyle=none,fillstyle=none,offset=\psk at label@offset](#2)(#3)
         \ncput[nrot=\psk at label@angle]{#4}
         % CHANGES HERE!!!
         \pcline[arrows=-C](#2)(dipole at 1)
         \pcline[arrows=C-](dipole at 2)(#3)
         \pst at intensity{#2}{#3}
         \pst at tension{#2}{#3}

More information about the PSTricks mailing list