texlive[64714] Master/texmf-dist: pst-fractal (14oct22)

commits+karl at tug.org commits+karl at tug.org
Sat Oct 15 22:24:04 CEST 2022


Revision: 64714
          http://tug.org/svn/texlive?view=revision&revision=64714
Author:   karl
Date:     2022-10-15 22:24:03 +0200 (Sat, 15 Oct 2022)
Log Message:
-----------
pst-fractal (14oct22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/generic/pst-fractal/Changes
    trunk/Master/texmf-dist/doc/generic/pst-fractal/pst-fractal-doc.pdf
    trunk/Master/texmf-dist/doc/generic/pst-fractal/pst-fractal-doc.tex
    trunk/Master/texmf-dist/dvips/pst-fractal/pst-fractal.pro
    trunk/Master/texmf-dist/tex/generic/pst-fractal/pst-fractal.tex

Modified: trunk/Master/texmf-dist/doc/generic/pst-fractal/Changes
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pst-fractal/Changes	2022-10-15 20:23:31 UTC (rev 64713)
+++ trunk/Master/texmf-dist/doc/generic/pst-fractal/Changes	2022-10-15 20:24:03 UTC (rev 64714)
@@ -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.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

Modified: trunk/Master/texmf-dist/doc/generic/pst-fractal/pst-fractal-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/pst-fractal/pst-fractal-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pst-fractal/pst-fractal-doc.tex	2022-10-15 20:23:31 UTC (rev 64713)
+++ trunk/Master/texmf-dist/doc/generic/pst-fractal/pst-fractal-doc.tex	2022-10-15 20:24:03 UTC (rev 64714)
@@ -107,7 +107,7 @@
 \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,7 +199,30 @@
 \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}
 
 The syntax of the \Lcs{psfractal} macro is simple

Modified: trunk/Master/texmf-dist/dvips/pst-fractal/pst-fractal.pro
===================================================================
--- trunk/Master/texmf-dist/dvips/pst-fractal/pst-fractal.pro	2022-10-15 20:23:31 UTC (rev 64713)
+++ trunk/Master/texmf-dist/dvips/pst-fractal/pst-fractal.pro	2022-10-15 20:24:03 UTC (rev 64714)
@@ -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 at fractalDict 100 dict def
 tx at fractalDict begin
@@ -68,17 +68,18 @@
     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 @@
 %    \pst at temp@C  
 %    { \pst at usecolor\pslinecolor }
 %    \pst at fractal@plotpoints
+20 dict begin
   /plotpoints ED
   /setColor ED
   /Coor ED   
@@ -128,6 +130,7 @@
     rand nCoor mod 
     dup add newPosition   
   } repeat
+end
 } def
 %
 /Rot-90 {
@@ -139,6 +142,7 @@
 } def
 %
 /tx at SierpinskiCurve { %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%25 dict begin
   /Pi [1.5 cmunit 1 cmunit
      1 cmunit 0.5 cmunit
      1 cmunit -0.5 cmunit
@@ -224,6 +228,7 @@
     useFill { gsave fillColor fill grestore } if 
 %
     useLineStyle
+%end
 } def 
 %
 /tx at Phyllotaxis { %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
@@ -231,6 +236,7 @@
 %	\pst at fractal@c 
 %	\pst at fractal@angle 
 %	\pst at fractal@maxIter CMYK
+10 dict begin
   /ifCMYK ED
   /maxIter ED
   /fractalAngle ED
@@ -251,6 +257,7 @@
     grestore
     stroke
   } for
+end
 } def
 %
 /tx at Fern { %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -260,6 +267,7 @@
 %    \pst at fractal@radius
 %    \pst at number\pslinewidth
 %    { \pst at usecolor\pslinecolor }
+20 dict begin
   /setColor ED
   SLW
   /radius ED
@@ -284,6 +292,7 @@
    m transform 2 copy radius 0 360 arc
    stroke
   } repeat
