From 61f034941d65cf39d29d8b935d96af5bd35d72b5 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 21 Aug 2016 21:40:48 +0000 Subject: pst-bezier (21aug16) git-svn-id: svn://tug.org/texlive/trunk@41899 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/dvips/pst-bezier/pst-bezier.pro | 143 ++++++++++++++++++++-- 1 file changed, 135 insertions(+), 8 deletions(-) (limited to 'Master/texmf-dist/dvips') diff --git a/Master/texmf-dist/dvips/pst-bezier/pst-bezier.pro b/Master/texmf-dist/dvips/pst-bezier/pst-bezier.pro index 560d027a807..72980006e21 100644 --- a/Master/texmf-dist/dvips/pst-bezier/pst-bezier.pro +++ b/Master/texmf-dist/dvips/pst-bezier/pst-bezier.pro @@ -1,17 +1,16 @@ -%% $Id: pst-bezier.pro 87 2009-01-29 10:37:06Z herbert $ -%% PostScript prologue for pstricks-add.tex. +%% $Id: pst-bezier.pro 323 2016-08-20 17:57:28Z herbert $ +%% PostScript prologue for pst-bezier.tex. %% -%% Version 0.01, 2009/01/29 +%% Version 0.02, 2016/08/19 %% %% For distribution, see pst-bezier.tex. %% %% tx@Dict begin - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Auxiliary routines: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - +% %% [x1 y1] [x2 y2] -> [ x1+y1 x2+y2 ] /AddArrays2d { [ 3 1 roll %% Get the operands @@ -40,8 +39,7 @@ tx@Dict begin 3 1 roll 1 get mul ] } bind def - - +% %% << [Array of Bezier splines] /K 1 >> -> empty stack %% Thereby, a Bezier spline is described by an array: %% [x0 y0 x1 y1 x2 y2 x3 y3 sl sr] @@ -71,7 +69,6 @@ begin %% LaTeX provides the dictionary (see above comments) Splines K 1 sub get 2 2 getinterval SubArrays2d putinterval %% } if - %% Second control point: Splines K get 2 get dup %% (cases /n and /s) /n eq { %% `not specified' -> automatically computed @@ -106,4 +103,134 @@ begin %% LaTeX provides the dictionary (see above comments) ] end def %% Put points in the top dictionary } bind def +% +/tx@RQBCmasse { + /P0P1{ + xP0 xP1 add + yP0 yP1 add + } def + /P0P2{ + xP0 xP2 add + yP0 yP2 add + } def + /P1P2{ + xP2 xP1 add + yP2 yP1 add + } def + /B0 { 1 t sub dup mul } def + /B1 {2 t mul 1 t sub mul }def + /B2 { t dup mul }def +% +% w0 abs 1e-6 gt {1}{0} ifelse /choixw0 exch def +% w1 abs 1e-6 gt {1}{0} ifelse /choixw1 exch def +% w2 abs 1e-6 gt {1}{0} ifelse /choixw2 exch def +% /choix choixw2 4 mul choixw1 2 mul add choixw0 add def + choix 1 eq { + /den { w0 B0 mul }def % + /RQBCmasse1 { + 0 1 nB {/t exch nB div def + den 0 ne { + w0 B0 mul xP0 mul B1 xP1 mul add B2 xP2 mul add den div + w0 B0 mul yP0 mul B1 yP1 mul add B2 yP2 mul add den div + } if + } for + } def + /RQBCmasse2 {} def + } if % fin choix 1 + choix 2 eq { + /den {w1 B1 mul } def % + /RQBCmasse1 { + 1 1 nB {/t exch nB div def + den 0 ne {% B0*P0+w1*B1*P1+B2*P2 + B0 xP0 mul w1 B1 mul xP1 mul add B2 xP2 mul add den div + B0 yP0 mul w1 B1 mul yP1 mul add B2 yP2 mul add den div + } if + } for + } def + /RQBCmasse2 {} def + } if % fin choix 2 + choix 3 eq { + /den { w0 B0 mul w1 B1 mul add } def % w0*B0+w1*B1 + /RQBCmasse1 { + 0 1 nB {/t exch nB div def + den 1e-6 gt { % w0*B0*P0+w1*B1*P1+B2*P2 + w0 B0 mul xP0 mul w1 B1 mul xP1 mul add B2 xP2 mul add den div + w0 B0 mul yP0 mul w1 B1 mul yP1 mul add B2 yP2 mul add den div + } if + } for + } def + /RQBCmasse2 { + 0 1 nB {/t exch nB div def + den -1e-6 lt { % w0*B0*P0+w1*B1*P1+B2*P2 + w0 B0 mul xP0 mul w1 B1 mul xP1 mul add B2 xP2 mul add den div + w0 B0 mul yP0 mul w1 B1 mul yP1 mul add B2 yP2 mul add den div + } if + } for + } def + } if % fin choix 3 + choix 4 eq { + /den { w2 B2 mul } def % w2*B2 + /RQBCmasse1 { + 0 1 nB {/t exch nB div def + den 0 ne { % B0*P0+B1*P1+w2*B2*P2 + B0 xP0 mul B1 xP1 mul add w2 B2 mul xP2 mul add den div + B0 yP0 mul B1 yP1 mul add w2 B2 mul yP2 mul add den div + } if + } for + } def + /RQBCmasse2 {} def + } if % fin choix 4 + choix 5 eq { + /den {w0 B0 mul w2 B2 mul add} def % w0*B0+w2*B2 + /RQBCmasse1 { + 1 1 nB {/t exch nB div def + den 0 ne { % w0*B0*P0+B1*P1+w2*B2*P2 + w0 B0 mul xP0 mul B1 xP1 mul add w2 B2 mul xP2 mul add den div + w0 B0 mul yP0 mul B1 yP1 mul add w2 B2 mul yP2 mul add den div + } if + } for + } def + /RQBCmasse2 {} def + } if % fin choix 5 + choix 6 eq { + /den { w1 B1 mul w2 B2 mul add } def % w1*B1+w2*B2 + /RQBCmasse1 { + 0 1 nB {/t exch nB div def + den 1e-6 gt { % B0*P0+w1*B1*P1+w2*B2*P2 + B0 xP0 mul w1 B1 mul xP1 mul add w2 B2 mul xP2 mul add den div + B0 yP0 mul w1 B1 mul yP1 mul add w2 B2 mul yP2 mul add den div + } if + } for + } def + /RQBCmasse2 { + 0 1 nB {/t exch nB div def + den -1e-6 lt { % B0*P0+w1*B1*P1+w2*B2*P2 + B0 xP0 mul w1 B1 mul xP1 mul add w2 B2 mul xP2 mul add den div + B0 yP0 mul w1 B1 mul yP1 mul add w2 B2 mul yP2 mul add den div + } if + } for + } def + } if % fin choix 6 + choix 7 eq { + /den { w0 B0 mul w1 B1 mul add w2 B2 mul add } def +% tableau de pointslist[(w0-w1+sqrt(-w0*w2+w1^2))/(w0-2*w1+w2),(w0-w1-sqrt(-w0*w2+w1^2))/(w0-2*w1+w2)] + /RQBCmasse1 { + 0 1 nB {/t exch nB div def + den 1e-6 gt { % w0*B0*P0+w1*B1*P1+w2*B2*P2 + w0 B0 mul xP0 mul B1 w1 mul xP1 mul add w2 B2 mul xP2 mul add den div % xP + w0 B0 mul yP0 mul B1 w1 mul yP1 mul add w2 B2 mul yP2 mul add den div % yP + } if + } for + } def + /RQBCmasse2 { + 0 1 nB {/t exch nB div def + den -1e-6 lt { + w0 B0 mul xP0 mul B1 w1 mul xP1 mul add w2 B2 mul xP2 mul add den div % xP + w0 B0 mul yP0 mul B1 w1 mul yP1 mul add w2 B2 mul yP2 mul add den div % yP + } if + } for + } def + } if % fin du choix 7 +} def +% end %% tx@Dict -- cgit v1.2.3