diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/curve2e/curve2e.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/curve2e/curve2e.sty | 112 |
1 files changed, 101 insertions, 11 deletions
diff --git a/Master/texmf-dist/tex/latex/curve2e/curve2e.sty b/Master/texmf-dist/tex/latex/curve2e/curve2e.sty index db002fd2a51..818c1e986c1 100644 --- a/Master/texmf-dist/tex/latex/curve2e/curve2e.sty +++ b/Master/texmf-dist/tex/latex/curve2e/curve2e.sty @@ -17,7 +17,7 @@ %% \NeedsTeXFormat{LaTeX2e}[2014/05/01] \ProvidesPackage{curve2e}% - [2015/06/19 v.1.50 Extension package for pict2e] + [2015/06/27 v.1.54 Extension package for pict2e] \RequirePackage{color} @@ -221,6 +221,7 @@ \noexpand\egroup\noexpand\def\noexpand#3{% \strip@pt\dimexpr\@DimA*\@DimB/\p@\relax}}% \x\ignorespaces}% + \let\MultiplyFN\MultiplY \fi \fi @@ -346,15 +347,21 @@ \noexpand\def\noexpand#2{\@tempA}\noexpand\ignorespaces}% \endTanOf}% \def\ArcTanOf#1to#2{\bgroup +\countdef\Inverti 4444\Inverti=0 +\def\Segno{} \edef\@tF{#1}\@tdF=\@tF\p@ \@tdE=57.295778\p@ -\@tdD=\ifdim\@tdF>\z@ \@tdF\else -\@tdF\fi +\@tdD=\ifdim\@tdF<\z@ -\@tdF\def\Segno{-}\else\@tdF\fi +\ifdim\@tdD>\p@ +\Inverti=\@ne +\@tdD=\dimexpr\p@*\p@/\@tdD\relax +\fi \unless\ifdim\@tdD>0.02\p@ - \def\@tX{\strip@pt\dimexpr57.295778\@tdF\relax}% + \def\@tX{\strip@pt\dimexpr57.295778\@tdD\relax}% \else \edef\@tX{45}\relax - \countdef\I 2523 \I=8\relax + \countdef\I 2523 \I=9\relax \@whilenum\I>0\do{\TanOf\@tX to\@tG - \edef\@tG{\strip@pt\dimexpr\@tG\p@-\@tdF\relax}\relax + \edef\@tG{\strip@pt\dimexpr\@tG\p@-\@tdD\relax}\relax \MultiplY\@tG by57.295778to\@tG \CosOf\@tX to\@tH \MultiplY\@tH by\@tH to\@tH @@ -362,7 +369,10 @@ \edef\@tX{\strip@pt\dimexpr\@tX\p@ - \@tH\p@\relax}\relax \advance\I\m@ne}% \fi -\edef\x{\egroup\noexpand\edef\noexpand#2{\@tX}}\x\ignorespaces}% +\ifnum\Inverti=\@ne +\edef\@tX{\strip@pt\dimexpr90\p@-\@tX\p@\relax} +\fi +\edef\x{\egroup\noexpand\edef\noexpand#2{\Segno\@tX}}\x\ignorespaces}% \def\MakeVectorFrom#1#2to#3{\edef#3{#1,#2}\ignorespaces}% \def\CopyVect#1to#2{\edef#2{#1}\ignorespaces}% \def\ModOfVect#1to#2{\GetCoord(#1)\t@X\t@Y @@ -679,7 +689,8 @@ \pIIe@moveto{\@tempa\unitlength}{\@tempb\unitlength}% \GetCoord(#2)\@tempa\@tempb \CopyVect\@tempa,\@tempb to\@Dzero -\DirOfVect\@Dzero to\@Dzero} +\DirOfVect\@Dzero to\@Dzero +\ignorespaces} \def\ChangeDir<#1>{% \GetCoord(#1)\@tempa\@tempb \CopyVect\@tempa,\@tempb to\@Dzero @@ -707,8 +718,14 @@ \StartCurveAt#1WithDir{#3}\relax \CbezierTo#2WithDir#4AndDists#5And{#6}\CurveFinish} +\def\@isTension#1;#2!!{\def\@tempA{#1}% +\def\@tempB{#2}\unless\ifx\@tempB\empty\strip@semicolon#2\fi} +\def\strip@semicolon#1;{\def\@tempB{#1}} \def\CurveTo#1WithDir#2{% -\def\@Puno{#1}\def\@Duno{#2}\DirOfVect\@Duno to\@Duno +\def\@Tuno{1}\def\@Tzero{1}\relax +\edef\@Puno{#1}\@isTension#2;!!% +\expandafter\DirOfVect\@tempA to\@Duno +\bgroup\unless\ifx\@tempB\empty\GetCoord(\@tempB)\@Tzero\@Tuno\fi \DistanceAndDirOfVect\@Puno minus\@Pzero to\@Chord and\@DirChord \MultVect\@Dzero by*\@DirChord to \@Dpzero \MultVect\@Duno by*\@DirChord to \@Dpuno @@ -729,10 +746,11 @@ \edef\@SinDzero{\ifdim\@DYpzero\p@<\z@ -\fi\@DYpzero}% \@tdA=\@semichord\p@ \@tdA=1.333333\@tdA \DividE\@tdA by\@SinDzero\p@ to \@KCzero - \@tdA=\dimexpr(\p@-\@CosDzero\p@) + \@tdA=\dimexpr(\p@-\@CosDzero\p@)\relax \DividE\@KCzero\@tdA by\@SinDzero\p@ to \@KCzero \fi \fi +\MultiplyFN\@KCzero by \@Tzero to \@KCzero \ScaleVect\@Dzero by\@KCzero to\@CPzero \AddVect\@Pzero and\@CPzero to\@CPzero \ifdim\@DXpuno\p@=\z@ @@ -749,10 +767,11 @@ \edef\@SinDuno{\ifdim\@DYpuno\p@<\z@ -\fi\@DYpuno}% \@tdA=\@semichord\p@ \@tdA=-1.333333\@tdA \DividE\@tdA by \@SinDuno\p@ to \@KCuno - \@tdA=\dimexpr(\p@-\@CosDuno\p@) + \@tdA=\dimexpr(\p@-\@CosDuno\p@)\relax \DividE\@KCuno\@tdA by\@SinDuno\p@ to \@KCuno \fi \fi +\MultiplyFN\@KCuno by \@Tuno to \@KCuno \ScaleVect\@Duno by\@KCuno to\@CPuno \AddVect\@Puno and\@CPuno to\@CPuno \GetCoord(\@Puno)\@XPuno\@YPuno @@ -760,7 +779,7 @@ \GetCoord(\@CPuno)\@XCPuno\@YCPuno \pIIe@curveto{\@XCPzero\unitlength}{\@YCPzero\unitlength}% {\@XCPuno\unitlength}{\@YCPuno\unitlength}% - {\@XPuno\unitlength}{\@YPuno\unitlength}% + {\@XPuno\unitlength}{\@YPuno\unitlength}\egroup \CopyVect\@Puno to\@Pzero \CopyVect\@Duno to\@Dzero \ignorespaces}% @@ -777,6 +796,77 @@ \@ifnextchar\lp@r\@Curve{% \@ifnextchar[\@ChangeDir\CurveEnd}} \def\@ChangeDir[#1]{\ChangeDir<#1>\@Curve} +\def\Qurve{\@ifstar{\let\fillstroke\fillpath\Qurve@}% +{\let\fillstroke\strokepath\Qurve@}} + +\def\Qurve@(#1)<#2>{% + \StartCurveAt#1WithDir{#2}% + \@ifnextchar\lp@r\@Qurve{% + \PackageWarning{curve2e}{% + Quadratic curve specifications must contain at least + two nodes!\Messagebreak + Please, control your Qurve specifications\MessageBreak}}}% +\def\@Qurve(#1)<#2>{\QurveTo#1WithDir{#2}% + \@ifnextchar\lp@r\@Qurve{% + \@ifnextchar[\@ChangeQDir\CurveEnd}}% +\def\@ChangeQDir[#1]{\ChangeDir<#1>\@Qurve}% +\def\QurveTo#1WithDir#2{% +\edef\@Puno{#1}\DirOfVect#2to\@Duno\bgroup +\DistanceAndDirOfVect\@Puno minus\@Pzero to\@Chord and\@DirChord +\MultVect\@Dzero by*\@Duno to \@Scalar +\YpartOfVect\@Scalar to \@YScalar +\ifdim\@YScalar\p@=\z@ +\PackageWarning{curve2e}% + {Quadratic Bezier arcs cannot have their starting\MessageBreak + and ending directions parallel or antiparallel with\MessageBreak + each other. This arc is skipped and replaced with + a dotted line.\MessageBreak}% + \Dotline(\@Pzero)(\@Puno){2}\relax +\else +\MultVect\@Dzero by*\@DirChord to \@Dpzero +\MultVect\@Duno by*\@DirChord to \@Dpuno +\GetCoord(\@Dpzero)\@DXpzero\@DYpzero +\GetCoord(\@Dpuno)\@DXpuno\@DYpuno +\MultiplyFN\@DXpzero by\@DXpuno to\@XXD +\MultiplyFN\@DYpzero by\@DYpuno to\@YYD +\unless\ifdim\@YYD\p@<\z@\ifdim\@XXD\p@<\z@ +\PackageWarning{curve2e}% + {Quadratic Bezier arcs cannot have inflection points\MessageBreak + Therefore the tangents to the starting and ending arc\MessageBreak + points cannot be directed to the same half plane.\MessageBreak + This arc is skipped and replaced by a dotted line\MessageBreak}% + \Dotline(\@Pzero)(\@Puno){2}\fi +\else +\edef\@CDzero{\@DXpzero}\relax +\edef\@SDzero{\@DYpzero}\relax +\edef\@CDuno{\@DXpuno}\relax +\edef\@SDuno{\@DYpuno}\relax +\MultiplyFN\@SDzero by\@CDuno to\@tempA +\MultiplyFN\@SDuno by\@CDzero to\@tempB +\edef\@tempA{\strip@pt\dimexpr\@tempA\p@-\@tempB\p@}\relax +\@tdA=\@SDuno\p@ \@tdB=\@Chord\p@ \@tdC=\@tempA\p@ +\edef\@tempC{\strip@pt\dimexpr \@tdA*\@tdB/\@tdC}\relax +\MultiplyFN\@tempC by\@CDzero to \@XC +\MultiplyFN\@tempC by\@SDzero to \@YC +\ModOfVect\@XC,\@YC to\@KC +\ScaleVect\@Dzero by\@KC to\@CP +\AddVect\@Pzero and\@CP to\@CP +\GetCoord(\@Pzero)\@XPzero\@YPzero +\GetCoord(\@Puno)\@XPuno\@YPuno +\GetCoord(\@CP)\@XCP\@YCP +\@ovxx=\@XPzero\unitlength \@ovyy=\@YPzero\unitlength +\@ovdx=\@XCP\unitlength \@ovdy=\@YCP\unitlength +\@xdim=\@XPuno\unitlength \@ydim=\@YPuno\unitlength + \pIIe@bezier@QtoC\@ovxx\@ovdx\@ovro + \pIIe@bezier@QtoC\@ovyy\@ovdy\@ovri + \pIIe@bezier@QtoC\@xdim\@ovdx\@clnwd + \pIIe@bezier@QtoC\@ydim\@ovdy\@clnht + \pIIe@moveto\@ovxx\@ovyy + \pIIe@curveto\@ovro\@ovri\@clnwd\@clnht\@xdim\@ydim +\fi\fi\egroup +\CopyVect\@Puno to\@Pzero +\CopyVect\@Duno to\@Dzero +\ignorespaces} %% %% Copyright 2005-2015 Claudio Beccari |