From e92a34caec5eab0a4c9409d6f0b8372d43dd0684 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 5 Mar 2014 23:17:53 +0000 Subject: pst-intersect (4mar14) git-svn-id: svn://tug.org/texlive/trunk@33099 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/pst-intersect/Changes | 7 + .../doc/latex/pst-intersect/pst-intersect-DE.pdf | Bin 111294 -> 114227 bytes .../doc/latex/pst-intersect/pst-intersect.pdf | Bin 108644 -> 111359 bytes .../dvips/pst-intersect/pst-intersect.pro | 2 +- .../texmf-dist/source/latex/pst-intersect/Makefile | 33 ++- .../source/latex/pst-intersect/pst-intersect.dtx | 280 +++++++++++++++------ .../source/latex/pst-intersect/pst-intersect.ins | 2 +- .../tex/generic/pst-intersect/pst-intersect.tex | 107 ++++---- .../tex/latex/pst-intersect/pst-intersect.sty | 6 +- 9 files changed, 309 insertions(+), 128 deletions(-) diff --git a/Master/texmf-dist/doc/latex/pst-intersect/Changes b/Master/texmf-dist/doc/latex/pst-intersect/Changes index 91ba24d91c2..6433af63488 100644 --- a/Master/texmf-dist/doc/latex/pst-intersect/Changes +++ b/Master/texmf-dist/doc/latex/pst-intersect/Changes @@ -1,3 +1,10 @@ +0.3 2014-03-04 + * Fixed \psGetIsectNode to work with more than one segment. + * Modified \psGetIsectNode and the naming conventions of the + variables. + * Fixed missing support for pst-node's saveNodeCoors parameter to + saveintersections. + 0.2 2014-02-26 * Added support for arrows parameter to \pstracecurve. * Modified parameters tstart, tstop, istart and istop to respect diff --git a/Master/texmf-dist/doc/latex/pst-intersect/pst-intersect-DE.pdf b/Master/texmf-dist/doc/latex/pst-intersect/pst-intersect-DE.pdf index 2a85a8cd00b..bb9f0969637 100644 Binary files a/Master/texmf-dist/doc/latex/pst-intersect/pst-intersect-DE.pdf and b/Master/texmf-dist/doc/latex/pst-intersect/pst-intersect-DE.pdf differ diff --git a/Master/texmf-dist/doc/latex/pst-intersect/pst-intersect.pdf b/Master/texmf-dist/doc/latex/pst-intersect/pst-intersect.pdf index b19c09b017d..2a613d0c4dc 100644 Binary files a/Master/texmf-dist/doc/latex/pst-intersect/pst-intersect.pdf and b/Master/texmf-dist/doc/latex/pst-intersect/pst-intersect.pdf differ diff --git a/Master/texmf-dist/dvips/pst-intersect/pst-intersect.pro b/Master/texmf-dist/dvips/pst-intersect/pst-intersect.pro index 920774cc758..d6a7521a745 100644 --- a/Master/texmf-dist/dvips/pst-intersect/pst-intersect.pro +++ b/Master/texmf-dist/dvips/pst-intersect/pst-intersect.pro @@ -9,7 +9,7 @@ %% This is a generated file. %% %% Project: pst-intersect -%% Version: 0.1 (2014/02/19) +%% Version: 0.3 (2014/03/04) %% %% Copyright (C) 2007-2014 by Christoph Bersch %% diff --git a/Master/texmf-dist/source/latex/pst-intersect/Makefile b/Master/texmf-dist/source/latex/pst-intersect/Makefile index 049aad3dd98..cf2dd6f0e79 100644 --- a/Master/texmf-dist/source/latex/pst-intersect/Makefile +++ b/Master/texmf-dist/source/latex/pst-intersect/Makefile @@ -12,15 +12,35 @@ ARCHFILES = $(PACKAGE).dtx $(PACKAGE).ins Makefile \ PS2PDF = GS_OPTIONS=-dPDFSETTINGS=/prepress ps2pdf -all : doc doc-DE +all : doc-all doc : $(PACKAGE).pdf doc-DE : $(PACKAGE)-DE.pdf +doc-code: $(PACKAGE)-code.pdf +doc-all: doc doc-DE -dist : doc doc-DE Changes +dist : doc-all Changes mkdir -p $(PACKAGE) cp $(ARCHFILES) $(PACKAGE) +$(PACKAGE)-code.dvi: $(PACKAGE).dtx $(PACKAGE).sty $(PACKAGE).tex $(PACKAGE).pro + sed 's/^\\OnlyDescription//' < $(PACKAGE).dtx > tmp.dtx + $(LATEX) -jobname=$(basename $@) '\newcommand*{\mainlang}{english}\input{tmp.dtx}' + $(LATEX) -jobname=$(basename $@) '\newcommand*{\mainlang}{english}\input{tmp.dtx}' + splitindex -m "" $(basename $@).idx + if test -e $(basename $@)-idx.idx; then \ + makeindex -s gind.ist -t $(basename $@)-idx.ilg \ + -o $(basename $@)-idx.ind $(basename $@)-idx.idx; \ + fi + $(LATEX) -jobname=$(basename $@) '\newcommand*{\mainlang}{english}\input{tmp.dtx}' + splitindex -m "" $(basename $@).idx + if test -e $(basename $@)-idx.idx; then \ + makeindex -s gind.ist -t $(basename $@)-idx.ilg \ + -o $(basename $@)-idx.ind $(basename $@)-idx.idx; \ + fi + $(LATEX) -jobname=$(basename $@) '\newcommand*{\mainlang}{english}\input{tmp.dtx}' + $(RM) tmp.dtx + $(PACKAGE).dvi: L = english $(PACKAGE)-DE.dvi: L = ngerman %.dvi: $(PACKAGE).dtx $(PACKAGE).sty $(PACKAGE).tex $(PACKAGE).pro @@ -38,7 +58,7 @@ $(PACKAGE).sty $(PACKAGE).pro $(PACKAGE).tex: $(PACKAGE).ins $(PACKAGE).dtx Changes: Changes.py $(PACKAGE).dtx python $< -arch-tds : Changes doc doc-DE +arch-tds : Changes doc-all $(RM) $(ARCHNAME_TDS).zip mkdir -p tds/tex/latex/$(PACKAGE) mkdir -p tds/tex/generic/$(PACKAGE) @@ -60,9 +80,10 @@ ctan : dist arch-tds $(RM) -rf $(PACKAGE)/ clean : - $(RM) $(foreach prefix, $(PACKAGE) $(PACKAGE)-DE, \ + $(RM) $(foreach prefix, $(PACKAGE) $(PACKAGE)-code $(PACKAGE)-DE, \ $(addprefix $(prefix), .dvi .ps .log .aux .bbl .blg .out .tmp \ - .toc .hd)) + .toc .idx .ind .ilg .hd \ + -idx.idx -idx.ilg -idx.ind -doc.idx -doc.ilg -doc.ind .hd)) veryclean : clean - $(RM) $(addprefix $(PACKAGE), .pdf .tex .sty .pro) $(PACKAGE)-DE.pdf Changes + $(RM) $(addprefix $(PACKAGE), .pdf .tex .sty .pro .zip .tds.zip) $(PACKAGE)-DE.pdf $(PACKAGE)-code.pdf Changes diff --git a/Master/texmf-dist/source/latex/pst-intersect/pst-intersect.dtx b/Master/texmf-dist/source/latex/pst-intersect/pst-intersect.dtx index a02dfd06933..e1082f148c3 100644 --- a/Master/texmf-dist/source/latex/pst-intersect/pst-intersect.dtx +++ b/Master/texmf-dist/source/latex/pst-intersect/pst-intersect.dtx @@ -18,11 +18,12 @@ %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesPackage{pst-intersect} %<*stylefile> - [2014/02/26 v0.2 package wrapper for pst-intersect.tex] + [2014/03/04 v0.3 package wrapper for pst-intersect.tex] % % %<*driver> \documentclass[a4paper, DIV=9, oneside, toc=index, parskip=half-]{scrreprt} +\usepackage{scrhack} \usepackage{doc} \setcounter{IndexColumns}{2} \usepackage[utf8]{inputenc} @@ -52,6 +53,7 @@ \captionsetup[lstlisting]{format=pitnocaption} \usepackage{multido} \usepackage{pst-intersect} +\usepackage[makeindex]{splitidx} \usepackage{hypdoc} \hypersetup{% colorlinks=true, @@ -502,6 +504,7 @@ % \newrefformat{ex}{Bsp.~\ref{#1}} % \newrefformat{tab}{Tab.~\ref{#1}} % \newrefformat{fig}{Abb.~\ref{#1}} +% \newindex[Quelltextindex]{idx} % \newcommand{\PITindexMacro}{Makros} % \newcommand{\PITindexKeyword}{Parameter} % \newcommand{\PITindexEnv}{Umgebungen} @@ -515,6 +518,7 @@ % \newrefformat{ex}{Ex.~\ref{#1}} % \newrefformat{tab}{Tab.~\ref{#1}} % \newrefformat{fig}{Fig.~\ref{#1}} +% \newindex[Code index]{idx} % \newcommand{\PITindexMacro}{macros} % \newcommand{\PITindexKeyword}{parameters} % \newcommand{\PITindexEnv}{environments} @@ -905,7 +909,7 @@ %\iffalse %<*ignore> %\fi -\begin{LTXexample}[caption={caption}, label={ex:saveintersections}] +\begin{LTXexample} \begin{pspicture}(5,5) \pssavebezier[linecolor=DOrange]{A}% (0,0)(0,5)(5,5)(5,1)(1,1.5) @@ -1134,22 +1138,12 @@ % \prm{curvename} in der Schnittmenge \prm{intersection}. Dabei % startet die Nummer der Schnittpunkte bei \prm{n}$=1$ und wird in % Pfadrichtung durchnummeriert. -% -% Die Schnittpunkte können mit \Lkeyword{saveintersections}\opt{=true} -% natürlich auch über \cs{psGetNodeCenter} geladen werden. Diese -% werden dann nach aufsteigender $x$-Koordinate nummeriert, siehe -% \prettyref{ex:saveintersections}. % \fi % \ifENGLISH % Loads the coordinates of the $n$-th intersection point of the path % \prm{curvename} in the intersection set \prm{intersection}. The % numbering of the intersections starts at \prm{n}$=1$ and the number % increases along the path in its original direction. -% -% The intersection points can also be loaded with \cs{psGetNodeCenter} -% if \Lkeyword{saveintersections}\opt{=true} is set. In that case, the -% numbering of the intersection increases according to their $x$ -% coordinate, see \prettyref{ex:saveintersections}. % \fi % \end{ltxsyntax} % @@ -1157,21 +1151,62 @@ %<*ignore> %\fi \begin{LTXexample} -\begin{pspicture}(5,5) +\begin{pspicture}(4,5) \pssavebezier[linecolor=DOrange, arrows=->]{A}% (0,0)(0,5)(5,5)(5,1)(1,1.5) \pssavebezier[arrows=->]{B}(0,5)(0,0)(5,0)(5,5)(0,2) \psintersect[name=C, showpoints]{A}{B} \color{DOrange} - \uput[150](!\psGetIsectCenter{C}{A}{1} A1.x A1.y){1} - \uput[85](!\psGetIsectCenter{C}{A}{2} A2.x A2.y){2} - \uput[-20](!\psGetIsectCenter{C}{A}{3} A3.x A3.y){3} - \uput[90](!\psGetIsectCenter{C}{A}{4} A4.x A4.y){4} + \uput[150](!\psGetIsectCenter{C}{A}{1} I-C1.x I-C1.y){1} + \uput[85](!\psGetIsectCenter{C}{A}{2} I-C2.x I-C2.y){2} + \uput[-20](!\psGetIsectCenter{C}{A}{3} I-C3.x I-C3.y){3} + \uput[90](!\psGetIsectCenter{C}{A}{4} I-C4.x I-C4.y){4} \end{pspicture} \end{LTXexample} %\iffalse % %\fi +% +% \ifGERMAN +% Wenn kein Kurvenname \prm{curvename} angegeben wird, dann werden die +% Punkte nach aufsteigender $x$-Koordinate sortiert: +% \fi +% \ifENGLISH +% Without \prm{curvename} the points are sorted according to their +% $x$-coordinate: +% \fi +% +% \iffalse +%<*ignore> +%\fi +\begin{LTXexample} +\begin{pspicture}(4,5) + \pssavebezier[linecolor=DOrange, arrows=->]{A}% + (0,0)(0,5)(5,5)(5,1)(1,1.5) + \pssavebezier[arrows=->]{B}(0,5)(0,0)(5,0)(5,5)(0,2) + \psintersect[name=C, showpoints]{A}{B} + \uput[150](!\psGetIsectCenter{C}{}{1} I-C1.x I-C1.y){1} + \uput[85](!\psGetIsectCenter{C}{}{2} I-C2.x I-C2.y){2} + \uput[90](!\psGetIsectCenter{C}{}{3} I-C3.x I-C3.y){3} + \uput[-20](!\psGetIsectCenter{C}{}{4} I-C4.x I-C4.y){4} +\end{pspicture} +\end{LTXexample} +%\iffalse +% +%\fi +% +% \ifGERMAN +% Die Schnittpunkte können auch mit \Lkeyword{saveintersections} und +% \opt{saveNodeCoors} geladen werden. Diese werden dann ebenfalls nach +% aufsteigender $x$-Koordinate nummeriert. +% \fi +% \ifENGLISH +% The intersection points can also be loaded with +% \Lkeyword{saveintersections} and \opt{saveNodeCoors}. In that case, +% the numbering of the intersection increases according to their $x$ +% coordinate. +% \fi +% % \ifGERMAN % \chapter{Beispiele} % \fi @@ -1255,9 +1290,16 @@ % \emph{renamed}, or \emph{removed} demand attention. They indicate a % modification which may require changes to existing documents. % \fi -% +% % \begin{changelog} -%\patchcmd{\release}{\setlength{\itemsep}{0pt}}{\setlength{\itemsep}{0pt}\setlength{\parsep}{0pt}}{}{} +% \patchcmd{\release}{\setlength{\itemsep}{0pt}}{\setlength{\itemsep}{0pt}\setlength{\parsep}{0pt}}{}{} +% \begin{release}{0.3}{2014-03-04} +% \item Fixed \cs{psGetIsectNode} to work with more than one segment. +% \item Modified \cs{psGetIsectNode} and the naming conventions of the +% variables. +% \item Fixed missing support for \opt{pst-node}'s \opt{saveNodeCoors} +% parameter to \opt{saveintersections}. +% \end{release} % \begin{release}{0.2}{2014-02-26} % \item Added support for \opt{arrows} parameter to \cs{pstracecurve}. % \item Modified parameters \opt{tstart}, \opt{tstop}, \opt{istart} @@ -1272,7 +1314,7 @@ % \item First CTAN version % \end{release} % \end{changelog} -% +% % \StopEventually{} % % \begin{otherlanguage}{english} @@ -1289,7 +1331,7 @@ \input{pst-intersect.tex} \IfFileExists{pst-intersect.pro}{% \ProvidesFile{pst-intersect.pro} - [2014/02/26 PostScript prologue file] + [2014/03/04 PostScript prologue file] \@addtofilelist{pst-intersect.pro}}{}% % \end{macrocode} % @@ -1314,46 +1356,9 @@ \def\pst@intersectdict{tx@IntersectDict begin } \def\PIT@dict#1{\pst@intersectdict #1 end} \def\PIT@Verb#1{\pst@Verb{\PIT@dict{#1} }}% - -\def\pssavebezier{\pst@object{pssavebezier}} -\def\pssavebezier@i#1{% - \begin@OpenObj - \PIT@checkname{#1}% - \addto@pscode{ /\PIT@name{#1} }% - \pst@getcoors[\pssavebezier@ii%] -}% -\def\pssavebezier@ii{% - \addto@pscode{% % \end{macrocode} -% only 10 points allowed, remove the rest +% \section{The parameter definitions} % \begin{macrocode} - counttomark 20 gt { counttomark 20 sub { pop } repeat } if - counttomark 2 idiv 1 sub - \psk@plotpoints\space exch - \txFunc@BezierCurve - \ifshowpoints \txFunc@BezierShowPoints \else pop \fi - tx@FuncDict begin Points aload pop end - }% - \let\use@pscode\PIT@use@pscode - \end@OpenObj - \PIT@Verb{% - [ count 1 sub 1 roll ] ArrayToPointArray def - }% -\ignorespaces}% -\def\psGetIsectCenter#1#2#3{% - \pst@intersectdict - \PIT@name{#1} /\PIT@name{#2@t} get #3 1 sub get - \PIT@name{#1} /\PIT@name{#2} get - dup IsPath { - PreparePath exch dup 3 1 roll cvi get - } if - PointArrayToArray - tx@FuncDict begin 2 dict begin - dup length 2 idiv 1 sub /BezierType exch def /Points exch def GetBezierCoor - end end - end - \tx@UserCoor /#2#3.y exch def /#2#3.x exch def -}% \define@key[psset]{intersect}{tstart}{% \pst@checknum{#1}\PIT@key@tstart } @@ -1371,6 +1376,7 @@ }% \newif\PIT@saveintersections \define@boolkey[psset]{intersect}[PIT@]{saveintersections}[true]{} + \psset[intersect]{% tstart=-1, tstop=-1, @@ -1379,6 +1385,15 @@ name={}, saveintersections }% +% \end{macrocode} +% +% \begin{macro}{\PIT@use@pscode} +% This is a modified version of the \cs{use@pscode} core macro. It +% explicitely allows the content of the stack to be moved outside the +% local Postscript-scope created by the \cs{pstverb} macro. This +% allows to save these values on the global level for later +% use. Beware, that you cannot leave arrays or marks on the stack. +% \begin{macrocode} \def\PIT@use@pscode{% \pstverb{% \pst@dict @@ -1392,6 +1407,13 @@ }% \gdef\pst@code{}% }% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PIT@save@path} +% Modified version of the \cs{pst@stroke} core macro, which puts the +% whole current path on the stack. +% \begin{macrocode} \let\PIT@pst@stroke@orig\pst@stroke \def\PIT@save@path{% \PIT@pst@stroke@orig @@ -1400,6 +1422,10 @@ \pst@intersectdict GetFullPath end counttomark 1 add -1 roll pop count }% }% +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} \def\PIT@name@default{@tmp}% \def\PIT@name#1{PIT@#1}% \def\PIT@checkname#1{% @@ -1407,7 +1433,58 @@ \@pstrickserr{Unexpected empty argument!}\@ehpb \fi }% +% \end{macrocode} +% +% \begin{macro}{\pssavebezier} +% \begin{macrocode} +\def\pssavebezier{\pst@object{pssavebezier}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pssavebezier@i} +% Process all nodes following the \cs{pssavebezier} macro call. +% \begin{macrocode} +\def\pssavebezier@i#1{% + \begin@OpenObj + \PIT@checkname{#1}% + \addto@pscode{ /\PIT@name{#1} }% + \pst@getcoors[\pssavebezier@ii%] +}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pssavebezier@ii} +% This does the whole actual work. +% \begin{macrocode} +\def\pssavebezier@ii{% + \addto@pscode{% +% \end{macrocode} +% only 10 points allowed, remove the rest +% \begin{macrocode} + counttomark 20 gt { counttomark 20 sub { pop } repeat } if + counttomark 2 idiv 1 sub + \psk@plotpoints\space exch + \txFunc@BezierCurve + \ifshowpoints \txFunc@BezierShowPoints \else pop \fi + tx@FuncDict begin Points aload pop end + }% + \let\use@pscode\PIT@use@pscode + \end@OpenObj + \PIT@Verb{% + [ count 1 sub 1 roll ] ArrayToPointArray def + }% +\ignorespaces}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pssavepath} +% \begin{macrocode} \def\pssavepath{\pst@object{pssavepath}}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pssavepath@i} +% \begin{macrocode} \long\def\pssavepath@i#1#2{% \begin@SpecialObj \PIT@checkname{#1}% @@ -1419,7 +1496,17 @@ [ 3 -1 roll 2 add 2 roll ] def }% \end@SpecialObj }% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pstracecurve} +% \begin{macrocode} \def\pstracecurve{\pst@object{pstracecurve}}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pstracecurve@i} +% \begin{macrocode} \def\pstracecurve@i#1{% \addbefore@par{plotpoints=200}% \begin@OpenObj @@ -1427,6 +1514,11 @@ {\PIT@traceintersection{#1}}% {\PIT@tracecurve{#1}}% }% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PIT@tracecurve} +% \begin{macrocode} \def\PIT@tracecurve#1{% \PIT@checkname{#1}% \addto@pscode{% @@ -1464,7 +1556,9 @@ } if ToUnitInterval Portion { aload pop } forall - % reverse the point order +% \end{macrocode} +% reverse the point order +% \begin{macrocode} counttomark -2 4 { 2 roll } for counttomark 2 sub 2 idiv \psk@plotpoints @@ -1476,6 +1570,11 @@ }% \end@OpenObj }% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{PIT@traceintersection} +% \begin{macrocode} \def\PIT@traceintersection#1#2{% \PIT@checkname{#2}% \addto@pscode{% @@ -1555,6 +1654,8 @@ }% \end@OpenObj }% +% \end{macrocode} +% \end{macro} % % \begin{macro}{\psintersect} % \begin{macrocode} @@ -1600,14 +1701,23 @@ \PIT@@name\space /Points get ArrayToPointArray end - tx@NodeDict begin - dup length 1 1 3 -1 roll { - 2 copy 1 sub get cvx - false 3 -1 roll (N@\PIT@key@name) exch 20 string cvs - \pst@intersectdict strcat end cvn + dup length 1 1 3 -1 roll { + 2 copy 1 sub get + \ifPst@saveNodeCoors + \pst@intersectdict + 2 copy aload pop \tx@UserCoor 3 -1 roll + 20 string cvs (N-\PIT@key@name) exch strcat dup + (.y) strcat cvn exch (.x) strcat cvn + end + 4 -1 roll def exch def + \fi + cvx + false 3 -1 roll (N@\PIT@key@name) exch 20 string cvs + \pst@intersectdict strcat end cvn + tx@NodeDict begin 10 {InitPnode} /NodeScale {} def NewNode - } for - end + end + } for pop }% \fi @@ -1625,6 +1735,32 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\psGetIsectCenter} +% \begin{macrocode} +\def\psGetIsectCenter#1#2#3{% + \pst@intersectdict + \ifx\\#2\\% + \PIT@name{#1} /Points get dup #3 1 sub 2 mul get exch #3 2 mul 1 sub get + \else + \PIT@name{#1} /\PIT@name{#2@t} get #3 1 sub get + \PIT@name{#1} /\PIT@name{#2} get + dup IsPath { + PreparePath dup length 1 sub + 3 -1 roll dup dup + cvi sub 4 1 roll + cvi sub get + } if + PointArrayToArray + tx@FuncDict begin 2 dict begin + dup length 2 idiv 1 sub /BezierType exch def /Points exch def GetBezierCoor + end end + \fi + end + \tx@UserCoor /I-#1#3.y exch def /I-#1#3.x exch def +}% +% \end{macrocode} +% \end{macro} +% % \begin{macrocode} \catcode`\@=\PstAtCode\relax % \end{macrocode} @@ -2005,7 +2141,7 @@ InitTracing % Load the intersection points. This loads the same intersection point % from both curves, and chooses the one with the lowest error. % \begin{pssyntax} -% \PSarray{curveA} \PSarray{tA} \PSArray{curveB} \PSarray{tB} +% \PSarray{curveA} \PSarray{tA} \PSarray{curveB} \PSarray{tB} % \PSop{LoadCurveIntersectionPoints} % \PSarray{I0.x I0.y \ldots IN.x YN.x} % \end{pssyntax} @@ -2137,7 +2273,7 @@ InitTracing % % \begin{pssyntax} % \PSname{domsA} \PSname{domsB} \PSarray{CurveA} \PSarray{CurveB} -% \PSarray{domA} \PSarray{domB} \PSop{_IterateIntersection} +% \PSarray{domA} \PSarray{domB} \PSop{\_IterateIntersection} % \end{pssyntax} % \begin{macrocode} /_IterateIntersection { @@ -2185,7 +2321,7 @@ InitTracing exit } if % \end{macrocode} -% iter < 100 && (dompA.extent() >= precision || dompB.extent() >= precision) +% iter < 100 \&\& (dompA.extent() >= precision || dompB.extent() >= precision) % \begin{macrocode} CheckIT { (counter: ) counter 20 string cvs strcat @@ -2336,8 +2472,9 @@ InitTracing % % \begin{macro}{IsEmptyInterval} % Check if an interval is empty, which is represented by a [1 0] interval. -% \begin{pssyntx} +% \begin{pssyntax} % \PSarray{interval} \PSop{IsEmptyInterval} \PSvar{boolean} +% \end{pssyntax} % \begin{macrocode} /IsEmptyInterval { aload pop 0 eq exch 1 eq and @@ -2378,6 +2515,7 @@ InitTracing % Does a deep copy of the array \PSarray{Curve}. This also involved deep copies of the contained point arrays. % \begin{pssyntax} % \PSarray{Curve} \PSop{CloneCurve} \PSarray{newCurve} +% \end{pssyntax} % \begin{macrocode} /CloneCurve { [ exch { diff --git a/Master/texmf-dist/source/latex/pst-intersect/pst-intersect.ins b/Master/texmf-dist/source/latex/pst-intersect/pst-intersect.ins index 936fc96b5e4..23ad7bb389f 100644 --- a/Master/texmf-dist/source/latex/pst-intersect/pst-intersect.ins +++ b/Master/texmf-dist/source/latex/pst-intersect/pst-intersect.ins @@ -48,7 +48,7 @@ This is a generated file. Project: pst-intersect -Version: 0.1 (2014/02/19) +Version: 0.3 (2014/03/04) Copyright (C) 2007-2014 by Christoph Bersch diff --git a/Master/texmf-dist/tex/generic/pst-intersect/pst-intersect.tex b/Master/texmf-dist/tex/generic/pst-intersect/pst-intersect.tex index 25ef91c07fd..099d487e748 100644 --- a/Master/texmf-dist/tex/generic/pst-intersect/pst-intersect.tex +++ b/Master/texmf-dist/tex/generic/pst-intersect/pst-intersect.tex @@ -9,7 +9,7 @@ %% This is a generated file. %% %% Project: pst-intersect -%% Version: 0.1 (2014/02/19) +%% Version: 0.3 (2014/03/04) %% %% Copyright (C) 2007-2014 by Christoph Bersch %% @@ -45,43 +45,6 @@ \def\pst@intersectdict{tx@IntersectDict begin } \def\PIT@dict#1{\pst@intersectdict #1 end} \def\PIT@Verb#1{\pst@Verb{\PIT@dict{#1} }}% - -\def\pssavebezier{\pst@object{pssavebezier}} -\def\pssavebezier@i#1{% - \begin@OpenObj - \PIT@checkname{#1}% - \addto@pscode{ /\PIT@name{#1} }% - \pst@getcoors[\pssavebezier@ii%] -}% -\def\pssavebezier@ii{% - \addto@pscode{% - counttomark 20 gt { counttomark 20 sub { pop } repeat } if - counttomark 2 idiv 1 sub - \psk@plotpoints\space exch - \txFunc@BezierCurve - \ifshowpoints \txFunc@BezierShowPoints \else pop \fi - tx@FuncDict begin Points aload pop end - }% - \let\use@pscode\PIT@use@pscode - \end@OpenObj - \PIT@Verb{% - [ count 1 sub 1 roll ] ArrayToPointArray def - }% -\ignorespaces}% -\def\psGetIsectCenter#1#2#3{% - \pst@intersectdict - \PIT@name{#1} /\PIT@name{#2@t} get #3 1 sub get - \PIT@name{#1} /\PIT@name{#2} get - dup IsPath { - PreparePath exch dup 3 1 roll cvi get - } if - PointArrayToArray - tx@FuncDict begin 2 dict begin - dup length 2 idiv 1 sub /BezierType exch def /Points exch def GetBezierCoor - end end - end - \tx@UserCoor /#2#3.y exch def /#2#3.x exch def -}% \define@key[psset]{intersect}{tstart}{% \pst@checknum{#1}\PIT@key@tstart } @@ -99,6 +62,7 @@ }% \newif\PIT@saveintersections \define@boolkey[psset]{intersect}[PIT@]{saveintersections}[true]{} + \psset[intersect]{% tstart=-1, tstop=-1, @@ -135,6 +99,28 @@ \@pstrickserr{Unexpected empty argument!}\@ehpb \fi }% +\def\pssavebezier{\pst@object{pssavebezier}} +\def\pssavebezier@i#1{% + \begin@OpenObj + \PIT@checkname{#1}% + \addto@pscode{ /\PIT@name{#1} }% + \pst@getcoors[\pssavebezier@ii%] +}% +\def\pssavebezier@ii{% + \addto@pscode{% + counttomark 20 gt { counttomark 20 sub { pop } repeat } if + counttomark 2 idiv 1 sub + \psk@plotpoints\space exch + \txFunc@BezierCurve + \ifshowpoints \txFunc@BezierShowPoints \else pop \fi + tx@FuncDict begin Points aload pop end + }% + \let\use@pscode\PIT@use@pscode + \end@OpenObj + \PIT@Verb{% + [ count 1 sub 1 roll ] ArrayToPointArray def + }% +\ignorespaces}% \def\pssavepath{\pst@object{pssavepath}}% \long\def\pssavepath@i#1#2{% \begin@SpecialObj @@ -189,7 +175,6 @@ } if ToUnitInterval Portion { aload pop } forall - % reverse the point order counttomark -2 4 { 2 roll } for counttomark 2 sub 2 idiv \psk@plotpoints @@ -319,14 +304,23 @@ \PIT@@name\space /Points get ArrayToPointArray end - tx@NodeDict begin - dup length 1 1 3 -1 roll { - 2 copy 1 sub get cvx - false 3 -1 roll (N@\PIT@key@name) exch 20 string cvs - \pst@intersectdict strcat end cvn + dup length 1 1 3 -1 roll { + 2 copy 1 sub get + \ifPst@saveNodeCoors + \pst@intersectdict + 2 copy aload pop \tx@UserCoor 3 -1 roll + 20 string cvs (N-\PIT@key@name) exch strcat dup + (.y) strcat cvn exch (.x) strcat cvn + end + 4 -1 roll def exch def + \fi + cvx + false 3 -1 roll (N@\PIT@key@name) exch 20 string cvs + \pst@intersectdict strcat end cvn + tx@NodeDict begin 10 {InitPnode} /NodeScale {} def NewNode - } for - end + end + } for pop }% \fi @@ -341,6 +335,27 @@ \end@SpecialObj \fi }% +\def\psGetIsectCenter#1#2#3{% + \pst@intersectdict + \ifx\\#2\\% + \PIT@name{#1} /Points get dup #3 1 sub 2 mul get exch #3 2 mul 1 sub get + \else + \PIT@name{#1} /\PIT@name{#2@t} get #3 1 sub get + \PIT@name{#1} /\PIT@name{#2} get + dup IsPath { + PreparePath dup length 1 sub + 3 -1 roll dup dup + cvi sub 4 1 roll + cvi sub get + } if + PointArrayToArray + tx@FuncDict begin 2 dict begin + dup length 2 idiv 1 sub /BezierType exch def /Points exch def GetBezierCoor + end end + \fi + end + \tx@UserCoor /I-#1#3.y exch def /I-#1#3.x exch def +}% \catcode`\@=\PstAtCode\relax \endinput %% diff --git a/Master/texmf-dist/tex/latex/pst-intersect/pst-intersect.sty b/Master/texmf-dist/tex/latex/pst-intersect/pst-intersect.sty index bb37a46755c..05d22fe10b8 100644 --- a/Master/texmf-dist/tex/latex/pst-intersect/pst-intersect.sty +++ b/Master/texmf-dist/tex/latex/pst-intersect/pst-intersect.sty @@ -9,7 +9,7 @@ %% This is a generated file. %% %% Project: pst-intersect -%% Version: 0.1 (2014/02/19) +%% Version: 0.3 (2014/03/04) %% %% Copyright (C) 2007-2014 by Christoph Bersch %% @@ -31,7 +31,7 @@ %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{pst-intersect} - [2014/02/26 v0.2 package wrapper for pst-intersect.tex] + [2014/03/04 v0.3 package wrapper for pst-intersect.tex] \RequirePackage{pstricks} \RequirePackage{pst-xkey} \RequirePackage{pst-node} @@ -39,7 +39,7 @@ \input{pst-intersect.tex} \IfFileExists{pst-intersect.pro}{% \ProvidesFile{pst-intersect.pro} - [2014/02/26 PostScript prologue file] + [2014/03/04 PostScript prologue file] \@addtofilelist{pst-intersect.pro}}{}% \endinput %% -- cgit v1.2.3