summaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-10-14 03:01:58 +0000
committerNorbert Preining <norbert@preining.info>2022-10-14 03:01:58 +0000
commit1c0d5e0721918b8ee790c9f1c11f1543e0403322 (patch)
tree945544ad8dae56580c1578e1d2c96c7fe0fc29eb /graphics
parentba720f8eaac74c537fb16f8556e4cf0ab4cd8235 (diff)
CTAN sync 202210140301
Diffstat (limited to 'graphics')
-rw-r--r--graphics/circuit_macros/CHANGES3
-rw-r--r--graphics/circuit_macros/Copying2
-rw-r--r--graphics/circuit_macros/README6
-rw-r--r--graphics/circuit_macros/darrow.m42
-rw-r--r--graphics/circuit_macros/doc/Circuit_macros.pdfbin1023203 -> 1025740 bytes
-rw-r--r--graphics/circuit_macros/doc/PconnMan.m42
-rw-r--r--graphics/circuit_macros/doc/Version.tex2
-rw-r--r--graphics/circuit_macros/doc/body.tex136
-rw-r--r--graphics/circuit_macros/doc/defines.tex78
-rw-r--r--graphics/circuit_macros/dpictools.pic2
-rw-r--r--graphics/circuit_macros/examples/Contact.m420
-rw-r--r--graphics/circuit_macros/examples/EVplugs.m4209
-rw-r--r--graphics/circuit_macros/examples/Euro.m41
-rw-r--r--graphics/circuit_macros/examples/Makefile2
-rw-r--r--graphics/circuit_macros/examples/Pconn.m413
-rw-r--r--graphics/circuit_macros/examples/Plate.m48
-rw-r--r--graphics/circuit_macros/examples/Resistors.m44
-rw-r--r--graphics/circuit_macros/examples/examples.pdfbin902995 -> 907801 bytes
-rw-r--r--graphics/circuit_macros/examples/files.tex15
-rw-r--r--graphics/circuit_macros/examples/mf/cct.mf90
-rw-r--r--graphics/circuit_macros/examples/shapes.m43
-rw-r--r--graphics/circuit_macros/examples/svg/EVplugsSVG.m4210
-rw-r--r--graphics/circuit_macros/examples/svg/GeometrySVG.m44
-rw-r--r--graphics/circuit_macros/examples/svg/Makefile2
-rw-r--r--graphics/circuit_macros/examples/svg/ResistorsSVG.m42
-rw-r--r--graphics/circuit_macros/examples/svg/SmithchartSVG.m44
-rw-r--r--graphics/circuit_macros/examples/svg/examplesSVG.htmx19
-rw-r--r--graphics/circuit_macros/examples/svg/shapesSVG.m43
-rw-r--r--graphics/circuit_macros/examples/xfig/xfiglib.fig52
-rw-r--r--graphics/circuit_macros/gpic.m42
-rw-r--r--graphics/circuit_macros/lib3D.m42
-rw-r--r--graphics/circuit_macros/libSLD.m42
-rw-r--r--graphics/circuit_macros/libcct.m456
-rw-r--r--graphics/circuit_macros/libgen.m414
-rw-r--r--graphics/circuit_macros/liblog.m42
-rw-r--r--graphics/circuit_macros/mfpic.m42
-rw-r--r--graphics/circuit_macros/mpost.m42
-rw-r--r--graphics/circuit_macros/pgf.m42
-rw-r--r--graphics/circuit_macros/postscript.m42
-rw-r--r--graphics/circuit_macros/psfrag.m42
-rw-r--r--graphics/circuit_macros/pstricks.m42
-rw-r--r--graphics/circuit_macros/svg.m418
-rw-r--r--graphics/circuit_macros/xfig.m42
-rw-r--r--graphics/pstricks/contrib/pst-fractal/Changes2
-rw-r--r--graphics/pstricks/contrib/pst-fractal/doc/pst-fractal-doc.pdfbin31953724 -> 32019437 bytes
-rw-r--r--graphics/pstricks/contrib/pst-fractal/doc/pst-fractal-doc.tex25
-rw-r--r--graphics/pstricks/contrib/pst-fractal/dvips/pst-fractal.pro27
-rw-r--r--graphics/pstricks/contrib/pst-fractal/tex/pst-fractal.tex59
48 files changed, 840 insertions, 277 deletions
diff --git a/graphics/circuit_macros/CHANGES b/graphics/circuit_macros/CHANGES
index 775d3f614d..49a571e818 100644
--- a/graphics/circuit_macros/CHANGES
+++ b/graphics/circuit_macros/CHANGES
@@ -1,5 +1,8 @@
CHANGES
+Version 10.0: New macros Between_, thyristor_t. Bugfix in inductor(,W).
+ Tweaked diff_, scr, scs, sus, sbs, tline, svg_font, contact.
+ Minor edits of the manual. Electric vehicle charging plug examples.
Version 9.9: Changes to libSLD macros, diode, sfg macros, rs_box,
r_text, svg_rot, examples. Changed SVG color macros for consistency with
other postprocessors.
diff --git a/graphics/circuit_macros/Copying b/graphics/circuit_macros/Copying
index 6ff1081c39..1f70c82402 100644
--- a/graphics/circuit_macros/Copying
+++ b/graphics/circuit_macros/Copying
@@ -1,4 +1,4 @@
-* Circuit_macros Version 9.9, copyright (c) 2022 J. D. Aplevich under *
+* Circuit_macros Version 10.0, copyright (c) 2022 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
diff --git a/graphics/circuit_macros/README b/graphics/circuit_macros/README
index 430bf5e99f..7f20713e40 100644
--- a/graphics/circuit_macros/README
+++ b/graphics/circuit_macros/README
@@ -1,5 +1,5 @@
-* Circuit_macros Version 9.9, copyright (c) 2022 J. D. Aplevich under *
+* Circuit_macros Version 10.0, copyright (c) 2022 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
@@ -187,8 +187,8 @@ EXAMPLES
A set of examples is included in this distribution, showing electric
circuits, block diagrams, flow charts, signal-flow graphs, basic
use of colour and fill, and other applications. Some of the examples
- test the boundaries of the domain of application of dpic with m4 macros.
- Read the manual Circuit_macros.pdf and view the files examples.pdf
+ test the boundaries of the domain of application of dpic with m4
+ macros. Read the manual Circuit_macros.pdf and view examples.pdf
in the examples directory or make and view the html file in the
examples/svg directory. For the curious, There are additional source
files in the examples directory that are not shown in examples.pdf.
diff --git a/graphics/circuit_macros/darrow.m4 b/graphics/circuit_macros/darrow.m4
index e1d6073106..c795ab90f7 100644
--- a/graphics/circuit_macros/darrow.m4
+++ b/graphics/circuit_macros/darrow.m4
@@ -1,7 +1,7 @@
divert(-1)
darrow.m4 Macros for double lines and arrows
-* Circuit_macros Version 9.9, copyright (c) 2022 J. D. Aplevich under *
+* Circuit_macros Version 10.0, copyright (c) 2022 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
diff --git a/graphics/circuit_macros/doc/Circuit_macros.pdf b/graphics/circuit_macros/doc/Circuit_macros.pdf
index 9c67589a6f..6e109a06de 100644
--- a/graphics/circuit_macros/doc/Circuit_macros.pdf
+++ b/graphics/circuit_macros/doc/Circuit_macros.pdf
Binary files differ
diff --git a/graphics/circuit_macros/doc/PconnMan.m4 b/graphics/circuit_macros/doc/PconnMan.m4
index 0933af6810..2543048d00 100644
--- a/graphics/circuit_macros/doc/PconnMan.m4
+++ b/graphics/circuit_macros/doc/PconnMan.m4
@@ -43,7 +43,7 @@ P2: [
`"\tt (L,GF)"' at last [].s below
C10: pconnex(,GC) with .w at last [].e + (0.2,0)
`"\tt (,GC)"' ht 11pt__ at last [].s below
- C10: pconnex(,GCF) with .w at last [].e + (0.2,0)
+ C12: pconnex(,GCF) with .w at last [].e + (0.2,0)
`"\tt (,GCF)"' ht 11pt__ at last [].s below
C4: pconnex(,P) with .w at last [].e + (0.2,0)
diff --git a/graphics/circuit_macros/doc/Version.tex b/graphics/circuit_macros/doc/Version.tex
index 45c581b3af..c0b5abb2fd 100644
--- a/graphics/circuit_macros/doc/Version.tex
+++ b/graphics/circuit_macros/doc/Version.tex
@@ -1 +1 @@
-Version 9.9
+Version 10.0
diff --git a/graphics/circuit_macros/doc/body.tex b/graphics/circuit_macros/doc/body.tex
index b984ec0435..dc0738769f 100644
--- a/graphics/circuit_macros/doc/body.tex
+++ b/graphics/circuit_macros/doc/body.tex
@@ -613,12 +613,12 @@ circle diameter (last circle.width * 1.2) with .sw at last circle.ne}
The planar objects can be filled with gray or colour.
For example, either
-{\tt box dashed fill\_({\sl number})}\quad or\quad
+{\tt box dashed fill\_({\sl expression})}\quad or\quad
{\tt box dashed outlined "{\sl color}" shaded "{\sl color}"}
\noindent
produces a dashed box. The first case has a gray fill determined by
-{\sl number}, with $0$ corresponding to black and $1$ to white;
+{\sl expression}, with $0$ corresponding to black and $1$ to white;
the second case allows color outline and fill, the color strings depending on
the postprocessor.
Postprocessor-compatible RGB color strings are produced by the macro
@@ -666,10 +666,11 @@ function).
\subsection{Compound objects\label{Compoundobjects:}}
A compound object is a group of statements enclosed in square
-brackets. Such an object is placed by default as if it were a box, but
+brackets. Such an object, often called a {\em block},
+is placed by default as if it were a box, but
it can also be placed by specifying the final position of a defined point.
A defined point is the center or compass corner of the bounding box
-of the compound object or one of its internal objects.
+of the object or one of its internal objects.
Consider the last line of the code fragment shown:
\noindent%
@@ -683,6 +684,7 @@ The two gate macros evaluate to compound objects containing {\tt Out},
{\tt In1}, and other locations. The final positions of all objects
inside the square brackets are determined in the last line by
specifying the position of {\tt In1} of gate {\tt And2}.
+The compound block has been given the name {\tt Ands.}
\subsection{Other language facilities\label{Otherlanguage:}}
@@ -754,8 +756,8 @@ operating-system commands, \pic macros, and external file inclusion.
\xection{Two-terminal circuit elements\label{Basictwo:}}
There is a fundamental difference between the two-terminal elements, each
of which is drawn along an invisible straight-line segment,
-and other elements, which are compound objects mentioned
-in \SR{Compoundobjects:}.
+and other elements, which are generally compound objects
+in {\tt[} {\tt]} blocks as mentioned in \SR{Compoundobjects:}.
% Specifying the straight-line segment requires four numbers, the coordinates
% of the start and end, or equivalent, but default values are used if
% not specified.
@@ -827,11 +829,12 @@ and the remaining source lines of the file are explained below:
be given a name, {\tt R1} in the example, so that positions
{\tt R1.start}, {\tt R1.centre}, and {\tt R1.end} are automatically
defined as shown.
-\item The element body is overlaid by a block, which can be
- used to place labels around the element. The block
- corresponds to an invisible rectangle with horizontal top and bottom lines,
- regardless of the direction in which the element is drawn. A
- dotted box has been drawn in the diagram to show the block boundaries.
+\item The element body is drawn in or overlaid by a block, which can be
+ used to place labels around the body.
+ The block corresponds to an invisible rectangle with horizontal top
+ and bottom lines, regardless of the direction in which the element
+ is drawn. A dotted box has been drawn in the diagram to show the
+ block boundaries.
\item The last sub-element, identical to the first in two-terminal
elements, is an invisible line that can be referenced later to
place labels or other elements.
@@ -1146,9 +1149,9 @@ quote, in which case the argument is copied literally.
The third argument specifies the separation from the element.
\subsection{Labels\label{Labels:}}
- Arbitrary labels
+ Arbitrary text labels
can be positioned by any \pic\ placement method including the
- representative basic examples shown:
+ basic examples shown:
{\tt "}{\sl text}{\tt" at {\sl position}}\NVL
{\tt "}{\sl text}{\tt" at {\sl position} above}\NVL
@@ -1158,20 +1161,22 @@ The third argument specifies the separation from the element.
In addition, special macros for labeling two-terminal elements are available:
\par
{\tt
- llabel(} {\sl arg1,arg2,arg3} {\tt )
+ llabel(} {\sl label,\ label,\ label,\ rel placement,\ block name} {\tt )
\hfill\break\hspace*{\parindent}%
- clabel(} {\sl arg1,arg2,arg3} {\tt )
+ clabel(} {\sl label,\ label,\ label,\ rel placement,\ block name} {\tt )
\hfill\break\hspace*{\parindent}%
- rlabel(} {\sl arg1,arg2,arg3} {\tt )
+ rlabel(} {\sl label,\ label,\ label,\ rel placement,\ block name} {\tt )
\hfill\break\hspace*{\parindent}%
- dlabel(} {\sl long,lat,arg1,arg2,arg3,}{\tt[X][A|B][L|R])}
-
-The first macro places the three arguments, which are treated as math-mode
-strings, on the left side of the element block {\em with respect to the
-current direction:} {\tt up, down, left, right.}
-The second places the arguments along the centre, and the third along the
-right side.
-A simple circuit example with labels is shown in \FR{Loop}.
+ dlabel(} {\sl long,\ lat,\ label,\ label,\ label,\ }{\tt[X][A|B][L|R])}
+
+The first macro places the first three arguments, which are treated
+as math-mode strings, on the left side of the last {\tt []} block (or
+the block named in the fifth argument if present) {\em with respect to
+the current direction:} {\tt up, down, left, right.} The second macro
+places the strings along the centre of the element, and the third along
+the right side. Labels beginning with {\tt sprintf} or a double quote
+are copied literally rather than assumed to be in math mode. A simple
+circuit example with labels is shown in \FR{Loop}.
\begin{figure}[h!t]
\vspace*{-\baselineskip}
\parbox{4in}{\small \verbatiminput{Loop.m4}}%
@@ -1180,6 +1185,10 @@ A simple circuit example with labels is shown in \FR{Loop}.
\caption{A loop containing labeled elements, with its source code.}
\label{Loop}
\end{figure}
+Most commonly, only
+the first three arguments are needed, and blank arguments are ignored.
+The fourth argument can be {\tt above,} {\tt below,} {\tt left,} or {\tt
+right} to supplement the default relative position.
The macro {\tt dlabel} performs these functions for an
obliquely drawn element, placing the three macro arguments at
{\tt vec\_(-long,lat),} {\tt vec\_(0,lat),} and {\tt vec\_(long,lat)}
@@ -1188,9 +1197,6 @@ In the fourth argument, an {\tt X} aligns the labels with respect to the line
joining the two terminals rather than the element body, and
{\tt A, B, L, R} use absolute {\tt above, below, left,} or {\tt right} alignment
respectively for the labels.
-Labels beginning
-with {\tt sprintf} or a double quote are copied literally rather than
-assumed to be in math mode.
\xection{Placing two-terminal elements\label{Placing:}}
The length and position of a two-terminal element
@@ -1517,6 +1523,7 @@ The fifth argument is a string of characters. {\tt P}
adds a power connection, {\tt R} exchanges the second and
third entries, and {\tt T} truncates the opamp point.
+\enlargethispage{\baselineskip}
Typeset text associated with circuit elements is not rotated by default,
as illustrated by the second and third opamps in \FR{Opamp}.
The {\tt opamp} labels can be rotated if necessary by
@@ -1826,9 +1833,13 @@ and {\sl E} is shown in \FR{ujt}.
\label{ujt}
\end{figure}
-A thyristor macro with predefined internal locations
+The 3 or 4-terminal thyristor macro with predefined internal locations
{\sl G} and {\sl T1,} {\sl T2,} or
- {\sl A,} {\sl K} is in \FR{thyristor}.
+ {\sl A,} {\sl K,} {\sl G,} and {\sl Ga}
+ as appropriate is in \FR{thyristor}.
+Except for the {\sl G} and {\sl Ga} terminals,
+a thyristor (the {\tt IEC} variant excluded)
+is much like a two-terminal element.
\begin{figure}[H]
\input thyristorMan
\vspace*{-1ex}
@@ -1840,10 +1851,9 @@ A thyristor macro with predefined internal locations
to the second argument to draw open arrowheads.}
\label{thyristor}
\end{figure}
-Except for the {\sl G} terminal, a thyristor (the {\tt IEC} variant excluded)
-is much like a two-terminal element. The wrapper macro
-{\tt scr({\sl linespec, chars, label})} and similar macros
-{\tt scs, sus,} and {\tt sbs}
+The wrapper macro
+{\tt thyristor\_t({\sl linespec, chars, label})} and similar macros
+{\tt scr, scs, sus,} and {\tt sbs}
place thyristors using {\sl linespec} as for a two-terminal element,
but require a third argument for the label for the compound block; thus,
@@ -3327,25 +3337,28 @@ distribution. The \latex drawing commands alone or with {\tt eepic}
or {\tt pict2e} extensions are suitable only for simple diagrams.
\xection{Developer's notes\label{Developersnotes:}}
-Years ago in the course of writing a book, I took a few days off to
-write a \pic-like interpreter (\dpic) to eliminate the tedious coordinate
-calculations required when drawing with \latex picture objects.
-The macros in this distribution and the interpreter are the result of that
-effort, drawings I have had to produce since, and suggestions received
-from others. The interpreter has been upgraded over time to generate
-\mfpic, \MetaPost~\cite{metapost}, raw \Postscript, \Postscript with {\tt
-psfrag} tags, raw PDF, \PSTricks, and Ti{\it k}Z PGF output, the latter
-two my preference because of their quality and flexibility, including
-facilities for colour and rotations, together with simple font selection.
-\Xfig{}-compatible output was introduced early on to allow the creation of
-diagrams both by programming and by interactive graphics. \SVG output
-was added relatively recently, and seems suitable for producing web
-diagrams directly and for further editing by the Inkscape interactive
-graphics editor. The latest addition is raw PDF output, which has very
-basic text capability and is most suitable for creating diagrams without
-labels, but on which sophisticated text can be overlaid if necessary.
-\Dpic can write the coordinates of selected locations to an external
-file to be used in overlaying text or other items on the diagram.
+In the course of writing a book in the late 1980s when there was little
+available for creating line diagrams in \latex, I wished to eliminate
+the tedious coordinate calculations required by the \latex
+picture objects that I was then using. The \pic\ language seemed to be a
+good fit for this purpose, and I took a few days off to write a \pic-like
+interpreter (\dpic). The macros in this distribution and the interpreter
+are the result of that effort, drawings I have had to produce since,
+and suggestions received from others. The interpreter has been upgraded
+over time to generate \mfpic, \MetaPost~\cite{metapost}, raw \Postscript,
+\Postscript with {\tt psfrag} tags, raw PDF, \PSTricks, and Ti{\it k}Z
+PGF output, the latter two my preference because of their quality and
+flexibility, including facilities for colour and rotations, together
+with simple font selection. \Xfig{}-compatible output was introduced
+early on to allow the creation of diagrams both by programming and by
+interactive graphics. \SVG output was added relatively recently, and
+seems suitable for producing web diagrams directly and for further editing
+by the Inkscape interactive graphics editor. The latest addition is raw
+PDF output, which has very basic text capability and is most suitable for
+creating diagrams without labels, but on which sophisticated text can
+be overlaid if necessary. \Dpic can write the coordinates of selected
+locations to an external file to be used in overlaying text or other
+items on the diagram.
The simple \pic\ language is but one of many available tools for creating
line graphics. Consequently, the main value of this distribution is
@@ -3363,21 +3376,22 @@ can be worth the effort.
Instead of using \pic macros, I preferred the equally simple but more
powerful \Mfour macro processor, and therefore \Mfour is required here,
-although \dpic now supports \pic-like macros. Free versions of \Mfour
+although \dpic now supports \pic macros. Free versions of \Mfour
are available for Unix and its descendents, Windows, and other operating
systems. Additionally, the simplicity of \Mfour and \pic enables the
writing of custom macros, which are mentioned from time to time in this
manual and included in some of the examples.
If starting over today would I not just use one of the other drawing
-packages available these days? It would depend on the context, but \pic
-remains a good choice for line drawings because it is easy to learn
-and read but powerful enough for coding the geometrical calculations
-required for precise component sizing and placement. It would be nice
-if arbitrary rotations and scaling were simpler and if a general path
-element with clipping were available as in \Postscript. However,
-all the power of \Postscript or \TPGF, for example, remains available,
-as arbitrary postprocessor code can be included with \pic code.
+packages available these days? It would depend on the context, but
+\pic remains a good choice for line drawings because it is easy to learn
+and read but powerful enough (that is, Turing-complete) for coding the
+geometrical calculations required for precise component sizing and
+placement. It would be nice if arbitrary rotations and scaling were
+simpler and if a general path element with clipping were available
+as in \Postscript. However, all the power of \Postscript or \TPGF,
+for example, remains available, as arbitrary postprocessor code can be
+included with \pic code.
The \dpic interpreter has several output-format options that may be
useful. The {\tt eepicemu} and {\tt pict2e} extensions of the
diff --git a/graphics/circuit_macros/doc/defines.tex b/graphics/circuit_macros/doc/defines.tex
index dfcee2f91d..7ac3cbaed4 100644
--- a/graphics/circuit_macros/doc/defines.tex
+++ b/graphics/circuit_macros/doc/defines.tex
@@ -251,6 +251,10 @@
\macrodef{below\_}{below_}{}
{gen}
{string position relative to current direction}
+\macrodef{Between\_}{Between_}{({\sl Pos1, Pos2,distance,}[R])}
+ {gen}
+ {Position {\sl distance} from {\sl Pos1} toward {\sl Pos2}. If
+ the fourth arg is {\tt R} then from {\sl Pos2} toward {\sl Pos1}.}
\macrodef{bi\_tr}{bi_tr}{(\linespec,L|R,P,E)}
{cct}
{left or right, N- or P-type bipolar transistor, without or with envelope
@@ -370,17 +374,18 @@
{gen}
{Upper (lower if arg5={\tt R}) intersection of circles at
{\sl Pos1} and {\sl Pos2}, radius {\sl rad1} and {\sl rad2}}
-\macrodef{clabel}{clabel}{({\sl label},{\sl label},{\sl label},{\sl arg4},%
- {\sl arg5})}
- {cct}
- {Triple label along the drawing axis of an element in the current
- direction \seesect{Labels:}. Labels are placed at the beginning,
- centre, or end of the last {\tt []} block (or a named {\tt []}
- block). The labels are treated as math, but copied literally if
- in double quotes or defined by sprintf. {\sl Arg4} can be {\tt
- above,} {\tt below,} {\tt left,} or {\tt right} to supplement the
- default position. {\sl Arg5} is the optional name of a {\tt []}
- block to be labelled and is {\tt last []} by default}
+\macrodef{clabel}{clabel}{({\sl label},{\sl label},{\sl label},[{\sl arg4}],%
+ [{\sl block name}])}
+ {cct}
+ {Triple label along the draing axis of the body of an element in the
+ current direction \seesect{Labels:}. Labels are placed at the
+ beginning, centre, and end of the last {\tt []} block (or a named
+ {\tt []} block). Each label is treated as math by default, but is
+ copied literally if it is in double quotes or defined by sprintf.
+ {\sl Arg4} can be {\tt above,} {\tt below,} {\tt left,} or {\tt
+ right} to supplement the default relative position. The fifth
+ argument is the optional name of the {\tt []} block to be labelled,
+ which is {\tt last []} by default}
\macrodef{cm\_\_}{cm__}{}
{gen}
{absolute centiimetres}
@@ -1158,17 +1163,18 @@ n|e|s|w,{\sl length})}
\macrodef{ljust\_}{ljust_}{}
{gen}
{ljust with respect to current direction}
-\macrodef{llabel}{llabel}{({\sl label},{\sl label},{\sl label},{\sl arg4},%
- {\sl arg5})}
- {cct}
- {Triple label on the left of an element with respect to the current
- direction \seesect{Labels:}. Labels are placed at the beginning,
- centre, or end of the last {\tt []} block (or a named {\tt []}
- block). The labels are treated as math, but copied literally if
- in double quotes or defined by sprintf. {\sl Arg4} can be {\tt
- above,} {\tt below,} {\tt left,} or {\tt right} to supplement the
- default position. {\sl Arg5} is the optional name of a {\tt []}
- block to be labelled and is {\tt last []} by default}
+\macrodef{llabel}{llabel}{({\sl label},{\sl label},{\sl label},[{\sl arg4}],%
+ [{\sl block name}])}
+ {cct}
+ {Triple label on the left of the body of an element with respect to the
+ current direction \seesect{Labels:}. Labels are placed at the
+ beginning, centre, and end of the last {\tt []} block (or a named
+ {\tt []} block). Each label is treated as math by default, but is
+ copied literally if it is in double quotes or defined by sprintf.
+ {\sl Arg4} can be {\tt above,} {\tt below,} {\tt left,} or {\tt
+ right} to supplement the default relative position. The fifth
+ argument is the optional name of the {\tt []} block to be labelled,
+ which is {\tt last []} by default}
\macrodef{loc\_}{loc_}{({\sl x}, {\sl y})}
{gen}
{location adjusted for current direction}
@@ -1640,17 +1646,18 @@ degrees})}
\macrodef{rjust\_}{rjust_}{}
{gen}
{right justify with respect to current direction}
-\macrodef{rlabel}{rlabel}{({\sl label},{\sl label},{\sl label},{\sl arg4},%
- {\sl arg5})}
- {cct}
- {Triple label on the right of an element with respect to the current
- direction \seesect{Labels:}. Labels are placed at the beginning,
- centre, or end of the last {\tt []} block (or a named {\tt []}
- block). The labels are treated as math, but copied literally if
- in double quotes or defined by sprintf. {\sl Arg4} can be {\tt
- above,} {\tt below,} {\tt left,} or {\tt right} to supplement the
- default position. {\sl Arg5} is the optional name of a {\tt []}
- block to be labelled and is {\tt last []} by default}
+\macrodef{rlabel}{rlabel}{({\sl label},{\sl label},{\sl label},[{\sl arg4}],%
+ [{\sl block name}])}
+ {cct}
+ {Triple label on the right of the body of an element with respect to the
+ current direction \seesect{Labels:}. Labels are placed at the
+ beginning, centre, and end of the last {\tt []} block (or a named
+ {\tt []} block). Each label is treated as math by default, but is
+ copied literally if it is in double quotes or defined by sprintf.
+ {\sl Arg4} can be {\tt above,} {\tt below,} {\tt left,} or {\tt
+ right} to supplement the default relative position. The fifth
+ argument is the optional name of the {\tt []} block to be labelled,
+ which is {\tt last []} by default}
\macrodef{rot3Dx}{rot3Dx}{({\sl radians,x,y,z})}
{3D} {rotates x,y,z about x axis}
\macrodef{rot3Dy}{rot3Dy}{({\sl radians,x,y,z})}
@@ -2414,6 +2421,11 @@ justification})}
centre,
R=right orientation, E=envelope
\seesect{Semiconductors:}}
+\macrodef{thyristor\_t}{thyristor_t}{({\sl linespec, chars, label})}
+ {cct}
+ {Wrapper to place a thyristor as a two-terminal element with
+ {\tt [ ]} block label given by the third argument
+ \seesect{Semiconductors:}}
\macrodef{tikznode}{tikznode}{({\sl \Tikz node name, position}) }
{pgf}
{insert \Tikz code to define a zero-size \Tikz node at {\sl location}
diff --git a/graphics/circuit_macros/dpictools.pic b/graphics/circuit_macros/dpictools.pic
index 66453a30e4..f3936bb0db 100644
--- a/graphics/circuit_macros/dpictools.pic
+++ b/graphics/circuit_macros/dpictools.pic
@@ -3,7 +3,7 @@
# m4 macro NeedDpicTools or the pic statement copy "HOMELIB_/dpictools.pic"
# when HOMELIB_ is defined or, generically, copy "<path>dpictools.pic"
-# Circuit_macros Version 9.9, copyright (c) 2022 J. D. Aplevich under #
+# Circuit_macros Version 10.0, copyright (c) 2022 J. D. Aplevich under #
# the LaTeX Project Public Licence in file Licence.txt. The files of #
# this distribution may be redistributed or modified provided that this #
# copyright notice is included and provided that modifications are clearly #
diff --git a/graphics/circuit_macros/examples/Contact.m4 b/graphics/circuit_macros/examples/Contact.m4
index 26f8d5a982..e4e7a5a176 100644
--- a/graphics/circuit_macros/examples/Contact.m4
+++ b/graphics/circuit_macros/examples/Contact.m4
@@ -9,16 +9,16 @@ movw = 0.45
"\sl P" rjust at last [].P.w
"\sl O" ljust at last [].O
"\sl C" ljust at last [].C }
- move right_ movw; contact(R)
- {`"\tt (R)"' at (last [].s,S)
+ move right_ movw; contact(RX)
+ {`"\tt (RX)"' at (last [].s,S)
"\sl P" rjust at last [].P.w
"\sl O" ljust at last [].O
"\sl C" ljust at last [].C }
- move right_ movw; contact(O); {`"\tt (O)"' at (last [],S)}
- move right_ movw; contact(C); {`"\tt (C)"' at (last [],S)}
+ move right_ movw; contact(OX); {`"\tt (OX)"' at (last [],S)}
+ move right_ movw; contact(CX); {`"\tt (CX)"' at (last [],S)}
- move right_ movw; contact(P)
- {S: `"\tt (P)"' at last [].s+(0,-0.15)
+ move right_ movw; contact(X)
+ {S: `"\tt (X)"' at last [].s+(0,-0.15)
"\sl P" rjust at last [].P.w
"\sl O" ljust at last [].O
"\sl C" ljust at last [].C }
@@ -30,7 +30,7 @@ movw = 0.45
move right_ movw; contact(PO); {`"\tt (PO)"' at (last [],S)}
{"\sl O" ljust at last [].O
"\sl C" ljust at last [].C }
- move right_ movw; contact(PC); {`"\tt (PC)"' at (last [],S)}
+ move right_ movw; contact(PCX); {`"\tt (PCX)"' at (last [],S)}
}
move down 0.75; right_ ; {
@@ -50,7 +50,11 @@ move down 0.75; right_ ; {
{"\sl O" ljust at last [].O.e
"\sl C" ljust at last [].C.e }
move right_ movw; contact(PIO); {`"\tt (PIO)"' at (last [],S) }
- move right_ movw; contact(PIC); {`"\tt (PIC)"' at (last [],S) }
+ {"\sl C" ljust at last [].C.e}
+ {"\sl O" ljust at last [].O.e}
+ move right_ movw; contact(PICX); {`"\tt (PICX)"' at (last [],S) }
+ {"\sl C" ljust at last [].C.e}
+ {"\sl O" ljust at last [].O.e}
}
movewid = movw
diff --git a/graphics/circuit_macros/examples/EVplugs.m4 b/graphics/circuit_macros/examples/EVplugs.m4
new file mode 100644
index 0000000000..5631482bf9
--- /dev/null
+++ b/graphics/circuit_macros/examples/EVplugs.m4
@@ -0,0 +1,209 @@
+.PS
+# EV_lugs.m4
+# https://en.wikipedia.org/wiki/CHAdeMO
+gen_init
+divert(-1)
+
+ `EV_J1772(keys)
+ EV charging plug in a [] block
+ keys: wdth=expr; # plug width
+ diamLNP=expr; # diam of L1, N, PE
+ twdth=expr; # tab width
+ thgt=expr; # tab hght
+ thick=expr; # outer line thickness (pt)
+ inthick=expr; # inner line thickness (pt)
+ BG=attributes; # shaded gray etc
+ L1=attributes; # L1 attributes ...
+ N=attributes;
+ PE=attributes;
+ PP=attributes;
+ CP=attributes; '
+define(`pEVskale',25.4) dnl default plug size (20 mm)
+define(`EV_J1772',`[ pushkeys_(`$1', `wdth:20/pEVskale;
+ twdth:3.5/20*m4wdth; thgt:1.5/20*m4wdth; diamLNP:6/20*m4wdth;
+ thick:2; inthick:1.5; BG::N; L1::N; N::N; PE::N; PP::N; CP::N; ')
+ tang = atan2(m4twdth/2,m4wdth/2)*rtod_
+ TS: (Rect_(m4wdth/2,-90-tang)); TE: (Rect_(m4wdth/2,-90+tang))
+ Tab: line thick m4thick from TS down_ m4thgt \
+ then to TE-(0,m4thgt) then to TE m4BG
+ Arc: arc thick m4thick to TS with .c at (0,0) m4BG
+ round(at TS,last arc.thick); round(at TE,last arc.thick)
+ L1: circle diam m4diamLNP thick m4inthick at (Rect_(m4wdth/4,150)) m4L1
+ N: circle diam m4diamLNP thick m4inthick at (Rect_(m4wdth/4, 30)) m4N
+ PE: circle diam m4diamLNP thick m4inthick at (0,-m4wdth/4) m4PE
+ PP: circle diam m4diamLNP*0.55 thick m4inthick at (Rect_(m4wdth/3,210)) m4PP
+ CP: circle diam m4diamLNP*0.55 thick m4inthick at (Rect_(m4wdth/3,-30)) m4CP
+ `$2' popdef(`m4CP',`m4PP',`m4PE',`m4N',`m4L1',`m4BG',
+ `m4wdth',`m4diamLNP',`m4twdth',`m4thgt',`m4thick',`m4inthick') ]')
+
+ `EV_J3068(keys,shade)
+ EV charging plug in a [] block
+ keys: wdth=expr; # plug width
+ diamLNP=expr; # diam of L1, N, PE
+ twdth=expr; # tab width
+ thgt=expr; # tab hght
+ thick=expr; # outer line thickness (pt)
+ inthick=expr; # inner line thickness (pt)
+ BG=attributes; # shaded gray etc
+ L1|L2|L3=attributes; # pin attributes ...
+ N=attributes;
+ PE=attributes;
+ PP=attributes;
+ CP=attributes;
+ arg2= R:G:B background fill color '
+define(`EV_J3068',`[ pushkeys_(`$1',
+ `wdth:25/pEVskale; diamLNP:m4wdth*0.25; thick:2; inthick:1.5;
+ BG::N; L1::N; L2::N; L3::N; N::N; PE::N; PP::N; CP::N; ')
+ C: Here
+ NE: C+(Rect_(m4wdth/2,45)); NW: C+(Rect_(m4wdth/2,135))
+ Ac: NE-(1,1)/sqrt(2)*m4diamLNP/2
+ Arc: arc thick m4thick from NW to NE with .c at C m4BG ifelse(`$2',,,
+ `shaded rgbstring(patsubst(`$2',:,`,'))
+ line invis from NE to Ac+(0,m4diamLNP/2) \
+ then to Ac+(0,m4diamLNP/2) \
+ then to NW+(1,-1)/sqrt(2)*m4diamLNP/2 + (0,m4diamLNP/2) \
+ then to NW then to NE shaded rgbstring(patsubst(`$2',:,`,'))')
+ arc thick m4thick to Ac+(0,m4diamLNP/2) with .c at Ac m4BG
+ Top: line thick m4thick to (NW+NE-Ac, Here) m4BG
+ arc thick m4thick to NW with .c at Here+(0,-m4diamLNP/2) m4BG
+ PE: circle diam m4diamLNP thick m4inthick at C m4PE
+ PP: circle diam m4diamLNP*0.55 thick m4inthick at C+(Rect_(m4wdth/3,45)) m4PP
+ CP: circle diam m4diamLNP*0.55 thick m4inthick at C+(Rect_(m4wdth/3,135)) m4CP
+ L1: circle diam m4diamLNP thick m4inthick at C+(m4wdth*.3,0) m4L1
+ L2: circle diam m4diamLNP thick m4inthick at C+(Rect_(m4wdth*.3,-60)) m4L2
+ L3: circle diam m4diamLNP thick m4inthick at C+(Rect_(m4wdth*.3,-120)) m4L3
+ N: circle diam m4diamLNP thick m4inthick at C-(m4wdth*.3,0) m4N
+ `$3' popdef(`m4wdth',`m4diamLNP',`m4thick',`m4inthick',
+ `m4BG',`m4L1',`m4L2',`m4L3',`m4N',`m4PE',`m4PP',`m4CP') ]')
+
+ `EV_CCS1(J1772 keys,DC keys)
+ DC keys: wdth=expr; # DC socket width
+ hght=expr; # DC socket height
+ diamPM=expr; # diam of DC+, DC- circles
+ sep=expr; # separation of Jack and DC
+ thick=expr; # outer line thickness (pt)
+ inthick=expr; # inner line thickness (pt)
+ BG=attributes; # shaded gray etc
+ DCplus=attributes;
+ DCminus=attributes; '
+define(`EV_CCS1',`[
+ J: EV_J1772(`$1')
+ pushkeys_(`$2',`wdth:J.wid:23.5/20; hght:J.wid*11/20; diamPM:m4hght*7/11;
+ sep:J.wid*3/30; thick:J.Arc.thick; inthick:J.PE.thick;
+ BG::N; DCplus::N; DCminus::N;')
+ DC: [ Box: box thick m4thick wid m4wdth ht m4hght rad m4hght/2 m4BG
+ DCplus: circle thick m4inthick diam m4diamPM at Box.w+(m4hght/2,0) m4DCplus
+ DCminus:circle thick m4inthick diam m4diamPM at Box.e-(m4hght/2,0) m4DCminus
+ ] with .n at J.s+(0,-m4sep)
+ popdef(`m4wdth',`m4hght',`m4diamPM',`m4sep',`m4thick',`m4inthick',`m4BG',
+ `m4DCplus',`m4DCminus')
+ ]')
+
+ `EV_CCS2(J3068 keys,shade,DC keys)
+ DC keys: wdth=expr; # DC socket width
+ hght=expr; # DC socket height
+ diamPM=expr; # diam of DC+, DC- circles
+ sep=expr; # separation of Jack and DC
+ thick=expr; # outer line thickness (pt)
+ inthick=expr; # inner line thickness (pt)
+ BG=attributes; # shaded gray etc
+ DCplus=attributes;
+ DCminus=attributes;
+ arg2= R:G:B background fill color '
+define(`EV_CCS2',`[
+ J: EV_J3068(`$1',`$2')
+ pushkeys_(`$3',`wdth:J.wid:23.5/20; hght:J.wid*11/20; diamPM:m4hght*7/11;
+ sep:J.wid*3/30; thick:J.Arc.thick; inthick:J.PE.thick;
+ BG::N; DCplus::N; DCminus::N;')
+ DC: [ Box: box thick m4thick wid m4wdth ht m4hght rad m4hght/2 dnl
+ m4BG ifelse(`$2',,,`shaded rgbstring(patsubst(`$2',:,`,'))')
+ DCplus: circle thick m4inthick diam m4diamPM at Box.w+(m4hght/2,0) m4DCplus
+ DCminus:circle thick m4inthick diam m4diamPM at Box.e-(m4hght/2,0) m4DCminus
+ ] with .n at J.s+(0,-m4sep)
+ popdef(`m4wdth',`m4hght',`m4diamPM',`m4sep',`m4thick',`m4inthick',`m4BG',
+ `m4DCplus',`m4DCminus')
+ ]')
+
+ `EV_CHAdeMO(keys,shade)
+ EV charging plug in a [] block
+ keys: wdth=expr; # plug width
+ thick=expr; # outer line thickness (pt)
+ inthick=expr; # inner line thickness (pt)
+ BG=attributes; # background shaded gray etc
+ DCplus=|DCminusNS=|FG=|NC=|SS1=|DCP=|PP=|
+ CL=|CH=|SS2=attributes # pin attributes ...'
+define(`EV_CHAdeMO',`[ pushdef(`m4sk',33/140/pEVskale) pushkeys_(`$1',
+ `wdth:140*m4sk; thick:m4wdth*9/140/(1bp__); inthick:m4thick*1.5/9;
+ BG::N; DCplus::N; DCminus::N;N::N;S::N;
+ FG::N; NC::N; SS1::N; DCP::N; PP::N; CL::N; CH::N; SS2::N')
+ C: circle thick m4thick diam m4wdth-m4thick bp__ m4BG
+ line thick m4thick*0.6 from C+(Rect_(C.rad+m4thick bp__*3/4,42)) \
+ to C+(Rect_(C.rad+m4thick bp__*3/4,50)) then left m4thick bp__ m4BG
+ line thick m4thick*0.6 from C+(Rect_(C.rad+m4thick bp__*3/4,138)) \
+ to C+(Rect_(C.rad+m4thick bp__*3/4,130)) then right m4thick bp__ m4BG
+ idiam = (m4wdth-m4thick bp__*2)*47/(27+47*2)
+ N: circle diam idiam thick m4inthick with .n at C.n-(0,m4thick bp__/2) m4N
+ S: circle diam idiam thick m4inthick with .s at C.s+(0,m4thick bp__/2) m4S
+ E: circle diam idiam thick m4inthick at Cintersect(N,N.diam,S,S.diam) m4DCminus
+ W: circle diam idiam thick m4inthick at Cintersect(S,S.diam,N,N.diam) m4DCplus
+ Loopover_(`Z',
+ `line thick m4inthick up Z.diam*0.6 right Z.diam*0.6 with .c at Z
+ line thick m4inthick up Z.diam*0.6 left Z.diam*0.6 with .c at Z',N,S)
+ Loopover_(`L',`L: circle diam idiam/4 thick linethick/2 \
+ at N+(Rect_(idiam/4,90*m4Lx)) m4xpand(m4`'L)',FG,NC,DCP,SS1)
+ Loopover_(`L',`L: circle diam idiam/4 thick linethick/2 \
+ at S+(Rect_(idiam/4,90*m4Lx)) m4xpand(m4`'L)',PP,CL,SS2,CH)
+ `$3' popdef(`m4sk',`m4wdth',`m4thick',`m4inthick',`m4BG',
+ `m4DCplus',`m4DCminus',`m4N',`m4S',
+ `m4FG',`m4NC',`m4SS1',`m4DCP',`m4PP',`m4CL',`m4CH',`m4SS2') ]')
+
+divert(0)dnl
+
+ ifsvg(svg_font(sans-serif,6bp__))
+ iflatex(command "{\sf\scriptsize")
+ define(`EVsmall',`ifsvg(svg_small(`$1'),{\tiny `$1'})')
+ define(`EVtxt',`ifsvg(``$1'',`{patsubst(`$1',_,\\_)}')')
+ define(`EVk',`ifsvg(+(0,0.75bp__))')
+
+[
+P1: EV_J1772(BG=fill_(0.75); PE=fill_(1) "PE";L1=fill_(1) "L1";N=fill_(1) "N";
+ PP=fill_(1); CP=fill_(1);)
+ "EVsmall(PP)" at P1.PP EVk
+ "EVsmall(CP)" at P1.CP EVk
+
+P2: EV_J3068(PE=shaded "green" "PE";\
+ L1=shaded "yellow" "L1";L2=shaded "yellow" "L2";L3=shaded "yellow" "L3";
+ N=fill_(1) "N";",
+ 0.85:0.85:0.85) at P1+(15bp__,0) \
+ with .w at P1.e+(P1.wid/5,0)
+ "EVsmall(PP)" at P2.PP EVk
+ "EVsmall(CP)" at P2.CP EVk
+
+P3: EV_CCS1(L1="L1";N="N";PE="PE",
+ DCplus="DC+";DCminus="DC-") with .w at P2.e+(P1.wid/5,0)
+ "EVsmall(PP)" at P3.J.PP EVk
+ "EVsmall(CP)" at P3.J.CP EVk
+
+P4: EV_CCS2(L1="L1";L2="L2";L3="L3";N="N";PE="PE",0.85:0.85:0.85,
+ DCplus="DC+";DCminus="DC-") with .w at P3.e+(P1.wid/5,0)
+ "EVsmall(PP)" at P4.J.PP EVk
+ "EVsmall(CP)" at P4.J.CP EVk
+P5: EV_CHAdeMO( BG=outlined "blue" fill_(0.8);
+ DCplus=shaded "red" "DC+";
+ DCminus=shaded "red" "DC-";
+ Loopover_(`L',`L=fill_(1);',N,S)
+ FG=shaded "green";
+ Loopover_(`L',`L=shaded "orange";',SS1,DCP,NC,PP,CH,SS2,CL)) \
+ with .w at P4.e+(P4.w.x-P3.e.x,0)
+ Loopover_(`L',`"EVsmall(L)" at P5.L EVk',FG,NC,DCP,SS1,PP,CL,CH,SS2)
+#
+ "EVtxt(`EV_CCS2')" at P4.s+(0,-10bp__)
+ "EVtxt(`EV_CCS1')" at (P3,last "")
+ "EVtxt(`EV_J3068')" at (P2,last "")
+ "EVtxt(`EV_J1772')" at (P1,last "")
+ "EVtxt(`EV_CHAdeMO')" at (P5,last "")
+ ] # with .nw at last [].sw+(0,-0.2)
+
+ iflatex(command "}%")
+ ifsvg(command "</g>")
+.PE
diff --git a/graphics/circuit_macros/examples/Euro.m4 b/graphics/circuit_macros/examples/Euro.m4
index 5186cb2f5c..26230facbe 100644
--- a/graphics/circuit_macros/examples/Euro.m4
+++ b/graphics/circuit_macros/examples/Euro.m4
@@ -1,6 +1,5 @@
.PS
#Euro.m4
-include(pstricks.m4)
gen_init
divert(-1)
`euro_simple([height])
diff --git a/graphics/circuit_macros/examples/Makefile b/graphics/circuit_macros/examples/Makefile
index 55cf147dcc..c582c0b35c 100644
--- a/graphics/circuit_macros/examples/Makefile
+++ b/graphics/circuit_macros/examples/Makefile
@@ -61,7 +61,7 @@ PICS = \
Contacts.tex Contact.tex control.tex Crossbar.tex Crow.tex \
csc.tex Csource.tex Decoder.tex \
Demultiplexer.tex diamond.tex Dini.tex Diodes.tex Drive.tex \
- EEP.tex Emarrows.tex Escher.tex \
+ EEP.tex Emarrows.tex Escher.tex EVplugs.tex \
ex00.tex ex01.tex ex02.tex ex03.tex ex04.tex ex05.tex ex06.tex ex08.tex \
ex09.tex ex10.tex ex11.tex ex12.tex ex15.tex ex16.tex ex17.tex ex18.tex \
ex21.tex exp.tex fet.tex Flow.tex Fuses.tex GrayCode.tex graysurf.tex \
diff --git a/graphics/circuit_macros/examples/Pconn.m4 b/graphics/circuit_macros/examples/Pconn.m4
index cb8afd0875..2543048d00 100644
--- a/graphics/circuit_macros/examples/Pconn.m4
+++ b/graphics/circuit_macros/examples/Pconn.m4
@@ -45,13 +45,18 @@ P2: [
`"\tt (,GC)"' ht 11pt__ at last [].s below
C12: pconnex(,GCF) with .w at last [].e + (0.2,0)
`"\tt (,GCF)"' ht 11pt__ at last [].s below
-] with .nw at P1.C1.sw + (0,-0.35)
-P3: [
- C4: pconnex(,P)
+ C4: pconnex(,P) with .w at last [].e + (0.2,0)
`"\tt (,P)"' at last [].s below
C11: pconnex(,PF) with .w at last [].e+(0.2,0)
`"\tt (,PF)"' at (C11,last "") below
-] with .nw at P2.C9.sw + (0,-0.35)
+] with .nw at P1.C1.sw + (0,-0.35)
+
+#P3: [
+# C4: pconnex(,P)
+# `"\tt (,P)"' at last [].s below
+# C11: pconnex(,PF) with .w at last [].e+(0.2,0)
+# `"\tt (,PF)"' at (C11,last "") below
+#] with .nw at P2.C9.sw + (0,-0.35)
.PE
diff --git a/graphics/circuit_macros/examples/Plate.m4 b/graphics/circuit_macros/examples/Plate.m4
index 0700f072a0..3937543d2a 100644
--- a/graphics/circuit_macros/examples/Plate.m4
+++ b/graphics/circuit_macros/examples/Plate.m4
@@ -5,10 +5,10 @@
# See the ASME Y14.5 standard, Figure 6-30.
scale = 100/3
cct_init
-include(ASME_Y14-5.m4)
+ifdef(`ASME_Y14-5_',,`include(ASME_Y14-5.m4)')
ifsvg(`svg_font(sans-serif,10bp__)',
`textht = 10bp__*2/3
- iflatex(`command "{\sf"')')
+ iflatex(`command "{\sf\small"')')
# ASME Y14.5 specs:
arrowht = textht*0.8
arrowwid = textht*0.6
@@ -157,11 +157,11 @@ thinlines_
for_(0,315,45,`ctrarcr(C,d6/2,(m4x-22.5)*dtor_,(m4x+22.5)*dtor_)
ctrline(from C+(Rect_(d6-d7/2,m4x)) to C+(Rect_(d7/2,m4x))) ')
arcdimension_(from C+(0,d7/2) to C+(Rect_(d7/2,135)) with .c at C,
- 8,"8X 45`'iflatex($^\circ$)" wid textht*3.5,15,1)
+ 8,"8 X 45`'iflatex($^\circ$)" wid textht*3.5,15,1)
ifsvg("svg_deg" wid textht*2/3 with .w at last "".e)
move to C+(0,d6/2)
arrow <- from Here+(Rect_(8/2,75)) to Here+(Rect_(25,75)) then right_ 3
- "8X" wid 2*textht ljust
+ "8 X" wid 3*textht ljust
linethick_(1); [Y14_dia_] with .w at last "".e+(1,0)
"7.9 - 8.1" wid 8*textht ljust
Y14_frame(Y14_pos_,Y14_dia_;"0.14" wid 3*textht;"(M)","A","C") \
diff --git a/graphics/circuit_macros/examples/Resistors.m4 b/graphics/circuit_macros/examples/Resistors.m4
index 659f75ff65..960897afc0 100644
--- a/graphics/circuit_macros/examples/Resistors.m4
+++ b/graphics/circuit_macros/examples/Resistors.m4
@@ -29,8 +29,8 @@ vm = 0.28
move down vm; right_
{ {ebox(,,,0.9) ; move ;"`{\tt ebox(,{,},0.9)}'" ljust}
move right_ hm
- {ebox(,,,,shaded "green") ; move
- "`{\tt ebox(,{,},{,}shaded \"green\")}'" ljust}
+ {ebox(,,,,shaded "yellow") ; move
+ "`{\tt ebox(,{,},{,}shaded \"yellow\")}'" ljust}
}
move down vm; right_
{ {ebox(,wdth=0.2;box=dashed shaded "green";text="X") ; move
diff --git a/graphics/circuit_macros/examples/examples.pdf b/graphics/circuit_macros/examples/examples.pdf
index dafab3e6a7..184aa8a400 100644
--- a/graphics/circuit_macros/examples/examples.pdf
+++ b/graphics/circuit_macros/examples/examples.pdf
Binary files differ
diff --git a/graphics/circuit_macros/examples/files.tex b/graphics/circuit_macros/examples/files.tex
index 5fbcf50af8..22c3a5c5fd 100644
--- a/graphics/circuit_macros/examples/files.tex
+++ b/graphics/circuit_macros/examples/files.tex
@@ -60,6 +60,7 @@
\caption{Macros {\tt fuse} and {\tt cbreaker}
\src{Fuses.m4}.}
}
+
\bfig{
\centerline{\getpic{MoreTable}}
\caption{Additional two-terminal elements
@@ -152,6 +153,13 @@
}
\bfig{
+ \centerline{\getpic{EVplugs}}
+ \caption{Electric vehicle charging plug patterns make extensive
+ use of {\sl key=value} pairs to set options
+ \src{EVplugs.m4}.}
+ }
+
+\bfig{
\centerline{\getpic{Headers}}
\caption{The {\tt Header} macro
\src{Headers.m4}.}
@@ -183,7 +191,8 @@
\bfig{
\centerline{\getpic{thyristor}}
- \caption{Thyristor examples
+ \caption{Thyristor examples. The thyristor is a 3- or 4-terminal
+ composite element
\src{thyristor.m4}.}
}
@@ -589,7 +598,9 @@
\bfig{
\centerline{\getpic{random}}
- \caption{Testing random number generation
+ \caption{Testing random number generation using
+ dpic macro {\tt randn(}{\sl array name, n, mean, std dev}{\tt)}
+ which calls pic built-in {\tt rand()}
\src{random.m4}.}
}
diff --git a/graphics/circuit_macros/examples/mf/cct.mf b/graphics/circuit_macros/examples/mf/cct.mf
index 10b713bb50..6e6fa4f73e 100644
--- a/graphics/circuit_macros/examples/mf/cct.mf
+++ b/graphics/circuit_macros/examples/mf/cct.mf
@@ -1,5 +1,5 @@
% cct.mf, generated by Mfpic, v1.10 2012/12/03,
-% from TeX source "font" on 2022/07/27 at 16:40
+% from TeX source "font" on 2022/10/13 at 18:50
numeric mfpicversion; mfpicversion := 110;
if unknown mode: mode := localfont; fi
if unknown mag: mag := 1000/1000; fi
@@ -81,68 +81,68 @@ store (curpath)
drawn
polyline (false)
((0,0),
-(0.020249,0));
+(0.024933,0));
resizedrawpen (0.4bp);
store (curpath)
drawn
-circle ((0.020249,0),0.002767);
+circle ((0.024933,0),0.002767);
resizedrawpen (0.8bp);
store (curpath)
drawn
-arcplr ((0.065564,0.021131),-155,-410,0.05);
+arcplr ((0.070249,0.021131),-155,-410,0.05);
resizedrawpen (0.4bp);
store (curpath)
drawn
-circle ((0.097703,-0.017171),0.002767);
+circle ((0.102388,-0.017171),0.002767);
resizedrawpen (0.8bp);
store (curpath)
drawn
-arcplr ((0.129843,0.021131),-130,-410,0.05);
+arcplr ((0.134527,0.021131),-130,-410,0.05);
resizedrawpen (0.4bp);
store (curpath)
drawn
-circle ((0.161982,-0.017171),0.002767);
+circle ((0.166667,-0.017171),0.002767);
resizedrawpen (0.8bp);
store (curpath)
drawn
-arcplr ((0.194121,0.021131),-130,-410,0.05);
+arcplr ((0.198806,0.021131),-130,-410,0.05);
resizedrawpen (0.4bp);
store (curpath)
drawn
-circle ((0.226261,-0.017171),0.002767);
+circle ((0.230945,-0.017171),0.002767);
resizedrawpen (0.8bp);
store (curpath)
drawn
-arcplr ((0.2584,0.021131),-130,-385,0.05);
+arcplr ((0.263085,0.021131),-130,-385,0.05);
resizedrawpen (0.4bp);
store (curpath)
drawn
-circle ((0.303716,0),0.002767);
+circle ((0.3084,0),0.002767);
resizedrawpen (0.8bp);
store (curpath)
drawn
polyline (false)
-((0.313085,0),
+((0.3084,0),
(0.333333,0));
endmfpic; % (3) line 59 in the TeX source.
@@ -163,68 +163,68 @@ store (curpath)
drawn
polyline (false)
((0,0),
-(0,-0.020249));
+(0,-0.024933));
resizedrawpen (0.4bp);
store (curpath)
drawn
-circle ((0,-0.020249),0.002767);
+circle ((0,-0.024933),0.002767);
resizedrawpen (0.8bp);
store (curpath)
drawn
-arcplr ((0.021131,-0.065564),115,-140,0.05);
+arcplr ((0.021131,-0.070249),115,-140,0.05);
resizedrawpen (0.4bp);
store (curpath)
drawn
-circle ((-0.017171,-0.097703),0.002767);
+circle ((-0.017171,-0.102388),0.002767);
resizedrawpen (0.8bp);
store (curpath)
drawn
-arcplr ((0.021131,-0.129843),140,-140,0.05);
+arcplr ((0.021131,-0.134527),140,-140,0.05);
resizedrawpen (0.4bp);
store (curpath)
drawn
-circle ((-0.017171,-0.161982),0.002767);
+circle ((-0.017171,-0.166667),0.002767);
resizedrawpen (0.8bp);
store (curpath)
drawn
-arcplr ((0.021131,-0.194121),140,-140,0.05);
+arcplr ((0.021131,-0.198806),140,-140,0.05);
resizedrawpen (0.4bp);
store (curpath)
drawn
-circle ((-0.017171,-0.226261),0.002767);
+circle ((-0.017171,-0.230945),0.002767);
resizedrawpen (0.8bp);
store (curpath)
drawn
-arcplr ((0.021131,-0.2584),140,-115,0.05);
+arcplr ((0.021131,-0.263085),140,-115,0.05);
resizedrawpen (0.4bp);
store (curpath)
drawn
-circle ((0,-0.303716),0.002767);
+circle ((0,-0.3084),0.002767);
resizedrawpen (0.8bp);
store (curpath)
drawn
polyline (false)
-((0,-0.313085),
+((0,-0.3084),
(0,-0.333333));
endmfpic; % (4) line 77 in the TeX source.
@@ -245,68 +245,68 @@ store (curpath)
drawn
polyline (false)
((0,0),
-(-0.020249,0));
+(-0.024933,0));
resizedrawpen (0.4bp);
store (curpath)
drawn
-circle ((-0.020249,0),0.002767);
+circle ((-0.024933,0),0.002767);
resizedrawpen (0.8bp);
store (curpath)
drawn
-arcplr ((-0.065564,-0.021131),25,-230,0.05);
+arcplr ((-0.070249,-0.021131),25,-230,0.05);
resizedrawpen (0.4bp);
store (curpath)
drawn
-circle ((-0.097703,0.017171),0.002767);
+circle ((-0.102388,0.017171),0.002767);
resizedrawpen (0.8bp);
store (curpath)
drawn
-arcplr ((-0.129843,-0.021131),50,-230,0.05);
+arcplr ((-0.134527,-0.021131),50,-230,0.05);
resizedrawpen (0.4bp);
store (curpath)
drawn
-circle ((-0.161982,0.017171),0.002767);
+circle ((-0.166667,0.017171),0.002767);
resizedrawpen (0.8bp);
store (curpath)
drawn
-arcplr ((-0.194121,-0.021131),50,-230,0.05);
+arcplr ((-0.198806,-0.021131),50,-230,0.05);
resizedrawpen (0.4bp);
store (curpath)
drawn
-circle ((-0.226261,0.017171),0.002767);
+circle ((-0.230945,0.017171),0.002767);
resizedrawpen (0.8bp);
store (curpath)
drawn
-arcplr ((-0.2584,-0.021131),50,-205,0.05);
+arcplr ((-0.263085,-0.021131),50,-205,0.05);
resizedrawpen (0.4bp);
store (curpath)
drawn
-circle ((-0.303716,-0),0.002767);
+circle ((-0.3084,-0),0.002767);
resizedrawpen (0.8bp);
store (curpath)
drawn
polyline (false)
-((-0.313085,0),
+((-0.3084,0),
(-0.333333,0));
endmfpic; % (5) line 95 in the TeX source.
@@ -327,68 +327,68 @@ store (curpath)
drawn
polyline (false)
((0,0),
-(0,0.020249));
+(0,0.024933));
resizedrawpen (0.4bp);
store (curpath)
drawn
-circle ((0,0.020249),0.002767);
+circle ((0,0.024933),0.002767);
resizedrawpen (0.8bp);
store (curpath)
drawn
-arcplr ((-0.021131,0.065564),-65,-320,0.05);
+arcplr ((-0.021131,0.070249),-65,-320,0.05);
resizedrawpen (0.4bp);
store (curpath)
drawn
-circle ((0.017171,0.097703),0.002767);
+circle ((0.017171,0.102388),0.002767);
resizedrawpen (0.8bp);
store (curpath)
drawn
-arcplr ((-0.021131,0.129843),-40,-320,0.05);
+arcplr ((-0.021131,0.134527),-40,-320,0.05);
resizedrawpen (0.4bp);
store (curpath)
drawn
-circle ((0.017171,0.161982),0.002767);
+circle ((0.017171,0.166667),0.002767);
resizedrawpen (0.8bp);
store (curpath)
drawn
-arcplr ((-0.021131,0.194121),-40,-320,0.05);
+arcplr ((-0.021131,0.198806),-40,-320,0.05);
resizedrawpen (0.4bp);
store (curpath)
drawn
-circle ((0.017171,0.226261),0.002767);
+circle ((0.017171,0.230945),0.002767);
resizedrawpen (0.8bp);
store (curpath)
drawn
-arcplr ((-0.021131,0.2584),-40,-295,0.05);
+arcplr ((-0.021131,0.263085),-40,-295,0.05);
resizedrawpen (0.4bp);
store (curpath)
drawn
-circle ((-0,0.303716),0.002767);
+circle ((-0,0.3084),0.002767);
resizedrawpen (0.8bp);
store (curpath)
drawn
polyline (false)
-((0,0.313085),
+((0,0.3084),
(0,0.333333));
endmfpic; % (6) line 113 in the TeX source.
diff --git a/graphics/circuit_macros/examples/shapes.m4 b/graphics/circuit_macros/examples/shapes.m4
index 749e09896d..f50b029230 100644
--- a/graphics/circuit_macros/examples/shapes.m4
+++ b/graphics/circuit_macros/examples/shapes.m4
@@ -6,7 +6,6 @@ divert(-1)
# shapes.m4
# 3D structures with complex surfaces and hidden lines are the domain of more
# sophisticated software packages, but basic shapes can be drawn with pic.
-#threeD_init
#####################################################
@@ -14,9 +13,9 @@ divert(-1)
[colored "color"])'
define(`cylinder3D',`[ Start: (0,0)
xdispl = `$1'; ydispl = `$2'; zdispl = `$3'
- diamc = ifelse(`$4',,(lenc/2),`$4') ; radc = diamc/2
define(`M4CL',`xdispl,ydispl,zdispl')dnl
lenc = length3D(M4CL)
+ diamc = ifelse(`$4',,(lenc/2),`$4') ; radc = diamc/2
cs = dot3D(View3D,M4CL)/lenc
End: (Project(M4CL))
az = atan2(ydispl,xdispl)
diff --git a/graphics/circuit_macros/examples/svg/EVplugsSVG.m4 b/graphics/circuit_macros/examples/svg/EVplugsSVG.m4
new file mode 100644
index 0000000000..54530a1bfa
--- /dev/null
+++ b/graphics/circuit_macros/examples/svg/EVplugsSVG.m4
@@ -0,0 +1,210 @@
+.PS
+# EV_lugs.m4
+# https://en.wikipedia.org/wiki/CHAdeMO
+gen_init
+divert(-1)
+
+ `EV_J1772(keys)
+ EV charging plug in a [] block
+ keys: wdth=expr; # plug width
+ diamLNP=expr; # diam of L1, N, PE
+ twdth=expr; # tab width
+ thgt=expr; # tab hght
+ thick=expr; # outer line thickness (pt)
+ inthick=expr; # inner line thickness (pt)
+ BG=attributes; # shaded gray etc
+ L1=attributes; # L1 attributes ...
+ N=attributes;
+ PE=attributes;
+ PP=attributes;
+ CP=attributes; '
+define(`pEVskale',25.4) dnl default plug size (20 mm)
+define(`EV_J1772',`[ pushkeys_(`$1', `wdth:20/pEVskale;
+ twdth:3.5/20*m4wdth; thgt:1.5/20*m4wdth; diamLNP:6/20*m4wdth;
+ thick:2; inthick:1.5; BG::N; L1::N; N::N; PE::N; PP::N; CP::N; ')
+ tang = atan2(m4twdth/2,m4wdth/2)*rtod_
+ TS: (Rect_(m4wdth/2,-90-tang)); TE: (Rect_(m4wdth/2,-90+tang))
+ Tab: line thick m4thick from TS down_ m4thgt \
+ then to TE-(0,m4thgt) then to TE m4BG
+ Arc: arc thick m4thick to TS with .c at (0,0) m4BG
+ round(at TS,last arc.thick); round(at TE,last arc.thick)
+ L1: circle diam m4diamLNP thick m4inthick at (Rect_(m4wdth/4,150)) m4L1
+ N: circle diam m4diamLNP thick m4inthick at (Rect_(m4wdth/4, 30)) m4N
+ PE: circle diam m4diamLNP thick m4inthick at (0,-m4wdth/4) m4PE
+ PP: circle diam m4diamLNP*0.55 thick m4inthick at (Rect_(m4wdth/3,210)) m4PP
+ CP: circle diam m4diamLNP*0.55 thick m4inthick at (Rect_(m4wdth/3,-30)) m4CP
+ `$2' popdef(`m4CP',`m4PP',`m4PE',`m4N',`m4L1',`m4BG',
+ `m4wdth',`m4diamLNP',`m4twdth',`m4thgt',`m4thick',`m4inthick') ]')
+
+ `EV_J3068(keys,shade)
+ EV charging plug in a [] block
+ keys: wdth=expr; # plug width
+ diamLNP=expr; # diam of L1, N, PE
+ twdth=expr; # tab width
+ thgt=expr; # tab hght
+ thick=expr; # outer line thickness (pt)
+ inthick=expr; # inner line thickness (pt)
+ BG=attributes; # shaded gray etc
+ L1|L2|L3=attributes; # pin attributes ...
+ N=attributes;
+ PE=attributes;
+ PP=attributes;
+ CP=attributes;
+ arg2= R:G:B background fill color '
+define(`EV_J3068',`[ pushkeys_(`$1',
+ `wdth:25/pEVskale; diamLNP:m4wdth*0.25; thick:2; inthick:1.5;
+ BG::N; L1::N; L2::N; L3::N; N::N; PE::N; PP::N; CP::N; ')
+ C: Here
+ NE: C+(Rect_(m4wdth/2,45)); NW: C+(Rect_(m4wdth/2,135))
+ Ac: NE-(1,1)/sqrt(2)*m4diamLNP/2
+ Arc: arc thick m4thick from NW to NE with .c at C m4BG ifelse(`$2',,,
+ `shaded rgbstring(patsubst(`$2',:,`,'))
+ line invis from NE to Ac+(0,m4diamLNP/2) \
+ then to Ac+(0,m4diamLNP/2) \
+ then to NW+(1,-1)/sqrt(2)*m4diamLNP/2 + (0,m4diamLNP/2) \
+ then to NW then to NE shaded rgbstring(patsubst(`$2',:,`,'))')
+ arc thick m4thick to Ac+(0,m4diamLNP/2) with .c at Ac m4BG
+ Top: line thick m4thick to (NW+NE-Ac, Here) m4BG
+ arc thick m4thick to NW with .c at Here+(0,-m4diamLNP/2) m4BG
+ PE: circle diam m4diamLNP thick m4inthick at C m4PE
+ PP: circle diam m4diamLNP*0.55 thick m4inthick at C+(Rect_(m4wdth/3,45)) m4PP
+ CP: circle diam m4diamLNP*0.55 thick m4inthick at C+(Rect_(m4wdth/3,135)) m4CP
+ L1: circle diam m4diamLNP thick m4inthick at C+(m4wdth*.3,0) m4L1
+ L2: circle diam m4diamLNP thick m4inthick at C+(Rect_(m4wdth*.3,-60)) m4L2
+ L3: circle diam m4diamLNP thick m4inthick at C+(Rect_(m4wdth*.3,-120)) m4L3
+ N: circle diam m4diamLNP thick m4inthick at C-(m4wdth*.3,0) m4N
+ `$3' popdef(`m4wdth',`m4diamLNP',`m4thick',`m4inthick',
+ `m4BG',`m4L1',`m4L2',`m4L3',`m4N',`m4PE',`m4PP',`m4CP') ]')
+
+ `EV_CCS1(J1772 keys,DC keys)
+ DC keys: wdth=expr; # DC socket width
+ hght=expr; # DC socket height
+ diamPM=expr; # diam of DC+, DC- circles
+ sep=expr; # separation of Jack and DC
+ thick=expr; # outer line thickness (pt)
+ inthick=expr; # inner line thickness (pt)
+ BG=attributes; # shaded gray etc
+ DCplus=attributes;
+ DCminus=attributes; '
+define(`EV_CCS1',`[
+ J: EV_J1772(`$1')
+ pushkeys_(`$2',`wdth:J.wid:23.5/20; hght:J.wid*11/20; diamPM:m4hght*7/11;
+ sep:J.wid*3/30; thick:J.Arc.thick; inthick:J.PE.thick;
+ BG::N; DCplus::N; DCminus::N;')
+ DC: [ Box: box thick m4thick wid m4wdth ht m4hght rad m4hght/2 m4BG
+ DCplus: circle thick m4inthick diam m4diamPM at Box.w+(m4hght/2,0) m4DCplus
+ DCminus:circle thick m4inthick diam m4diamPM at Box.e-(m4hght/2,0) m4DCminus
+ ] with .n at J.s+(0,-m4sep)
+ popdef(`m4wdth',`m4hght',`m4diamPM',`m4sep',`m4thick',`m4inthick',`m4BG',
+ `m4DCplus',`m4DCminus')
+ ]')
+
+ `EV_CCS2(J3068 keys,shade,DC keys)
+ DC keys: wdth=expr; # DC socket width
+ hght=expr; # DC socket height
+ diamPM=expr; # diam of DC+, DC- circles
+ sep=expr; # separation of Jack and DC
+ thick=expr; # outer line thickness (pt)
+ inthick=expr; # inner line thickness (pt)
+ BG=attributes; # shaded gray etc
+ DCplus=attributes;
+ DCminus=attributes;
+ arg2= R:G:B background fill color '
+define(`EV_CCS2',`[
+ J: EV_J3068(`$1',`$2')
+ pushkeys_(`$3',`wdth:J.wid:23.5/20; hght:J.wid*11/20; diamPM:m4hght*7/11;
+ sep:J.wid*3/30; thick:J.Arc.thick; inthick:J.PE.thick;
+ BG::N; DCplus::N; DCminus::N;')
+ DC: [ Box: box thick m4thick wid m4wdth ht m4hght rad m4hght/2 dnl
+ m4BG ifelse(`$2',,,`shaded rgbstring(patsubst(`$2',:,`,'))')
+ DCplus: circle thick m4inthick diam m4diamPM at Box.w+(m4hght/2,0) m4DCplus
+ DCminus:circle thick m4inthick diam m4diamPM at Box.e-(m4hght/2,0) m4DCminus
+ ] with .n at J.s+(0,-m4sep)
+ popdef(`m4wdth',`m4hght',`m4diamPM',`m4sep',`m4thick',`m4inthick',`m4BG',
+ `m4DCplus',`m4DCminus')
+ ]')
+
+ `EV_CHAdeMO(keys,shade)
+ EV charging plug in a [] block
+ keys: wdth=expr; # plug width
+ thick=expr; # outer line thickness (pt)
+ inthick=expr; # inner line thickness (pt)
+ BG=attributes; # background shaded gray etc
+ DCplus=|DCminusNS=|FG=|NC=|SS1=|DCP=|PP=|
+ CL=|CH=|SS2=attributes # pin attributes ...'
+define(`EV_CHAdeMO',`[ pushdef(`m4sk',33/140/pEVskale) pushkeys_(`$1',
+ `wdth:140*m4sk; thick:m4wdth*9/140/(1bp__); inthick:m4thick*1.5/9;
+ BG::N; DCplus::N; DCminus::N;N::N;S::N;
+ FG::N; NC::N; SS1::N; DCP::N; PP::N; CL::N; CH::N; SS2::N')
+ C: circle thick m4thick diam m4wdth-m4thick bp__ m4BG
+ line thick m4thick*0.6 from C+(Rect_(C.rad+m4thick bp__*3/4,42)) \
+ to C+(Rect_(C.rad+m4thick bp__*3/4,50)) then left m4thick bp__ m4BG
+ line thick m4thick*0.6 from C+(Rect_(C.rad+m4thick bp__*3/4,138)) \
+ to C+(Rect_(C.rad+m4thick bp__*3/4,130)) then right m4thick bp__ m4BG
+ idiam = (m4wdth-m4thick bp__*2)*47/(27+47*2)
+ N: circle diam idiam thick m4inthick with .n at C.n-(0,m4thick bp__/2) m4N
+ S: circle diam idiam thick m4inthick with .s at C.s+(0,m4thick bp__/2) m4S
+ E: circle diam idiam thick m4inthick at Cintersect(N,N.diam,S,S.diam) m4DCminus
+ W: circle diam idiam thick m4inthick at Cintersect(S,S.diam,N,N.diam) m4DCplus
+ Loopover_(`Z',
+ `line thick m4inthick up Z.diam*0.6 right Z.diam*0.6 with .c at Z
+ line thick m4inthick up Z.diam*0.6 left Z.diam*0.6 with .c at Z',N,S)
+ Loopover_(`L',`L: circle diam idiam/4 thick linethick/2 \
+ at N+(Rect_(idiam/4,90*m4Lx)) m4xpand(m4`'L)',FG,NC,DCP,SS1)
+ Loopover_(`L',`L: circle diam idiam/4 thick linethick/2 \
+ at S+(Rect_(idiam/4,90*m4Lx)) m4xpand(m4`'L)',PP,CL,SS2,CH)
+ `$3' popdef(`m4sk',`m4wdth',`m4thick',`m4inthick',`m4BG',
+ `m4DCplus',`m4DCminus',`m4N',`m4S',
+ `m4FG',`m4NC',`m4SS1',`m4DCP',`m4PP',`m4CL',`m4CH',`m4SS2') ]')
+
+divert(0)dnl
+
+ ifsvg(svg_font(sans-serif,6bp__))
+ iflatex(command "{\sf\scriptsize")
+ define(`EVsmall',`ifsvg(svg_small(`$1'),{\tiny `$1'})')
+ define(`EVtxt',`ifsvg(``$1'',`{patsubst(`$1',_,\\_)}')')
+ define(`EVk',`ifsvg(+(0,0.75bp__))')
+
+[
+P1: EV_J1772(BG=fill_(0.75); PE=fill_(1) "PE";L1=fill_(1) "L1";N=fill_(1) "N";
+ PP=fill_(1); CP=fill_(1);)
+ "EVsmall(PP)" at P1.PP EVk
+ "EVsmall(CP)" at P1.CP EVk
+
+P2: EV_J3068(PE=shaded "green" "PE";\
+ L1=shaded "yellow" "L1";L2=shaded "yellow" "L2";L3=shaded "yellow" "L3";
+ N=fill_(1) "N";",
+ 0.85:0.85:0.85) at P1+(15bp__,0) \
+ with .w at P1.e+(P1.wid/5,0)
+ "EVsmall(PP)" at P2.PP EVk
+ "EVsmall(CP)" at P2.CP EVk
+
+P3: EV_CCS1(L1="L1";N="N";PE="PE",
+ DCplus="DC+";DCminus="DC-") with .w at P2.e+(P1.wid/5,0)
+ "EVsmall(PP)" at P3.J.PP EVk
+ "EVsmall(CP)" at P3.J.CP EVk
+
+P4: EV_CCS2(L1="L1";L2="L2";L3="L3";N="N";PE="PE",0.85:0.85:0.85,
+ DCplus="DC+";DCminus="DC-") with .w at P3.e+(P1.wid/5,0)
+ "EVsmall(PP)" at P4.J.PP EVk
+ "EVsmall(CP)" at P4.J.CP EVk
+P5: EV_CHAdeMO( BG=outlined "blue" fill_(0.8);
+ DCplus=shaded "red" "DC+";
+ DCminus=shaded "red" "DC-";
+ Loopover_(`L',`L=fill_(1);',N,S)
+ FG=shaded "green";
+ Loopover_(`L',`L=shaded "orange";',SS1,DCP,NC,PP,CH,SS2,CL)) \
+ with .w at P4.e+(P4.w.x-P3.e.x,0)
+ Loopover_(`L',`"EVsmall(L)" at P5.L EVk',FG,NC,DCP,SS1,PP,CL,CH,SS2)
+#
+ ifsvg(move from P5.e right 0.2)
+ "EVtxt(`EV_CCS2')" at P4.s+(0,-10bp__)
+ "EVtxt(`EV_CCS1')" at (P3,last "")
+ "EVtxt(`EV_J3068')" at (P2,last "")
+ "EVtxt(`EV_J1772')" at (P1,last "")
+ "EVtxt(`EV_CHAdeMO')" at (P5,last "")
+ ] # with .nw at last [].sw+(0,-0.2)
+
+ iflatex(command "}%")
+ ifsvg(command "</g>")
+.PE
diff --git a/graphics/circuit_macros/examples/svg/GeometrySVG.m4 b/graphics/circuit_macros/examples/svg/GeometrySVG.m4
index 576315d285..38e748d7e3 100644
--- a/graphics/circuit_macros/examples/svg/GeometrySVG.m4
+++ b/graphics/circuit_macros/examples/svg/GeometrySVG.m4
@@ -107,7 +107,7 @@ Fig3: [ ls = 3/4 # local scale
ArcAngle(N,P,Q,0.4); "svg_beta" at last arc.ne above ljust
ArcAngle(O,P,N,0.5); "svg_alpha" at last arc.start+(5bp__,8bp__)
ArcAngle(R,Q,N,0.5); "svg_alpha" at last arc.start+(8bp__,-5bp__)
- ] with .sw at Fig2.e+(-0.4,-0.7)
+ ] with .sw at Fig2.e+(-0.2,-0.7)
Fig4: [ ls = 2/3 # local scale
A: Here; "A" at A above
@@ -149,6 +149,6 @@ Fig4: [ ls = 2/3 # local scale
line dashed from X to Y chop -linewid/2
RightAngle(A,Z,Y)
- ] with .w at Fig3.e+(-0.4,0.8)
+ ] with .sw at (Fig3.e,Fig2.s)
.PE
diff --git a/graphics/circuit_macros/examples/svg/Makefile b/graphics/circuit_macros/examples/svg/Makefile
index c3144811dc..0d68dcac3b 100644
--- a/graphics/circuit_macros/examples/svg/Makefile
+++ b/graphics/circuit_macros/examples/svg/Makefile
@@ -56,7 +56,7 @@ CCTSVG = \
ContactSVG.svg ContactsSVG.svg \
CrowSVG.svg CsourceSVG.svg \
DecoderSVG.svg DemultiplexerSVG.svg DiniSVG.svg DiodesSVG.svg DriveSVG.svg \
- EEPSVG.svg EmarrowsSVG.svg EscherSVG.svg \
+ EEPSVG.svg EmarrowsSVG.svg EscherSVG.svg EVplugsSVG.svg \
FlowSVG.svg FontsSVG.svg FusesSVG.svg \
GeometrySVG.svg GrayCodeSVG.svg GroundsSVG.svg \
HeadersSVG.svg HeathkitSVG.svg \
diff --git a/graphics/circuit_macros/examples/svg/ResistorsSVG.m4 b/graphics/circuit_macros/examples/svg/ResistorsSVG.m4
index 4da2b4f344..fe88a79ad3 100644
--- a/graphics/circuit_macros/examples/svg/ResistorsSVG.m4
+++ b/graphics/circuit_macros/examples/svg/ResistorsSVG.m4
@@ -36,7 +36,7 @@ vm = 0.28
{
{ebox(,,,0.6) ; move ; "`ebox(,,,0.6) '" ljust}
move right_ hm
- {ebox(,,,,shaded "green") ; move ;"`ebox(,,,,shaded \"green\") '" ljust}
+ {ebox(,,,,shaded "yellow") ; move ;"`ebox(,,,,shaded \"yellow\") '" ljust}
}
move down vm; right_
{
diff --git a/graphics/circuit_macros/examples/svg/SmithchartSVG.m4 b/graphics/circuit_macros/examples/svg/SmithchartSVG.m4
index eb47e6585e..7d80e3e01e 100644
--- a/graphics/circuit_macros/examples/svg/SmithchartSVG.m4
+++ b/graphics/circuit_macros/examples/svg/SmithchartSVG.m4
@@ -215,8 +215,8 @@ Loopover_(`rca',
iflatex(command "}%",
ifsvg(command "</g>"))
-] at (0,0)')
+] ')
-Smithchart
+Smithchart at (0,0)
.PE
diff --git a/graphics/circuit_macros/examples/svg/examplesSVG.htmx b/graphics/circuit_macros/examples/svg/examplesSVG.htmx
index f2ea0d8bc5..af8a15f840 100644
--- a/graphics/circuit_macros/examples/svg/examplesSVG.htmx
+++ b/graphics/circuit_macros/examples/svg/examplesSVG.htmx
@@ -84,9 +84,7 @@ produced, followed by an additional processing step to convert to svg.
Two possibilities for the latter are
<A HREF="https://www.ctan.org/pkg/dvisvgm">dvisvgm</A>
and
- <A HREF="https://github.com/dawbarton/pdf2svg">pdf2svg</A> although
-there may be font-related issues for some diagrams.
-<br>
+ <A HREF="https://github.com/dawbarton/pdf2svg">pdf2svg</A>.
Many circuit and similar diagrams intended for the web do not
require sophisticated labels, however; the examples shown below might
be representative.
@@ -96,7 +94,7 @@ be representative.
</p>
<hr>
<p>
-There are a number of other issues:
+There are other issues:
<ul>
<li> Embedding .svg files in html documents with the &lt;embed&gt; or
&lt;object&gt; tag seems to be a perennial issue.
@@ -381,6 +379,10 @@ cfig(ConnSVG,
cfig(PconnSVG,
The m4tt`'pconnex</g> macro)
+cfig(EVplugsSVG,
+ Electric vehicle charging plug patterns make extensive
+ use of key=value pairs to set options)
+
cfig(HeadersSVG,
The m4tt`'Header</g> macro)
@@ -398,7 +400,8 @@ cfig(ujtSVG,
UJT examples)
cfig(thyristorSVG,
- Thyristor examples)
+ Thyristor examples. The thyristor is a 3- or 4-terminal
+ composite element)
cfig(BipSVG,
Bipolar transistors (drawing direction: up))
@@ -632,7 +635,11 @@ cfig(GeometrySVG,
Plane geometry examples)
cfig(randomSVG,
- Testing random numbers)
+ Testing random number generation
+ using dpic macro
+ m4tt`'randn(</g><g
+ style="font-family:italic">array name`,' mean`,' std dev</g>m4tt`')</g>
+ which calls dpic built-in m4tt`'rand()</g>)
cfig(expSVG,
Test of m4tt`'project</g> and other m4tt`'lib3D</g>
diff --git a/graphics/circuit_macros/examples/svg/shapesSVG.m4 b/graphics/circuit_macros/examples/svg/shapesSVG.m4
index b0b66fa0bb..3deae68c60 100644
--- a/graphics/circuit_macros/examples/svg/shapesSVG.m4
+++ b/graphics/circuit_macros/examples/svg/shapesSVG.m4
@@ -6,7 +6,6 @@ divert(-1)
# shapes.m4
# 3D structures with complex surfaces and hidden lines are the domain of more
# sophisticated software packages, but basic shapes can be drawn with pic.
-#threeD_init
#####################################################
@@ -14,9 +13,9 @@ divert(-1)
[colored "color"])'
define(`cylinder3D',`[ Start: (0,0)
xdispl = `$1'; ydispl = `$2'; zdispl = `$3'
- diamc = ifelse(`$4',,(lenc/2),`$4') ; radc = diamc/2
define(`M4CL',`xdispl,ydispl,zdispl')dnl
lenc = length3D(M4CL)
+ diamc = ifelse(`$4',,(lenc/2),`$4') ; radc = diamc/2
cs = dot3D(View3D,M4CL)/lenc
End: Project(M4CL)
az = atan2(ydispl,xdispl)
diff --git a/graphics/circuit_macros/examples/xfig/xfiglib.fig b/graphics/circuit_macros/examples/xfig/xfiglib.fig
index c9c51e7097..06a50cdd6d 100644
--- a/graphics/circuit_macros/examples/xfig/xfiglib.fig
+++ b/graphics/circuit_macros/examples/xfig/xfiglib.fig
@@ -17,41 +17,41 @@ Single
-6
6 375 75 600 675
2 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 0 2
- 525 675 525 551
-6 440 205 549 556
-1 3 0 0 0 -1 0 -1 -1 0 1 0.0 525 551 3 3 528 551 528 551
-5 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 500 496 525 551 441 483 546 458
-1 3 0 0 0 -1 0 -1 -1 0 1 0.0 546 458 3 3 549 458 549 458
-5 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 500 419 546 458 440 419 546 381
-1 3 0 0 0 -1 0 -1 -1 0 1 0.0 546 381 3 3 549 381 549 381
-5 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 500 342 546 381 440 342 546 303
-1 3 0 0 0 -1 0 -1 -1 0 1 0.0 546 303 3 3 549 303 549 303
-5 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 500 265 546 303 441 278 525 211
-1 3 0 0 0 -1 0 -1 -1 0 1 0.0 525 211 3 3 528 211 528 211
+ 525 675 525 545
+6 440 199 549 551
+1 3 0 0 0 -1 0 -1 -1 0 1 0.0 525 545 3 3 528 545 528 545
+5 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 500 491 525 545 441 478 546 452
+1 3 0 0 0 -1 0 -1 -1 0 1 0.0 546 452 3 3 549 452 549 452
+5 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 500 414 546 452 440 414 546 375
+1 3 0 0 0 -1 0 -1 -1 0 1 0.0 546 375 3 3 549 375 549 375
+5 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 500 336 546 375 440 336 546 298
+1 3 0 0 0 -1 0 -1 -1 0 1 0.0 546 298 3 3 549 298 549 298
+5 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 500 259 546 298 441 272 525 205
+1 3 0 0 0 -1 0 -1 -1 0 1 0.0 525 205 3 3 528 205 528 205
-6
2 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 0 2
- 525 199 525 75
+ 525 205 525 75
-6
6 750 75 975 675
2 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 0 2
- 900 675 900 551
-6 815 205 924 556
-1 3 0 0 0 -1 0 -1 -1 0 1 0.0 900 551 3 3 903 551 903 551
-5 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 875 496 900 551 816 483 921 458
-1 3 0 0 0 -1 0 -1 -1 0 1 0.0 921 458 3 3 924 458 924 458
-5 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 875 419 921 458 815 419 921 381
-1 3 0 0 0 -1 0 -1 -1 0 1 0.0 921 381 3 3 924 381 924 381
-5 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 875 342 921 381 815 342 921 303
-1 3 0 0 0 -1 0 -1 -1 0 1 0.0 921 303 3 3 924 303 924 303
-5 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 875 265 921 303 816 278 900 211
-1 3 0 0 0 -1 0 -1 -1 0 1 0.0 900 211 3 3 903 211 903 211
+ 900 675 900 545
+6 815 199 924 551
+1 3 0 0 0 -1 0 -1 -1 0 1 0.0 900 545 3 3 903 545 903 545
+5 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 875 491 900 545 816 478 921 452
+1 3 0 0 0 -1 0 -1 -1 0 1 0.0 921 452 3 3 924 452 924 452
+5 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 875 414 921 452 815 414 921 375
+1 3 0 0 0 -1 0 -1 -1 0 1 0.0 921 375 3 3 924 375 924 375
+5 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 875 336 921 375 815 336 921 298
+1 3 0 0 0 -1 0 -1 -1 0 1 0.0 921 298 3 3 924 298 924 298
+5 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 875 259 921 298 816 272 900 205
+1 3 0 0 0 -1 0 -1 -1 0 1 0.0 900 205 3 3 903 205 903 205
-6
2 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 0 2
- 790 551 790 199
+ 790 545 790 205
2 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 0 2
- 752 551 752 199
+ 752 545 752 205
2 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 0 2
- 900 199 900 75
+ 900 205 900 75
-6
6 1125 75 1200 675
2 1 0 1 0 -1 0 -1 -1 0 0 0 0 0 0 2
diff --git a/graphics/circuit_macros/gpic.m4 b/graphics/circuit_macros/gpic.m4
index 78c643dc5b..66905f7308 100644
--- a/graphics/circuit_macros/gpic.m4
+++ b/graphics/circuit_macros/gpic.m4
@@ -1,7 +1,7 @@
divert(-1)
gpic.m4 Initialization for gpic.
-* Circuit_macros Version 9.9, copyright (c) 2022 J. D. Aplevich under *
+* Circuit_macros Version 10.0, copyright (c) 2022 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
diff --git a/graphics/circuit_macros/lib3D.m4 b/graphics/circuit_macros/lib3D.m4
index 8413b335ea..7d813f6e27 100644
--- a/graphics/circuit_macros/lib3D.m4
+++ b/graphics/circuit_macros/lib3D.m4
@@ -3,7 +3,7 @@ lib3D.m4 Macros for rotation, projection, and other
operations on argument triples representing
3D vectors or colors.
-* Circuit_macros Version 9.9, copyright (c) 2022 J. D. Aplevich under *
+* Circuit_macros Version 10.0, copyright (c) 2022 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
diff --git a/graphics/circuit_macros/libSLD.m4 b/graphics/circuit_macros/libSLD.m4
index 3ad627c4cf..75ca43cdce 100644
--- a/graphics/circuit_macros/libSLD.m4
+++ b/graphics/circuit_macros/libSLD.m4
@@ -2,7 +2,7 @@ divert(-1)
libSLD.m4 Draft macros for single-line diagram elements
-* Circuit_macros Version 9.9, copyright (c) 2022 J. D. Aplevich under *
+* Circuit_macros Version 10.0, copyright (c) 2022 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
diff --git a/graphics/circuit_macros/libcct.m4 b/graphics/circuit_macros/libcct.m4
index 16ae9ba91e..5ce00640ac 100644
--- a/graphics/circuit_macros/libcct.m4
+++ b/graphics/circuit_macros/libcct.m4
@@ -1,7 +1,7 @@
divert(-1)
libcct.m4
-* Circuit_macros Version 9.9, copyright (c) 2022 J. D. Aplevich under *
+* Circuit_macros Version 10.0, copyright (c) 2022 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
@@ -450,6 +450,7 @@ define(`rarrow',`define(`m4h',`min(lin_leng(last line),linewid)/2')dnl
`inductor( linespec, W|L, cycles, M|P|K[n],
loop wid )
W=wide arcs (default narrow); L=looped arcs
+ arg3= integer (number of loops)
arg4= M[n]=metal core
P[n]=(ferrite) powder core (dashed lines)
K[n]=long-dashed core lines
@@ -459,7 +460,7 @@ define(`rarrow',`define(`m4h',`min(lin_leng(last line),linewid)/2')dnl
define(`inductor',`eleminit_(`$1')
define(`m4hlw',`ifelse(`$5',,`dimen_/10',`($5)/2')')dnl half loop wid
define(`m4n',`ifelse(`$3',,4,`$3')')dnl
- ifelse(`$2',W, `define(`m4wd',((2*m4n-2)*m4c2t+2)*m4hlw)',
+ ifelse(`$2',W, `define(`m4wd',((2*m4n-2)*m4c2t+2*m4ct)*m4hlw)',
`$2',L, `define(`m4wd',(m4n+1)*m4hlw)',
`define(`m4ht',`ifelse(`$5',,`dimen_/16',(`$5')/2)')dnl half other loop wid
define(`m4wd',m4n*m4ht*2)')dnl
@@ -2010,6 +2011,7 @@ define(`m4_rad_arr',`{{`$1': line invis to rrot_(m4_len,0,ang)}
`thyristor(linespec,
[SCR|SCS|SUS|SBS|IEC][chars])
Composite element in [ ] block
+ (To place as two-terminal, see thyristor_t()).
SCR: silicon controlled rectifier (default)
SCS: silicon controlled switch
SUS: silicon unilateral switch
@@ -2064,22 +2066,30 @@ define(`thyristor',
`m4gen_d( LG'xtract(m4thx,G)`uA`'m4thAc`'HdQ`'m4thAc`'R,m4thf)')')
ifinstr(m4thf,E,`Env: circle diam m4thyd with .c at rvec_(rp_len/2,0)')
`$3']')')')
+ `thyristor_t(linespec, thyristor chars], label)
+ A wrapper to place thyristor(linespec,...)
+ as a two-terminal element with arg3
+ as label of the [] block (see also scr())'
+define(`thyristor_t',`eleminit_(`$1')
+ M4_thyS: last line.start; M4_thyE: last line.end
+ ifelse(`$3',,,`$3:') thyristor(from M4_thyS to M4_thyE,`$2',`$4') \
+ with .A at M4_thyS; line invis from M4_thyS to M4_thyE')
`scr(linespec, [R][E], label) and similar
Place thyristor as a two-term element with
arg 3 as label of the [] block'
define(`scr',`eleminit_(`$1'); M4_scrS: last line.start; M4_scrE: last line.end
ifelse(`$3',,,`$3:') thyristor(from M4_scrS to M4_scrE,SCR`'`$2',`$4') \
- with .A at M4_scrS')
-define(`scs',`eleminit_(`$1'); M4_scrS: last line.start; M4_scrE: last line.end
- ifelse(`$3',,,`$3:') thyristor(from M4_scrS to M4_scrE,SCS`'`$2'`',`$4') \
- with .A at M4_scrS')
-define(`sus',`eleminit_(`$1'); M4_scrS: last line.start; M4_scrE: last line.end
- ifelse(`$3',,,`$3:') thyristor(from M4_scrS to M4_scrE,SUS`'`$2'`',`$4') \
- with .A at M4_scrS')
-define(`sbs',`eleminit_(`$1'); M4_scrS: last line.start; M4_scrE: last line.end
- ifelse(`$3',,,`$3:') thyristor(from M4_scrS to M4_scrE,SBS`'`$2'`',`$4') \
- with .A at M4_scrS')
+ with .A at M4_scrS; line invis from M4_scrS to M4_scrE')
+define(`scs',`eleminit_(`$1'); M4_scsS: last line.start; M4_scsE: last line.end
+ ifelse(`$3',,,`$3:') thyristor(from M4_scsS to M4_scsE,SCS`'`$2',`$4') \
+ with .A at M4_scsS; line invis from M4_scsS to M4_scsE')
+define(`sus',`eleminit_(`$1'); M4_susS: last line.start; M4_susE: last line.end
+ ifelse(`$3',,,`$3:') thyristor(from M4_susS to M4_susE,SUS`'`$2',`$4') \
+ with .A at M4_susS; line invis from M4_susS to M4_susE')
+define(`sbs',`eleminit_(`$1'); M4_sbsS: last line.start; M4_sbsE: last line.end
+ ifelse(`$3',,,`$3:') thyristor(from M4_sbsS to M4_sbsE,SBS`'`$2',`$4') \
+ with .A at M4_sbsS; line invis from M4_sbsS to M4_sbsE')
`tgate( linespec, [B][R|L] ) Transmission gate
B= box form
@@ -2131,11 +2141,10 @@ define(`ptrans',`[ eleminit_(`$1') define(`m4ptm',ifinstr(`$2',L,-))
define(`tline',`eleminit_(`$1')
define(`m4v',`ifelse(`$2',,`dimen_/6',`($2)')')dnl
define(`m4h',`ifelse(`$3',,`dimen_*2/3',min(rp_len-m4v/2,`$3'))')dnl
- {[box invis ht_ m4v wid_ m4h+m4v/2] at last line.c}
{line from last line.c+vec_(m4h/2+m4v/4,0) \
to last line.end}
{line to 2nd last line.c+vec_(-m4h/2,0); round
- ifdpic(
+ [ifdpic(
`line from rvec_(0,-m4v/2) \
to rvec_(m4h,-m4v/2)
spline 0.5523 to rvec_(m4v/4,0) \
@@ -2159,8 +2168,8 @@ define(`tline',`eleminit_(`$1')
then to Here \
then to rvec_(-m4v/2,0) \
then to rvec_(-m4v/2,-m4v)\
- then to rvec_(0,-m4v)') }
- line to 5th last line.end invis ')
+ then to rvec_(0,-m4v)')] with .c at rvec_(m4h/2,0) }
+ line to 3rd last line.end invis ')
define(`m4_U',`dimen_/10') `Semiconductor grid size'
define(`m4_Aht',`m4_U*10/6') `Semiconductor arrowhead ht and wd'
@@ -2935,7 +2944,8 @@ define(`contacts',`[
Arg 2 deprecated, kept for compatibility
chars:
O|C= normally open, normally closed (default)
- I= open circles for contacts
+ I= open dots for contacts
+ X= filled dots
P= three position
R= right orientation (default left)
T= T contacts
@@ -2943,12 +2953,13 @@ define(`contacts',`[
define(`contact',`[ dnl
define(`m4pm',`ifelse(ifinstr(`$1',R,R,`$2',R,R),R,-)')dnl
define(`m4dr',`dotrad_')define(`m4TL',dimen_/12)dnl
- P: dot(,m4dr,1)
+ define(`m4fll',`ifinstr(`$1',X,,1)')dnl
+ P: dot(,m4dr,m4fll)
T: P+vec_(dimen_/2-dimen_/12,0)
ifinstr(`$1',P,`ifinstr(
`$1',I,
- `{C: dot(at T+vec_(0,m4pm`'(dimen_/8+m4dr*2+lthick/2)),m4dr,1)}
- {O: dot(at T-vec_(0,m4pm`'(dimen_/8+m4dr*2+lthick/2)),m4dr,1)}
+ `{C: dot(at T+vec_(0,m4pm`'(dimen_/8+m4dr*2+lthick/2)),m4dr,m4fll)}
+ {O: dot(at T-vec_(0,m4pm`'(dimen_/8+m4dr*2+lthick/2)),m4dr,m4fll)}
A: line from P to ifinstr(
`$1',O,`(LCtangent(P,O,dotrad_+lthick/2)) chop m4dr chop -m4dr',
`$1',C,`(LCtangent(P,C,dotrad_+lthick/2,R)) chop m4dr chop -m4dr',
@@ -2990,7 +3001,7 @@ define(`contact',`[ dnl
`move to T
ifinstr(
`$1',I,
- `{ C: dot(at rvec_(0,m4pm`'(m4dr+lthick/2)),m4dr,1) }
+ `{ C: dot(at rvec_(0,m4pm`'(m4dr+lthick/2)),m4dr,m4fll) }
ifinstr(m4CO,O,,`O: Here')',
`$1',U,
`{C: T+vec_(m4TL*2,m4pm`'(dimen_/6))
@@ -3009,7 +3020,7 @@ define(`contact',`[ dnl
`move to T+vec_(0,-(m4pm`'dimen_/8))
ifinstr(
`$1',I,
- `{O: dot(at rvec_(0,m4pm`'(-m4dr*2)),m4dr,1) }
+ `{O: dot(at rvec_(0,m4pm`'(-m4dr*2)),m4dr,m4fll) }
ifinstr(m4CO,C,,`C: T ')',
`$1',U,
`{O: T+vec_(m4TL*2,m4pm`'(-dimen_/6))
@@ -3027,7 +3038,6 @@ define(`contact',`[ dnl
')
`$3'] ')
-
`relaycoil( chars, wid, ht, U|D|L|R|degrees )
chars: (see IEC 60617 S00305 - S00319)
X or default: external lines from A2 and B2
diff --git a/graphics/circuit_macros/libgen.m4 b/graphics/circuit_macros/libgen.m4
index 9fe00c721c..c066b7527b 100644
--- a/graphics/circuit_macros/libgen.m4
+++ b/graphics/circuit_macros/libgen.m4
@@ -2,7 +2,7 @@ divert(-1)
libgen.m4 Base macros for dpic and gpic diagrams
-* Circuit_macros Version 9.9, copyright (c) 2022 J. D. Aplevich under *
+* Circuit_macros Version 10.0, copyright (c) 2022 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
@@ -184,7 +184,7 @@ define(`SIdefaults',
define(`latexcommand',`command "ifmpost(verbatimtex) `$1' ifmpost(etex)"')
define(`m4announceprocessor',`dnl Do not change the format of the next line:
-`#' `$1' Version 9.9: ifelse(m4picprocessor,gpic,`Gpic',
+`#' `$1' Version 10.0: ifelse(m4picprocessor,gpic,`Gpic',
m4postprocessor,pstricks,`PSTricks',
m4postprocessor,pgf,`TikZ PGF',
m4postprocessor,mfpic,`Mfpic',
@@ -614,10 +614,10 @@ define(`up__',`ifelse(m4_dir_,right,up,m4_dir_,left,down,m4_dir_,up,left,right)'
Binary operations giving simplified readable
expressions for obvious cases.
define(`prod_',`ifelse($1,0,0,$1,-0,0,$2,0,0,$2,-0,0,$1,1,`$2',$2,1,`$1',
- $1,-1,`-($2)',$2,-1,`-($1)',`($1)*($2)')')
+ $1,-1,`(-($2))',$2,-1,`(-($1))',`(($1)*($2))')')
define(`sum_',`ifelse($1,0,`$2',$1,-0,`$2',$2,0,`$1',$2,-0,`$1',
index($2,-),0,`$1$2',`($1+$2)')')
-define(`diff_',`ifelse($2,0,`$1',$2,-0,`$1',$1,0,`-($2)',$1,-0,`-($2)',
+define(`diff_',`ifelse($2,0,`$1',$2,-0,`$1',$1,0,`(-($2))',$1,-0,`(-($2))',
`($1-($2))')')
Like prod_ but parentheses are *not* added
to the first argument, which is assumed to be
@@ -1625,6 +1625,12 @@ define(`along_',`between `$1'.start and `$1'.end')
define(`Along_',`(ifelse(`$2',,1,`(`$2')/lin_leng(`$1')') between \
`$1'.ifelse(`$3',R,end,start) and `$1'.ifelse(`$3',R,start,end))')
+ `Between_(Pos1,Pos2,distance,[R])
+ position distance from Pos1 toward Pos2
+ arg4=R: from Pos2 to Pos1'
+define(`Between_',`ifelse(`$4',R,`1-')(`$3')/distance(`$1',`$2') between \
+ `$1' and `$2'')
+
`showbox_(planar object,boxspec,P)
Convenience to draw the bounding box of an obj
(default last []),
diff --git a/graphics/circuit_macros/liblog.m4 b/graphics/circuit_macros/liblog.m4
index f89e39b486..560ec993a2 100644
--- a/graphics/circuit_macros/liblog.m4
+++ b/graphics/circuit_macros/liblog.m4
@@ -1,7 +1,7 @@
divert(-1)
liblog.m4 Logic gates
-* Circuit_macros Version 9.9, copyright (c) 2022 J. D. Aplevich under *
+* Circuit_macros Version 10.0, copyright (c) 2022 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
diff --git a/graphics/circuit_macros/mfpic.m4 b/graphics/circuit_macros/mfpic.m4
index 1670be9104..000e142962 100644
--- a/graphics/circuit_macros/mfpic.m4
+++ b/graphics/circuit_macros/mfpic.m4
@@ -1,7 +1,7 @@
divert(-1)
mfpic.m4 Initialization for mfpic.
-* Circuit_macros Version 9.9, copyright (c) 2022 J. D. Aplevich under *
+* Circuit_macros Version 10.0, copyright (c) 2022 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
diff --git a/graphics/circuit_macros/mpost.m4 b/graphics/circuit_macros/mpost.m4
index 8e3acae6ec..d812116b63 100644
--- a/graphics/circuit_macros/mpost.m4
+++ b/graphics/circuit_macros/mpost.m4
@@ -1,7 +1,7 @@
divert(-1)
mpost.m4 Initialization for metapost.
-* Circuit_macros Version 9.9, copyright (c) 2022 J. D. Aplevich under *
+* Circuit_macros Version 10.0, copyright (c) 2022 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
diff --git a/graphics/circuit_macros/pgf.m4 b/graphics/circuit_macros/pgf.m4
index 73dc439b94..0739b80694 100644
--- a/graphics/circuit_macros/pgf.m4
+++ b/graphics/circuit_macros/pgf.m4
@@ -1,7 +1,7 @@
divert(-1)
pgf.m4 Initialization for Tikz-pgf.
-* Circuit_macros Version 9.9, copyright (c) 2022 J. D. Aplevich under *
+* Circuit_macros Version 10.0, copyright (c) 2022 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
diff --git a/graphics/circuit_macros/postscript.m4 b/graphics/circuit_macros/postscript.m4
index 3b724e380a..19f0a0dbed 100644
--- a/graphics/circuit_macros/postscript.m4
+++ b/graphics/circuit_macros/postscript.m4
@@ -1,7 +1,7 @@
divert(-1)
postscript.m4 Initialization for Postscript output.
-* Circuit_macros Version 9.9, copyright (c) 2022 J. D. Aplevich under *
+* Circuit_macros Version 10.0, copyright (c) 2022 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
diff --git a/graphics/circuit_macros/psfrag.m4 b/graphics/circuit_macros/psfrag.m4
index 78b117ac40..d69f34564e 100644
--- a/graphics/circuit_macros/psfrag.m4
+++ b/graphics/circuit_macros/psfrag.m4
@@ -2,7 +2,7 @@ divert(-1)
psfrag.m4 Initialization for dpic -f processing:
Postscript with psfrag strings
-* Circuit_macros Version 9.9, copyright (c) 2022 J. D. Aplevich under *
+* Circuit_macros Version 10.0, copyright (c) 2022 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
diff --git a/graphics/circuit_macros/pstricks.m4 b/graphics/circuit_macros/pstricks.m4
index 822bd94c83..fd7ba7fbd4 100644
--- a/graphics/circuit_macros/pstricks.m4
+++ b/graphics/circuit_macros/pstricks.m4
@@ -1,7 +1,7 @@
divert(-1)
pstricks.m4 Initialization for PSTricks.
-* Circuit_macros Version 9.9, copyright (c) 2022 J. D. Aplevich under *
+* Circuit_macros Version 10.0, copyright (c) 2022 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
diff --git a/graphics/circuit_macros/svg.m4 b/graphics/circuit_macros/svg.m4
index 73f144594f..5eb5bebfc6 100644
--- a/graphics/circuit_macros/svg.m4
+++ b/graphics/circuit_macros/svg.m4
@@ -1,7 +1,7 @@
divert(-1)
svg.m4 Initialization for SVG output.
-* Circuit_macros Version 9.9, copyright (c) 2022 J. D. Aplevich under *
+* Circuit_macros Version 10.0, copyright (c) 2022 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
@@ -48,13 +48,15 @@ divert(-1)
text)
Note: nominal ht = text height in drawing units,
e.g. 12bp__ for 12pt text
-   actual height = nominal ht * dptextratio '
-define(`svg_font',`ifinstr(`$2',:,
+ actual height = nominal ht * dptextratio '
+define(`svg_font',`m4thtmp=textht; ifinstr(`$2',:,
`stacksplit_(`m4svgf',`$2',:)
- ifelse(m4svgf,,,dptextratio = m4svgf; )popdef(`m4svgf')dnl
- ifelse(m4svgf,,,`textht=(m4svgf)*dptextratio; ')undefine(`m4svgf')',
- `dptextratio=svgfontratio(`$1'); dnl
- ifelse(`$2',,,textht=(`$2')*dptextratio; )')dnl
+ ifelse(m4svgf,,,`ifelse(`$4',,,`m4trtmp=dptextratio;') dnl
+ dptextratio = m4svgf;')popdef(`m4svgf')dnl
+ ifelse(m4svgf,,,`ifelse(`$4',,,`m4thtmp=textht;') dnl
+ textht=(m4svgf)*dptextratio; ')undefine(`m4svgf')',
+ `ifelse(`$4',,,`m4trtmp=dptextratio;') dptextratio=svgfontratio(`$1'); dnl
+ ifelse(`$2',,,m4thtmp=textht; textht=(`$2')*dptextratio; )')dnl
ifelse(`$3',,,`textoffset=`$3'; ')
command "<g patsubst(ifelse(`$1',,,
index(`$1',font),0,`$1',
@@ -62,7 +64,7 @@ index(`$1',style),0,`$1',
style="font-family:`$1'")
,",\\")>"
`$4'
- ifelse(`$4',,,`command "</g>"')')
+ ifelse(`$4',,,`command "</g>"; textht=m4thtmp; dptextratio=m4trtmp;')')
`e.g. svg_font(Times)
svg_font(Times,12bp__:0.66)
diff --git a/graphics/circuit_macros/xfig.m4 b/graphics/circuit_macros/xfig.m4
index 40fef9bbbe..222058db9a 100644
--- a/graphics/circuit_macros/xfig.m4
+++ b/graphics/circuit_macros/xfig.m4
@@ -1,7 +1,7 @@
divert(-1)
xfig.m4 Initialization for xfig.
-* Circuit_macros Version 9.9, copyright (c) 2022 J. D. Aplevich under *
+* Circuit_macros Version 10.0, copyright (c) 2022 J. D. Aplevich under *
* the LaTeX Project Public Licence in file Licence.txt. The files of *
* this distribution may be redistributed or modified provided that this *
* copyright notice is included and provided that modifications are clearly *
diff --git a/graphics/pstricks/contrib/pst-fractal/Changes b/graphics/pstricks/contrib/pst-fractal/Changes
index 6241641461..3560182016 100644
--- a/graphics/pstricks/contrib/pst-fractal/Changes
+++ b/graphics/pstricks/contrib/pst-fractal/Changes
@@ -1,4 +1,5 @@
pst-fractal.pro --------
+0.07 2022-10-13 don't use dict for Sirpinski curve
0.06 2017-12-04 added Hilbert fractal
0.05 2017-12-02 added fibinacci curves
0.04 2017-11-26 add sierpinski curve
@@ -8,6 +9,7 @@ pst-fractal.pro --------
pst-fractal.tex --------
+0.12 2022-10-13 - added Sierpinski carpet
0.11a 2020-03-16 - small changes to the documentation
0.11 2020-03-10 - fixed trailing space in \pstKochflake
0.10 2018-11-10 - added Cantor set
diff --git a/graphics/pstricks/contrib/pst-fractal/doc/pst-fractal-doc.pdf b/graphics/pstricks/contrib/pst-fractal/doc/pst-fractal-doc.pdf
index b31dda9957..79d3207a5e 100644
--- a/graphics/pstricks/contrib/pst-fractal/doc/pst-fractal-doc.pdf
+++ b/graphics/pstricks/contrib/pst-fractal/doc/pst-fractal-doc.pdf
Binary files differ
diff --git a/graphics/pstricks/contrib/pst-fractal/doc/pst-fractal-doc.tex b/graphics/pstricks/contrib/pst-fractal/doc/pst-fractal-doc.tex
index c5b82616cc..7a5796cff3 100644
--- a/graphics/pstricks/contrib/pst-fractal/doc/pst-fractal-doc.tex
+++ b/graphics/pstricks/contrib/pst-fractal/doc/pst-fractal-doc.tex
@@ -107,7 +107,7 @@ The defaults are 2mm, black, 5, 10cm, and 5mm.
\end{LTXexample}
-\section{Sierpinski triangle and curve}
+\section{Sierpinski triangle, curve and carpet}
The triangle must be given by three mandatory arguments. Depending to the kind of
arguments it is one of the two possible versions:
@@ -199,6 +199,29 @@ There are four special optional arguments for the Siepinski curve:
\end{verbatim}
+\subsection{Carpet}
+
+There are four special optional arguments for the Sierpinski carpet:
+\begin{itemize}
+ \item \texttt{[n=3]} : number of iterations
+ \item \texttt{[linecolor=red]} :
+ \item \texttt{[scale=1]} : scaling of the carpet
+\end{itemize}
+
+\begin{LTXexample}[pos=t]
+\begin{pspicture}(10,10)
+\psSierCarpet% The default with a width of 10cm
+\end{pspicture}
+\end{LTXexample}
+
+
+\begin{LTXexample}[pos=t]
+\begin{pspicture}[showgrid](-4,-4)(4,4)
+\psSierCarpet[n=6,linecolor=blue,scale=0.8](-5,-5) % with scale it is (-4,-4)
+\end{pspicture}
+\end{LTXexample}
+
+
\section{Julia and Mandelbrot sets}
diff --git a/graphics/pstricks/contrib/pst-fractal/dvips/pst-fractal.pro b/graphics/pstricks/contrib/pst-fractal/dvips/pst-fractal.pro
index fcdc69bb99..1c5fb9d9b7 100644
--- a/graphics/pstricks/contrib/pst-fractal/dvips/pst-fractal.pro
+++ b/graphics/pstricks/contrib/pst-fractal/dvips/pst-fractal.pro
@@ -16,7 +16,7 @@
%% `pst-fractal' is a PSTricks package to draw fractal objects
%%
%%
-%% version 0.06 / 2017-12-04 Herbert Voss <hvoss _at_ tug.org>
+%% version 0.07 / 2022-10-13 Herbert Voss <hvoss _at_ tug.org>
%
/tx@fractalDict 100 dict def
tx@fractalDict begin
@@ -68,17 +68,18 @@ tx@fractalDict begin
MinY dy MaxY {
ifJulia { /y exch def }{ /cy exch def /y 0.0 def } ifelse
/iter 0 def
- /zx x def
- /zy y def
+ /z [x y] def
+ /c [cx cy] def
/plot true def
totMaxIter cvi {
- zx dup mul zy dup mul add maxRadius gt {
+ z cxnorm2 maxRadius gt {
/plot false def
exit
}{% Calculate next value
- 2 zx zy mul mul cy add
- /zx zx dup mul zy dup mul sub cx add def
- /zy exch def
+% z 5 cxexp c add
+% z dup cxmul c cxadd
+ z FractalFunc
+ /z ED
/iter iter dIter add def
} ifelse
} repeat
@@ -100,6 +101,7 @@ tx@fractalDict begin
% \pst@temp@C
% { \pst@usecolor\pslinecolor }
% \pst@fractal@plotpoints
+20 dict begin
/plotpoints ED
/setColor ED
/Coor ED
@@ -128,6 +130,7 @@ tx@fractalDict begin
rand nCoor mod
dup add newPosition
} repeat
+end
} def
%
/Rot-90 {
@@ -139,6 +142,7 @@ tx@fractalDict begin
} def
%
/tx@SierpinskiCurve { %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%25 dict begin
/Pi [1.5 cmunit 1 cmunit
1 cmunit 0.5 cmunit
1 cmunit -0.5 cmunit
@@ -224,6 +228,7 @@ tx@fractalDict begin
useFill { gsave fillColor fill grestore } if
%
useLineStyle
+%end
} def
%
/tx@Phyllotaxis { %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -231,6 +236,7 @@ tx@fractalDict begin
% \pst@fractal@c
% \pst@fractal@angle
% \pst@fractal@maxIter CMYK
+10 dict begin
/ifCMYK ED
/maxIter ED
/fractalAngle ED
@@ -251,6 +257,7 @@ tx@fractalDict begin
grestore
stroke
} for
+end
} def
%
/tx@Fern { %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -260,6 +267,7 @@ tx@fractalDict begin
% \pst@fractal@radius
% \pst@number\pslinewidth
% { \pst@usecolor\pslinecolor }
+20 dict begin
/setColor ED
SLW
/radius ED
@@ -284,6 +292,7 @@ tx@fractalDict begin
m transform 2 copy radius 0 360 arc
stroke
} repeat
+end
} def
%
/tx@Kochflake { %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -325,6 +334,7 @@ tx@fractalDict begin
% \pst@fractal@scale
% \pst@number\pslinewidth SLW
%
+30 dict begin
/ifCMYK ED
/ifColor ED
/Radius ED
@@ -421,6 +431,7 @@ tx@fractalDict begin
1 1 4 { pop circle } for
1 1 4 { pop 3 polydup collect 5 1 roll 4 1 roll } for
pop pop pop pop { count 0 eq { exit } if appol } loop
+end
} def
%
/tx@Hugo { %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -430,6 +441,7 @@ tx@fractalDict begin
% \pst@fractal@maxIter, which is the depth
% \pst@number\pslinewidth
% { \pst@usecolor\pslinecolor }
+50 dict begin
/setColor ED
SLW
/depth ED
@@ -542,6 +554,7 @@ realtime srand
% drawfractal showpage
} for
drawfractal
+end
} def % end of /tx@Hugo
%
/FibonacciFractal {
diff --git a/graphics/pstricks/contrib/pst-fractal/tex/pst-fractal.tex b/graphics/pstricks/contrib/pst-fractal/tex/pst-fractal.tex
index b77cb42e06..b477891041 100644
--- a/graphics/pstricks/contrib/pst-fractal/tex/pst-fractal.tex
+++ b/graphics/pstricks/contrib/pst-fractal/tex/pst-fractal.tex
@@ -19,11 +19,12 @@
\csname PSTfractalLoaded\endcsname
\let\PSTfractalLoaded\endinput
\ifx\PSTricksLoaded\endinput\else \input pstricks.tex\fi
+\ifx\PSTfuncLoaded\endinput \else \input pst-func.tex\fi
\ifx\PSTricksAddLoaded\endinput\else\input pstricks-add.tex\fi
\ifx\PSTXKeyLoaded\endinput\else \input pst-xkey \fi
%
-\def\fileversion{0.11a}
-\def\filedate{2020/03/16}
+\def\fileversion{0.12}
+\def\filedate{2022/10/13}
\message{`PST-fractal' v\fileversion, \filedate\space (hv)}
%
\edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax
@@ -41,6 +42,9 @@
\def\pst@fractal@Julia{Julia}\def\pst@fractal@Mandel{Mandel}
\define@key[psset]{pst-fractal}{baseColor}[white]{\pst@getcolor{#1}\pst@fractal@baseColor}
\psset[pst-fractal]{baseColor=white}
+\define@key[psset]{pst-fractal}{function}[z z cxmul c cxadd ]{\def\pst@fractal@function{#1 }}
+\psset{function=z z cxmul c cxadd}
+
%
\define@key[psset]{pst-fractal}{cx}[0]{\def\pst@fractal@cx{#1 }}
\define@key[psset]{pst-fractal}{cy}[0]{\def\pst@fractal@cy{#1 }}
@@ -368,7 +372,10 @@
{ \pst@usecolor\pst@fractal@baseColor }
\ifx\pst@fractal@type\pst@fractal@Julia true \else false \fi
\ifPst@CMYK true \else false \fi ^^J
- tx@fractalDict begin tx@Fractal end ^^J
+ tx@fractalDict begin
+ /FractalFunc { /z ED \pst@fractal@function } def
+ tx@Fractal end
+ ^^J
}% end add@pscode
\endpspicture
\end@SpecialObj
@@ -436,7 +443,8 @@
/dotcolor { \pst@usecolor\psdotcolor } def
/cmunit { \pst@number\psunit mul } def
NbrePts (all) eq {/Npts 4 n@ 1 add exp cvi def}{/Npts NbrePts cvi def Npts 4 n@ 1 add exp gt {/Npts 4 n@ 1 add exp cvi def} if } ifelse
- tx@fractalDict begin tx@SierpinskiCurve
+ tx@fractalDict begin
+ tx@SierpinskiCurve
\ifshowpoints
0 2 Sierpinsky length 2 sub {
/i exch def
@@ -453,6 +461,34 @@
\end@SpecialObj
\ignorespaces}
%
+\def\psSierCarpet{\pst@object{psSierCarpet}}
+\def\psSierCarpet@i{\@ifnextchar({\psSierCarpet@ii}{\psSierCarpet@ii(0,0)}}
+%
+\def\psSierCarpet@ii(#1){{%
+ \pst@getcoor{#1}\pst@temp@A
+ \begin@SpecialObj
+ \addto@pscode{
+ \pst@fractal@scale
+ \pst@temp@A\space translate
+ /r { moveto 0 -1 1 0 0 1 3 { rlineto } repeat closepath fill } def
+ /serp { gsave
+ 3 1 roll translate
+ 1 3 div dup scale
+ 1 1 r
+ dup 1 sub dup 0 eq not {
+ 0 0 0 1 0 2 1 0 1 2 2 0 2 1 2 2 17 -1 roll 8 { serp } repeat
+ } if pop
+ grestore
+ } def
+ 300 300 scale 0 0 r 1 setgray
+ 0 0 \pst@fractal@n serp
+ }%
+ \showpointsfalse
+ \end@SpecialObj
+ \ignorespaces
+}}
+%
+%
\def\psPhyllotaxis{\pst@object{psPhyllotaxis}}
\def\psPhyllotaxis@i{\@ifnextchar({\psPhyllotaxis@ii}{\psPhyllotaxis@ii(0,0)}}
\def\psPhyllotaxis@ii(#1){{%
@@ -538,16 +574,15 @@
\pst@number\pst@fractal@Radius
\ifPst@fractal@Color true \else false \fi
\ifPst@CMYK true \else false \fi ^^J
- tx@fractalDict begin ^^J
- gsave ^^J
- \pst@tempA translate ^^J
- \pst@usecolor\pslinecolor
- \pst@fractal@scale
- \pst@number\pslinewidth SLW ^^J
- tx@Appolonius end ^^J
+ gsave ^^J
+ \pst@tempA translate ^^J
+ \pst@usecolor\pslinecolor
+ \pst@fractal@scale
+ \pst@number\pslinewidth SLW ^^J
+ tx@fractalDict begin tx@Appolonius end ^^J
}% end add@pscode
\psk@fillstyle%
- \addto@pscode{stroke grestore}%
+ \addto@pscode{stroke grestore ^^J }%
\end@SpecialObj%
}}
%