diff options
author | Karl Berry <karl@freefriends.org> | 2014-03-17 22:55:23 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-03-17 22:55:23 +0000 |
commit | fbbfbf6dd1459939387d20e98c9b5ab8c8b8fc4c (patch) | |
tree | 0fd8dc74eb25e586f7d5c57d92e0d3ed87eeb4b2 /Master/texmf-dist/tex/generic | |
parent | e5648acf4c3dffe742901c883a29b53f65690f65 (diff) |
pst-intersect (17mar14)
git-svn-id: svn://tug.org/texlive/trunk@33210 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic')
-rw-r--r-- | Master/texmf-dist/tex/generic/pst-intersect/pst-intersect.tex | 105 |
1 files changed, 29 insertions, 76 deletions
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 099d487e748..7561f8c00c9 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.3 (2014/03/04) +%% Version: 0.4 (2014/03/16) %% %% Copyright (C) 2007-2014 by Christoph Bersch <usenet@bersch.net> %% @@ -62,6 +62,8 @@ }% \newif\PIT@saveintersections \define@boolkey[psset]{intersect}[PIT@]{saveintersections}[true]{} +\newif\PIT@addintersections +\define@boolkey[psset]{intersect}[PIT@]{addintersections}[true]{} \psset[intersect]{% tstart=-1, @@ -69,7 +71,8 @@ istart=-1, istop=-1, name={}, - saveintersections + saveintersections, + addintersections=false }% \def\PIT@use@pscode{% \pstverb{% @@ -145,45 +148,18 @@ \PIT@checkname{#1}% \addto@pscode{% \pst@intersectdict - \PIT@key@tstop\space dup 0 lt { pop \PIT@name{#1} GetSegmentCount } if - \PIT@key@tstart\space dup 0 lt { pop 0 } if exch - \PIT@name{#1} GetSegmentCount - 2 copy exch dup 3 1 roll - lt exch 0 lt or { exch } if pop - \PIT@name{#1} dup IsPath { - 3 1 roll 2 copy gt { - exch 3 -1 roll dup 4 1 roll GetSegmentCount - dup 4 1 roll exch sub 3 1 roll sub exch - gsave newpath - [ 4 -1 roll aload pop InitTracing - { counttomark 0 eq { exit } if - load exec - } loop - reversepath - GetFullPath ] 3 1 roll - grestore - } if - ShowPathPortion - }{ - [ exch dup 5 -2 roll - 2 copy gt { - exch - 2 copy gt { exch } if - [ 5 -2 roll pop PointArrayToArray aload pop - counttomark -2 4 { 2 roll } for ] ArrayToPointArray dup - 4 2 roll - } if - ToUnitInterval Portion - { aload pop } forall - counttomark -2 4 { 2 roll } for - counttomark 2 sub 2 idiv - \psk@plotpoints - exch + /\PIT@name{#1} currentdict exch known not { + (You haven't defined the curve '#1') == + } if + \PIT@name{#1} \PIT@key@tstart\space\PIT@key@tstop\space % [curve] tstart tstop + {\psk@plotpoints exch \txFunc@BezierCurve \ifshowpoints \txFunc@BezierShowPoints \else pop \fi - } ifelse + } + TraceCurveOrPath end }% + %\showpointsfalse \end@OpenObj }% \def\PIT@traceintersection#1#2{% @@ -213,53 +189,20 @@ } { \PIT@key@tstart } ifelse - dup 0 lt { pop 0 } if 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 - 3 -1 roll dup 4 1 roll GetSegmentCount - 2 copy exch dup 3 1 roll % [curve] tstart tstop cnt tstop cnt tstop - lt exch 0 lt or { exch } if pop % (tstop < 0 | cnt < tstop) - 3 -1 roll dup - IsPath { - 3 1 roll - 2 copy gt { - exch 3 -1 roll dup 4 1 roll GetSegmentCount - dup 4 1 roll exch sub 3 1 roll sub exch - gsave newpath - [ 4 -1 roll aload pop InitTracing - { counttomark 0 eq { exit } if - load exec - } loop - reversepath - GetFullPath ] 3 1 roll - grestore - } if - ShowPathPortion - }{ - [ exch dup 5 -2 roll - exch dup 0 lt { pop 0 } if exch - dup 0 lt { pop 1 } if - 2 copy gt { - exch - [ 5 -2 roll pop PointArrayToArray aload pop - counttomark -2 4 { 2 roll } for ] ArrayToPointArray dup - 4 2 roll - } if - ToUnitInterval Portion - { aload pop } forall - counttomark 2 sub 2 idiv - \psk@plotpoints - exch + } ifelse % [curve] tstart tstop + {\psk@plotpoints exch \txFunc@BezierCurve \ifshowpoints \txFunc@BezierShowPoints \else pop \fi - } ifelse + } + TraceCurveOrPath end }% + %\showpointsfalse \end@OpenObj }% \def\psintersect{\pst@object{psintersect}} @@ -295,7 +238,8 @@ 4 copy LoadIntersectionPoints 5 1 roll } ifelse } ifelse - /\PIT@@name\space /\PIT@name{#1} /\PIT@name{#2} 8 3 roll + /\PIT@name{#1} /\PIT@name{#2} /\PIT@@name + \ifPIT@addintersections true \else false \fi SaveIntersection }% \ifPIT@saveintersections @@ -356,6 +300,15 @@ end \tx@UserCoor /I-#1#3.y exch def /I-#1#3.x exch def }% +\def\psGetCurvePoint#1#2{% + \pst@intersectdict + currentdict /\PIT@name{#1} known not { + (You haven't defined the curve or path '#1') == + } if + #2 \PIT@name{#1} GetCurvePoint \tx@UserCoor + end + /I-#1.y exch def /I-#1.x exch def +}% \catcode`\@=\PstAtCode\relax \endinput %% |