+end
 } def
 %
 /tx at Kochflake { %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -325,6 +334,7 @@
 %    \pst at fractal@scale
 %    \pst at number\pslinewidth SLW
 %
+30 dict begin
   /ifCMYK ED
   /ifColor ED
   /Radius ED
@@ -421,6 +431,7 @@
   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 at Hugo { %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -430,6 +441,7 @@
 %    \pst at fractal@maxIter, which is the depth
 %    \pst at number\pslinewidth
 %    { \pst at usecolor\pslinecolor }
+50 dict begin
 /setColor ED
 SLW
 /depth ED  
@@ -542,6 +554,7 @@
 %   drawfractal showpage 
 } for 
 drawfractal  
+end
 } def  % end of /tx at Hugo
 %
 /FibonacciFractal {

Modified: trunk/Master/texmf-dist/tex/generic/pst-fractal/pst-fractal.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pst-fractal/pst-fractal.tex	2022-10-15 20:23:31 UTC (rev 64713)
+++ trunk/Master/texmf-dist/tex/generic/pst-fractal/pst-fractal.tex	2022-10-15 20:24:03 UTC (rev 64714)
@@ -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 at fractal@Julia{Julia}\def\pst at fractal@Mandel{Mandel}
 \define at key[psset]{pst-fractal}{baseColor}[white]{\pst at getcolor{#1}\pst at fractal@baseColor}
 \psset[pst-fractal]{baseColor=white}
+\define at key[psset]{pst-fractal}{function}[z z cxmul c cxadd ]{\def\pst at fractal@function{#1 }}
+\psset{function=z z cxmul c cxadd}
+
 %
 \define at key[psset]{pst-fractal}{cx}[0]{\def\pst at fractal@cx{#1 }}
 \define at key[psset]{pst-fractal}{cy}[0]{\def\pst at fractal@cy{#1 }}
@@ -368,7 +372,10 @@
     { \pst at usecolor\pst at fractal@baseColor } 
     \ifx\pst at fractal@type\pst at fractal@Julia true \else false \fi
     \ifPst at CMYK true \else false \fi ^^J
-    tx at fractalDict begin tx at Fractal end ^^J
+    tx at fractalDict begin 
+    /FractalFunc { /z ED \pst at fractal@function } def 
+    tx at Fractal end 
+    ^^J
   }% end add at pscode
   \endpspicture
   \end at SpecialObj
@@ -436,7 +443,8 @@
     /dotcolor { \pst at usecolor\psdotcolor } def
     /cmunit { \pst at 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 at fractalDict begin tx at SierpinskiCurve
+    tx at fractalDict begin 
+    tx at SierpinskiCurve
     \ifshowpoints
       0 2 Sierpinsky length 2 sub {
         /i exch def
@@ -453,6 +461,34 @@
   \end at SpecialObj
   \ignorespaces}     
 %
+\def\psSierCarpet{\pst at object{psSierCarpet}}
+\def\psSierCarpet at i{\@ifnextchar({\psSierCarpet at ii}{\psSierCarpet at ii(0,0)}}
+%
+\def\psSierCarpet at ii(#1){{%
+  \pst at getcoor{#1}\pst at temp@A
+  \begin at SpecialObj
+  \addto at pscode{
+    \pst at fractal@scale
+  	\pst at 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 at fractal@n serp 
+  }%
+  \showpointsfalse
+  \end at SpecialObj
+  \ignorespaces
+}}
+%
+%
 \def\psPhyllotaxis{\pst at object{psPhyllotaxis}}
 \def\psPhyllotaxis at i{\@ifnextchar({\psPhyllotaxis at ii}{\psPhyllotaxis at ii(0,0)}}
 \def\psPhyllotaxis at ii(#1){{%
@@ -538,16 +574,15 @@
     \pst at number\pst at fractal@Radius
     \ifPst at fractal@Color true \else false \fi
     \ifPst at CMYK true \else false \fi ^^J
-    tx at fractalDict begin ^^J
-    gsave ^^J
-    \pst at tempA translate ^^J
-    \pst at usecolor\pslinecolor
-    \pst at fractal@scale
-    \pst at number\pslinewidth SLW ^^J
-    tx at Appolonius end ^^J
+      gsave ^^J
+      \pst at tempA translate ^^J
+      \pst at usecolor\pslinecolor
+      \pst at fractal@scale
+      \pst at number\pslinewidth SLW ^^J
+      tx at fractalDict begin tx at Appolonius end ^^J 
   }% end add at pscode
   \psk at fillstyle%
-  \addto at pscode{stroke grestore}%
+  \addto at pscode{stroke grestore  ^^J }%
   \end at SpecialObj%
 }}
 %



More information about the tex-live-commits mailing list.