From a5737bc6edabf060276b0476fcbe35e3088a5e24 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 21 Feb 2014 00:22:39 +0000 Subject: pst-intersect (19feb14) git-svn-id: svn://tug.org/texlive/trunk@33014 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/generic/pst-intersect/pst-intersect.tex | 295 +++++++++++++++++++++ .../tex/latex/pst-intersect/pst-intersect.sty | 50 ++++ 2 files changed, 345 insertions(+) create mode 100644 Master/texmf-dist/tex/generic/pst-intersect/pst-intersect.tex create mode 100644 Master/texmf-dist/tex/latex/pst-intersect/pst-intersect.sty (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/generic/pst-intersect/pst-intersect.tex b/Master/texmf-dist/tex/generic/pst-intersect/pst-intersect.tex new file mode 100644 index 00000000000..74c6fafc7f3 --- /dev/null +++ b/Master/texmf-dist/tex/generic/pst-intersect/pst-intersect.tex @@ -0,0 +1,295 @@ +%% +%% This is file `pst-intersect.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% pst-intersect.dtx (with options: `texfile') +%% +%% This is a generated file. +%% +%% Project: pst-intersect +%% Version: 0.1 (2014/02/19) +%% +%% Copyright (C) 2007-2014 by Christoph Bersch +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2008/05/04 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% The current maintainer of this work is Christoph Bersch. +%% +%% This work consists of the files pst-intersect.dtx and pst-intersect.ins +%% and the derived files +%% pst-intersect.sty, pst-intersect.tex, pst-intersect.pro. +%% +\csname PSTintersectLoaded\endcsname +\let\PSTintersectLoaded\endinput + +\ifx\PSTricksLoaded\endinput\else\input pstricks.tex \fi +\ifx\PSTXKeyLoaded\endinput\else \input pst-xkey.tex \fi +\ifx\PSTnodesLoaded\endinput\else\input pst-node.tex \fi +\ifx\PSTfuncLoaded\endinput\else \input pst-func.tex \fi + +\edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax + +\pst@addfams{intersect} +\pstheader{pst-intersect.pro} + +\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{% + % only 10 points allowed, remove the rest + counttomark 20 gt { counttomark 20 sub { pop } repeat } if + % reverse the point order + counttomark -2 4 { 2 roll } for + %\addto@pscode{% + %counttomark 2 add -1 roll pop % remove the path name + counttomark 2 idiv 1 sub dup 9 gt { pop 9 } if + \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}% +\define@key[psset]{intersect}{tstart}{% + \pst@checknum{#1}\PIT@key@tstart +} +\define@key[psset]{intersect}{tstop}{% + \pst@checknum{#1}\PIT@key@tstop +} +\define@key[psset]{intersect}{istart}{% + \pst@checknum{#1}\PIT@key@istart +} +\define@key[psset]{intersect}{istop}{% + \pst@checknum{#1}\PIT@key@istop +} +\define@key[psset]{intersect}{name}{% + \def\PIT@key@name{#1}% +}% +\newif\PIT@saveintersections +\define@boolkey[psset]{intersect}[PIT@]{saveintersections}[true]{} +\psset[intersect]{% + tstart=-1, + tstop=-1, + istart=-1, + istop=-1, + name={}, + saveintersections +}% +\def\PIT@use@pscode{% + \pstverb{% + \pst@dict + \tx@STP + \pst@newpath + \psk@origin + \psk@swapaxes + \pst@code + end + count /ocount exch def + }% + \gdef\pst@code{}% +}% +\let\PIT@pst@stroke@orig\pst@stroke +\def\PIT@save@path{% + \PIT@pst@stroke@orig + \addto@pscode{% + clear mark + { /movetype counttomark 3 roll } + { /linetype counttomark 3 roll } + { /curvetype counttomark 7 roll }{} pathforall + counttomark 1 add -1 roll pop count }% +}% +\def\PIT@name@default{@tmp}% +\def\PIT@name#1{PIT@#1}% +\def\PIT@checkname#1{% + \ifx\@empty#1\@empty + \@pstrickserr{Unexpected empty argument!}\@ehpb + \fi +}% +\def\pssavepath{\pst@object{pssavepath}}% +\long\def\pssavepath@i#1#2{% + \begin@SpecialObj + \PIT@checkname{#1}% + \let\pst@stroke\PIT@save@path + \let\use@pscode\PIT@use@pscode + \pscustom{#2}% + \PIT@Verb{% + /\PIT@name{#1} + [ 3 -1 roll 2 add 2 roll ] def }% + \end@SpecialObj +}% +\def\pstracecurve{\pst@object{pstracecurve}}% +\def\pstracecurve@i#1{% + \addbefore@par{plotpoints=200}% + \begin@OpenObj + \@ifnextchar\bgroup + {\PIT@traceintersection{#1}}% + {\PIT@tracecurve{#1}}% +}% +\def\PIT@tracecurve#1{% + \PIT@checkname{#1}% + \addto@pscode{% + \pst@intersectdict + \PIT@name{#1} dup IsPath { + \PIT@key@tstart\space\PIT@key@tstop\space + ShowPathPortion + }{ + [exch dup + \PIT@key@tstart\space\PIT@key@tstop\space + dup 0 lt { pop 1 } if + ToUnitInterval Portion + { aload pop } forall + counttomark 2 sub 2 idiv + \psk@plotpoints + exch + \txFunc@BezierCurve + \ifshowpoints \txFunc@BezierShowPoints \else pop \fi + } ifelse + end + }% + \end@OpenObj +}% +\def\PIT@traceintersection#1#2{% + \PIT@checkname{#2}% + \addto@pscode{% + \pst@intersectdict + \ifx\\#1\\% + /\PIT@name{\PIT@name@default} + \else + /\PIT@name{#1} + \fi + dup currentdict exch known not { + \ifx\\#1\\% + (You haven't defined an intersection!) == + \else + (You haven't defined the intersection '#1') == + \fi + } if + load + dup dup type /dicttype eq exch /\PIT@name{#2} known and not { + (You haven't defined the intersection '#2') == + } if + dup /\PIT@name{#2} get + exch /\PIT@name{#2}@t get + dup length \PIT@key@istart\space ge 0 \PIT@key@istart\space lt and { + dup \PIT@key@istart\space cvi 1 sub get + } { + \PIT@key@tstart + } ifelse + exch % [curve] t_istart|tstart [ts] + % + dup length \PIT@key@istop\space ge 0 \PIT@key@istop\space lt and { + \PIT@key@istop\space cvi 1 sub get + } { + pop \PIT@key@tstop + } ifelse + 2 copy 2 copy gt 3 1 roll -1 gt exch -1 gt and and { exch } if + 3 -1 roll dup + IsPath { + 3 1 roll + ShowPathPortion + }{ + [ exch dup 5 -2 roll + dup 0 lt { pop 1 } if + ToUnitInterval Portion + { aload pop } forall + counttomark 2 sub 2 idiv + \psk@plotpoints + exch + \txFunc@BezierCurve + \ifshowpoints \txFunc@BezierShowPoints \else pop \fi + } ifelse + end + }% + \end@OpenObj +}% +\def\psintersect{\pst@object{psintersect}} +\def\psintersect@i#1#2{% + \PIT@checkname{#1}% + \PIT@checkname{#2}% + \begin@SpecialObj + \def\PIT@@name{% + \ifx\PIT@key@name\@empty + \PIT@name{\PIT@name@default} + \else + \PIT@name{\PIT@key@name} + \fi}% + \PIT@Verb{% + currentdict /\PIT@name{#1} known not { + (You haven't defined the curve or path '#1') == + } if + currentdict /\PIT@name{#2} known not { + (You haven't defined the curve or path '#2') == + } if + \PIT@name{#1} \PIT@name{#2} + \PIT@name{#1} IsPath { + \PIT@name{#2} IsPath { + IntersectPaths + }{ + IntersectPathCurve + } ifelse + }{ + \PIT@name{#2} IsPath { + IntersectCurvePath + }{ + IntersectBeziers + 4 copy LoadIntersectionPoints 5 1 roll + } ifelse + } ifelse + /\PIT@@name\space /\PIT@name{#1} /\PIT@name{#2} 8 3 roll + SaveIntersection + }% + \ifPIT@saveintersections + \pst@Verb{% + \pst@intersectdict + \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 + 10 {InitPnode} /NodeScale {} def NewNode + } for + end + pop + }% + \fi + \ifshowpoints + \addto@pscode{% + \pst@intersectdict + [ \PIT@@name\space /Points get aload pop + end + }% + \psdots@ii + \else + \end@SpecialObj + \fi +}% +\catcode`\@=\PstAtCode\relax +\endinput +%% +%% End of file `pst-intersect.tex'. diff --git a/Master/texmf-dist/tex/latex/pst-intersect/pst-intersect.sty b/Master/texmf-dist/tex/latex/pst-intersect/pst-intersect.sty new file mode 100644 index 00000000000..b44496fb076 --- /dev/null +++ b/Master/texmf-dist/tex/latex/pst-intersect/pst-intersect.sty @@ -0,0 +1,50 @@ +%% +%% This is file `pst-intersect.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% pst-intersect.dtx (with options: `stylefile') +%% +%% This is a generated file. +%% +%% Project: pst-intersect +%% Version: 0.1 (2014/02/19) +%% +%% Copyright (C) 2007-2014 by Christoph Bersch +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2008/05/04 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% The current maintainer of this work is Christoph Bersch. +%% +%% This work consists of the files pst-intersect.dtx and pst-intersect.ins +%% and the derived files +%% pst-intersect.sty, pst-intersect.tex, pst-intersect.pro. +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{pst-intersect} + [2014/02/19 v0.1 package wrapper for pst-intersect.tex] +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{pst-intersect}% + [2014/02/06 v0.1alpha package wrapper for pst-intersect.tex] +\RequirePackage{pstricks} +\RequirePackage{pst-xkey} +\RequirePackage{pst-node} +\RequirePackage{multido} +\RequirePackage{pst-func} +\input{pst-intersect.tex} +\IfFileExists{pst-intersect.pro}{% + \ProvidesFile{pst-intersect.pro} + [2014/02/06 PostScript prologue file] + \@addtofilelist{pst-intersect.pro}}{}% +\endinput +%% +%% End of file `pst-intersect.sty'. -- cgit v1.2.3