| 1 |
%% xyarc.tex from $Id: xyarc.doc,v 3.8 2011/03/14 20:14:00 krisrose Exp $ |
| 2 |
%% |
| 3 |
%% Xy-pic ``Circles, Ellipses and Arcs'' feature. |
| 4 |
%% Copyright (c) 1995-1997 Ross Moore <[email protected]> |
| 5 |
%% |
| 6 |
%% This file is part of the Xy-pic package for graphs and diagrams in TeX. |
| 7 |
%% See the companion README and INSTALL files for further information. |
| 8 |
%% Copyright (c) 1991-2011 Kristoffer H. Rose <[email protected]> |
| 9 |
%% |
| 10 |
%% The XY-pic package is free software; you can redistribute it and/or modify |
| 11 |
%% it under the terms of the GNU General Public License as published by the |
| 12 |
%% Free Software Foundation; either version 2 of the License, or (at your |
| 13 |
%% option) any later version. |
| 14 |
%% |
| 15 |
%% The XY-pic package is distributed in the hope that it will be useful, but |
| 16 |
%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
| 17 |
%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 18 |
%% for more details. |
| 19 |
%% |
| 20 |
%% You should have received a copy of the GNU General Public License along |
| 21 |
%% with this package; if not, see http://www.gnu.org/licenses/. |
| 22 |
%% |
| 23 |
\ifx\xyloaded\undefined \input xy \fi |
| 24 |
\xyprovide{arc}{Circle, Ellipse, Arc feature}{\stripRCS$Revision: 3.8 $}% |
| 25 |
{Ross Moore}{[email protected]}% |
| 26 |
{Mathematics Department, Macquarie University, NSW~2109, Australia} |
| 27 |
\xyrequire{curve} |
| 28 |
\xycatcodes |
| 29 |
\xydef@\ellipse#1#{\xy@{ELLIPSE}{\hbox\bgroup\save@}% |
| 30 |
\let\endarc@=\endellipse@@ \xyFN@\preARC@ #1@} |
| 31 |
\xydef@\endellipse@@{\xy@{endELLIPSE}{\leave@\origDirection@ |
| 32 |
\edef\next@{\egroup \X@min=\the\X@min \X@max=\the\X@max |
| 33 |
\Y@min=\the\Y@min \Y@max=\the\Y@max }\next@}\let\bstartPLACE@=\relax} |
| 34 |
\xydef@\preARC@{% |
| 35 |
\ifx\next\space@ \expandafter\DN@\space{\xyFN@\preARC@}% |
| 36 |
\else\ifx\next @\DN@{\xy@{ellipseARC}\ellipticARC@ \arc@}% |
| 37 |
\else\ifx\next ~\DN@~##1{\tildeARC@{##1}}% |
| 38 |
\else\DN@{\xy@{ellipticARC}\ellipticARC@ \arc@}% |
| 39 |
\fi\fi\fi \next@ } |
| 40 |
\xydef@\arc@#1@#2{\DN@{#2}% |
| 41 |
\ifx\next@\empty \xy@{arcSTYLE}{\def\arcSTYLE{-}}% |
| 42 |
\else \xy@{arcSTYLE}{\def\arcSTYLE{#2}}\fi \arc@i |
| 43 |
\DNii@{#1}% |
| 44 |
\ifx\nextii@\empty \DN@{\fullCircle@}% |
| 45 |
\else \DN@{_}% |
| 46 |
\ifx\next@\nextii@ \xy@{_}{\def\arcOrient@@{_}}% |
| 47 |
\let\arcOrient@@=\next@ \DN@{\fullCircle@}% |
| 48 |
\else \DN@{^}% |
| 49 |
\ifx\next@\nextii@ \xy@{^}{\def\arcOrient@@{^}}% |
| 50 |
\let\arcOrient@@=\next@ \DN@{\fullCircle@}% |
| 51 |
\else \DN@{\def\afterARCextents@@{% |
| 52 |
\xy@{aftARCext}{\let\doCircleArc@=\doCircleArc@@}% |
| 53 |
\ellipseArc@ \xy@{doCircARCs}{\doCircleArcs@}\endarc@ }% |
| 54 |
\xyFN@\getarcparams@#1@}\fi\fi\fi |
| 55 |
\next@ } |
| 56 |
\xydef@\arc@i{\xy@{ARCi}{% |
| 57 |
\save@\idfromc@{0@c}\cfromp@\idfromc@{0@p}% |
| 58 |
\enter@\cplusthec@ \enter@\relax\begingroup\vfromslide@i{}@\czeroEdge@ |
| 59 |
\leave@\idfromc@{0@m}\leave@ \zeroDivideLimit@{50}% |
| 60 |
\edef\origDirection@{\Direction=\the\Direction |
| 61 |
\relax\noexpand\imposeDirection@}% |
| 62 |
\let\startDirection@=\origDirection@ \def\startDirection@@{}% |
| 63 |
\def\endDirection@{}\def\endDirection@@{}\def\arcOrient@@{^}}% |
| 64 |
\def\arcOrient@@{^}\let\processDirections@=\checkstartDirection@ |
| 65 |
\def\arcRadius@{}\def\ellipseRatio@{}\def\arcScale@{\arcScale@@}} |
| 66 |
\message{circles,} |
| 67 |
\xydef@\fullCircle@{\xy@{fullCIRC}{\let\endDirection@=\relax |
| 68 |
\let\doCircleArc@=\doMergeEndArc@@}\circleArc@ }% |
| 69 |
\xydef@\getarcparams@{% |
| 70 |
\ifx\space@\next \expandafter\DN@\space{\xyFN@\getarcparams@}% |
| 71 |
\else\addLT@\ifx \next \xy@{<}{}% |
| 72 |
\addGT@{\addLT@\DN@##1}{\splitRadius@dim##1,,@}% |
| 73 |
\else\ifx\next (\DN@({\xyFN@\checkRadOpen@}% |
| 74 |
\else\ifx\next @\xy@{@}{}\DN@ @{\fullEllipse@}% |
| 75 |
\else \addLQ@\ifx \next \addLQ@\DN@{\xy@`{}\ARCturn@}% |
| 76 |
\else \DN@{\getarcExtents@}% |
| 77 |
\fi\fi\fi\fi\fi \next@ } |
| 78 |
\xydef@\checkRadOpen@{% |
| 79 |
\ifx\next *\DN@{\xyFN@\getarcExtents@ (}% |
| 80 |
\else \xy@{(}{}\DN@##1){\splitRadius@##1,,@}% |
| 81 |
\fi \next@ } |
| 82 |
\xydef@\fixedRadiusArc@{% |
| 83 |
\xy@{fixRadArc}{\save@ \idfromc@{0@0}\cfromp@\idfromc@{0@c}\leave@}% |
| 84 |
\xyFN@\fixedRadiusArc@i } |
| 85 |
\xydef@\fixedRadiusArc@i{% |
| 86 |
\ifx\next\space@ \expandafter\DN@\space{\xyFN@\fixedRadiusArc@i}% |
| 87 |
\else\ifx\next @\xy@{@}{}\DN@ @{\fullEllipse@}% |
| 88 |
\else\DN@{\let\processDirections@=\processArcDirections@ |
| 89 |
\def\afterARCextents@@{\xy@{aftARCext}{\let\doCircleArc@=\doCircleArc@@ |
| 90 |
\ellipseSector@}}\xyFN@\getarcExtents@}% |
| 91 |
\fi\fi \next@ } |
| 92 |
\xydef@\arcScale@@{\xy@{arcSCALE@@}{\save@ |
| 93 |
\cfromid@{0@0}\pfromc@\cfromid@{0@p}\setbase@\X@p\Y@p\X@c\Y@c}} |
| 94 |
\xydef@\arcScale@dim#1{\xy@{arcSCALEdim}{\save@ |
| 95 |
\cfromid@{0@0}\pfromc@ \cfromid@{0@p}\setupDirection@\cfromp@ |
| 96 |
\enter@\cplusthec@ \begingroup\vfromslide@i#1@% |
| 97 |
\setbase@\X@p\Y@p\X@c\Y@c \idfromc@{0@p}}} |
| 98 |
\xydef@\ellipseScale@dim#1{\xy@{ellSCALEdim}{\setupDirection@\cfromp@ |
| 99 |
\enter@\cplusthec@ \aboveDirection@\xydashl@ \vfromslide@{#1}\leave@ |
| 100 |
\setbase@@\X@c\Y@c}} |
| 101 |
\xydef@\ellipseScale@#1{\xy@{ellSCALE@}% |
| 102 |
{\vfromcartesian@@0,#1@\setbase@@\X@c\Y@c}} |
| 103 |
\xydef@\splitRadius@dim#1,#2,#3@{% |
| 104 |
\DN@{#1}\ifx\next@\empty\dimen@=\z@\else\dimen@=#1\relax%\splinetracing |
| 105 |
\expandafter\def\expandafter\arcRadius@ |
| 106 |
\expandafter{\arcScale@dim{#1}}\fi |
| 107 |
\DN@{#2}\ifx\next@\empty\dimen@ii=\z@\def\ellipseRatio@{}% |
| 108 |
\else\dimen@ii=#2\relax \expandafter |
| 109 |
\def\expandafter\ellipseRatio@\expandafter{\ellipseScale@dim{#2}}% |
| 110 |
\fi \fixedRadiusArc@ } |
| 111 |
\xydef@\splitRadius@#1,#2,#3@{% |
| 112 |
\DN@{#1}\ifx\next@\empty\dimen@=\z@\else\dimen@=#1\p@\relax\fi |
| 113 |
\DN@{#2}\ifx\next@\empty\dimen@ii=\z@\else\dimen@ii=#2\p@\relax\fi |
| 114 |
\ifdim\dimen@=\z@ \ifdim\dimen@ii=\z@\else \expandafter |
| 115 |
\def\expandafter\ellipseRatio@\expandafter{\ellipseScale@{#2}}\fi |
| 116 |
\else |
| 117 |
\ifdim\dimen@ii=\z@ |
| 118 |
\def\arcScale@{\xy@{arcSCALE@}{\save@\cfromid@{0@0}% |
| 119 |
\X@origin=\X@c \Y@origin=\Y@c |
| 120 |
\X@xbase=#1\X@xbase \Y@xbase=#1\Y@xbase |
| 121 |
\X@ybase=#1\X@ybase \Y@ybase=#1\Y@ybase |
| 122 |
\advance\X@c\X@xbase \advance\Y@c\Y@xbase \czeroEdge@ |
| 123 |
\idfromc@{0@p}\idfromc@{0@c}}}% |
| 124 |
\else |
| 125 |
\def\arcScale@{\xy@{arcSCALE@}{\save@\cfromid@{0@0}% |
| 126 |
\X@origin=\X@c \Y@origin=\Y@c |
| 127 |
\X@xbase=#1\X@xbase \Y@xbase=#1\Y@xbase |
| 128 |
\X@ybase=#2\X@ybase \Y@ybase=#2\Y@ybase |
| 129 |
\advance\X@c\X@xbase \advance\Y@c\Y@xbase \czeroEdge@ |
| 130 |
\idfromc@{0@p}\idfromc@{0@c}}}% |
| 131 |
\fi |
| 132 |
\fi \fixedRadiusArc@ } |
| 133 |
\xydef@\baseOrient@{\DN@{_}\ifx\next@\arcOrient@@ |
| 134 |
\X@ybase=-\X@ybase \Y@ybase=-\Y@ybase \fi } |
| 135 |
\message{ellipses,} |
| 136 |
\xydef@\fullEllipse@{\xy@{fullELLIPSE}% |
| 137 |
{\def\startDirection@{}\let\doCircleArc@=\doMergeEndArc@@}% |
| 138 |
\ellipseArc@ |
| 139 |
\xy@{doCIRCarcs}{\leave@ \doCircleArcs@}\endarc@ } |
| 140 |
\xydef@\ellipseArc@{% |
| 141 |
\arcScale@ \arcRadius@ \ellipseRatio@ |
| 142 |
\xy@{arcCONTROLS}{\baseOrient@ \arcControls@ \let\bstartPLACE@=\relax }} |
| 143 |
\xydef@\cubicARCcontrols@@{\czeroEdge@ |
| 144 |
\vfromcartesian@@0,1@\idfromc@{1@c}% |
| 145 |
\vfromcartesian@@-1,0@\idfromc@{2@c}% |
| 146 |
\vfromcartesian@@0,-1@\idfromc@{3@c}% |
| 147 |
\vfromcartesian@@1,\arcparam@ @\idfromc@{1@m}% |
| 148 |
\vfromcartesian@@\arcparam@,1@\idfromc@{2@m}% |
| 149 |
\vfromcartesian@@-\arcparam@,1@\idfromc@{3@m}% |
| 150 |
\vfromcartesian@@-1,\arcparam@ @\idfromc@{4@m}% |
| 151 |
\vfromcartesian@@-1,-\arcparam@ @\idfromc@{5@m}% |
| 152 |
\vfromcartesian@@-\arcparam@,-1@\idfromc@{6@m}% |
| 153 |
\vfromcartesian@@\arcparam@,-1@\idfromc@{7@m}% |
| 154 |
\vfromcartesian@@1,-\arcparam@ @\idfromc@{8@m}% |
| 155 |
} |
| 156 |
\xydef@\doCircleArc@@#1#2{\save@ \ifcase#2\relax |
| 157 |
\doCircleArc@@@{0@p}{1@m}{2@m}{1@c}{#1}\or |
| 158 |
\doCircleArc@@@{1@c}{3@m}{4@m}{2@c}{#1}\or |
| 159 |
\doCircleArc@@@{2@c}{5@m}{6@m}{3@c}{#1}\or |
| 160 |
\doCircleArc@@@{3@c}{7@m}{8@m}{0@p}{#1}\or |
| 161 |
\doCircleArc@@@{0@p}{1@m}{2@m}{1@c}{#1}\or |
| 162 |
\doCircleArc@@@{1@c}{3@m}{4@m}{2@c}{#1}\or |
| 163 |
\doCircleArc@@@{2@c}{5@m}{6@m}{3@c}{#1}\or |
| 164 |
\doCircleArc@@@{3@c}{7@m}{8@m}{0@p}{#1}\fi \leave@ } |
| 165 |
\xydef@\doCircleArc@@@#1#2#3#4#5{% |
| 166 |
\cfromid@{#1}\pfromc@\senter@ |
| 167 |
\cfromid@{#2}\spushc@\cfromid@{#3}\spushc@\cfromid@{#4}% |
| 168 |
\connect@\crvs{#5}\relax\sinit@\sleave@} |
| 169 |
\xydef@\doMergeEndArc@@#1#2{\save@\ifcase#2\relax |
| 170 |
\doMergeEnd@@@{0@p}{1@m}{2@m}{1@c}{#1}\relax\or |
| 171 |
\doMergeEnd@@@{1@c}{3@m}{4@m}{2@c}{#1}\relax\or |
| 172 |
\doMergeEnd@@@{2@c}{5@m}{6@m}{3@c}{#1}\relax\or |
| 173 |
\doMergeEnd@@@{3@c}{7@m}{8@m}{0@p}{#1}@\fi \leave@ } |
| 174 |
\xydef@\doMergeEnd@@@#1#2#3#4#5#6{% |
| 175 |
\cfromid@{#1}\pfromc@\senter@ |
| 176 |
\cfromid@{#2}\spushc@\cfromid@{#3}\spushc@\cfromid@{#4}% |
| 177 |
\ifx#6\relax |
| 178 |
\L@c=.1\p@ \R@c=\L@c \U@c=\L@c \D@c=\L@c \Edge@c={\rectangleEdge}\fi |
| 179 |
\enter@\cmergethec@\cfromid@{0@c}\leave@ |
| 180 |
\enter@\cmergethec@\cfromcontrols@{#1}{#2}{#3}{#4}\leave@ |
| 181 |
\connect@\crvs{#5}\relax |
| 182 |
\sinit@\sleave@} |
| 183 |
\xydef@\doMergeStartArc@#1#2{\save@\ifcase#2\relax |
| 184 |
\doMergeStart@@{0@p}{1@m}{2@m}{1@c}{#1}@\or |
| 185 |
\doMergeStart@@{1@c}{3@m}{4@m}{2@c}{#1}\relax\or |
| 186 |
\doMergeStart@@{2@c}{5@m}{6@m}{3@c}{#1}\relax\or |
| 187 |
\doMergeStart@@{3@c}{7@m}{8@m}{0@p}{#1}\relax\fi \leave@ } |
| 188 |
\xydef@\doMergeStart@@#1#2#3#4#5#6{% |
| 189 |
\cfromid@{#1}\ifx#6\relax |
| 190 |
\L@c=.1\p@ \R@c=\L@c \U@c=\L@c \D@c=\L@c \Edge@c={\rectangleEdge}\fi |
| 191 |
\enter@\cmergethec@\cfromid@{0@x}\leave@ |
| 192 |
\enter@\cmergethec@\cfromcontrols@{#4}{#3}{#2}{#1}\leave@ |
| 193 |
\pfromc@ |
| 194 |
\senter@ \cfromid@{#2}\spushc@\cfromid@{#3}\spushc@\cfromid@{#4}% |
| 195 |
\connect@\crvs{#5}\relax\sinit@\sleave@} |
| 196 |
\xydef@\doMergeBothArc@#1#2{\save@\ifcase#2\relax |
| 197 |
\doMergeBoth@@{0@p}{1@m}{2@m}{1@c}{#1}@\or |
| 198 |
\doMergeBoth@@{1@c}{3@m}{4@m}{2@c}{#1}\relax\or |
| 199 |
\doMergeBoth@@{2@c}{5@m}{6@m}{3@c}{#1}\relax\or |
| 200 |
\doMergeBoth@@{3@c}{7@m}{8@m}{0@p}{#1}\relax\fi \leave@ } |
| 201 |
\xydef@\doMergeBoth@@#1#2#3#4#5#6{% |
| 202 |
\cfromid@{#1}\ifx#6\relax |
| 203 |
\L@c=.1\p@ \R@c=\L@c \U@c=\L@c \D@c=\L@c \Edge@c={\rectangleEdge}\fi |
| 204 |
\enter@\cmergethec@\cfromid@{0@x}\leave@ |
| 205 |
\enter@\cmergethec@\cfromcontrols@{#4}{#3}{#2}{#1}\leave@ |
| 206 |
\pfromc@ |
| 207 |
\senter@ \cfromid@{#2}\spushc@\cfromid@{#3}\spushc@\cfromid@{#4}% |
| 208 |
\enter@\cmergethec@\cfromid@{0@c}\leave@ |
| 209 |
\enter@\cmergethec@\cfromcontrols@{#1}{#2}{#3}{#4}\leave@ |
| 210 |
\connect@\crvs{#5}\relax\sinit@\sleave@} |
| 211 |
\xydef@\doMergeEndArc@#1#2{\count@@=#2\relax |
| 212 |
\ifnum\count@@>\thr@@ \advance\count@@-4\fi\relax |
| 213 |
\doMergeEndArc@@{#1}\count@@ } |
| 214 |
\xydef@\doStraightArc@@#1{\xy@{STRAITarc}{\save@ |
| 215 |
\cfromid@{0@p}\pfromc@\cfromid@{0@c}% |
| 216 |
\senter@\connect@\crvs{#1}\sinit@\sleave@\leave@}} |
| 217 |
\xydef@\cfromcontrols@#1#2#3#4{\bgroup |
| 218 |
\cfromid@{#1}\L@p=\X@c \U@p=\Y@c |
| 219 |
\cfromid@{#4}\R@p=\X@c \D@p=\Y@c |
| 220 |
\cfromid@{#3}\A@=\X@c \B@=\Y@c \cfromid@{#2}% |
| 221 |
\ifdim\R@p>\L@p \ifdim\A@>\R@p \R@p=\A@ |
| 222 |
\ifdim\X@c>\R@p \R@p=\X@c\fi\fi |
| 223 |
\else \ifdim\A@<\R@p \R@p=\A@ |
| 224 |
\ifdim\X@c<\R@p \R@p=\X@c\fi\fi |
| 225 |
\fi |
| 226 |
\ifdim\D@p>\U@p \ifdim\B@>\D@p \D@p=\B@ |
| 227 |
\ifdim\Y@p>\D@p \D@p=\Y@p\fi\fi |
| 228 |
\else \ifdim\B@<\D@p \D@p=\B@ |
| 229 |
\ifdim\Y@p<\D@p \D@p=\Y@p\fi\fi |
| 230 |
\fi |
| 231 |
\edef\next@{\egroup \X@c=\the\R@p \Y@c=\the\D@p}\next@ } |
| 232 |
\xydef@\doCircleArcs@{\save@ |
| 233 |
\cfromid@{0@0}\pfromc@\cfromid@{0@p}\setupDirection@ |
| 234 |
\startDirection@ \edef\startDirection@@{\the\Direction}% |
| 235 |
\cfromid@{1@c}\setupDirection@ \edef\quadDirection@{\the\Direction}\relax |
| 236 |
\count@=\quadDirection@ \relax\def\nextii@{^}% |
| 237 |
\let\preDirection@@=\startDirection@@ |
| 238 |
\ifx\nextii@\arcOrient@@ |
| 239 |
\ifnum\quadDirection@>\startDirection@@ \relax |
| 240 |
\else \advance\count@ by8192 \relax\edef\quadDirection@{\the\count@}\fi |
| 241 |
\ifx\endDirection@@\empty |
| 242 |
\ifx\endDirection@\relax |
| 243 |
\bgroup\cfromid@{0@c}\setupDirection@ |
| 244 |
\edef\next@{\egroup \count@@=\the\Direction}\next@ \relax |
| 245 |
\ifnum\count@@<\startDirection@@ \advance\count@@ 8192 \fi |
| 246 |
\edef\endDirection@@{\the\count@@}% |
| 247 |
\else |
| 248 |
\count@@=\startDirection@@ |
| 249 |
\advance\count@@ by8192 \edef\endDirection@@{\the\count@@}% |
| 250 |
\fi |
| 251 |
\else |
| 252 |
\count@@=\endDirection@@ \relax\ifnum\count@@<\startDirection@@ \relax |
| 253 |
\advance\count@@ by8192 \edef\endDirection@@{\the\count@@}\fi |
| 254 |
\fi |
| 255 |
\ifnum\endDirection@@>\quadDirection@ |
| 256 |
\DN@{\expandafter\doCircleArc@@\expandafter{\arcSTYLE}{0}}% |
| 257 |
\else |
| 258 |
\DN@{\expandafter\doCircleArc@\expandafter{\arcSTYLE}{0}}% |
| 259 |
\fi |
| 260 |
\else |
| 261 |
\ifnum\count@<\startDirection@@\relax\else\advance\count@ by-8192 \relax |
| 262 |
\edef\quadDirection@{\the\count@}\fi |
| 263 |
\ifx\endDirection@@\empty |
| 264 |
\ifx\endDirection@\relax |
| 265 |
\bgroup\cfromid@{0@c}\setupDirection@ |
| 266 |
\edef\next@{\egroup \count@@=\the\Direction}\next@ \relax |
| 267 |
\ifnum\count@@>\startDirection@@ \advance\count@@-8192 \fi |
| 268 |
\edef\endDirection@@{\the\count@@}% |
| 269 |
\else |
| 270 |
\count@@=\startDirection@@ |
| 271 |
\advance\count@@ by-8192 \edef\endDirection@@{\the\count@@}% |
| 272 |
\fi |
| 273 |
\else |
| 274 |
\count@@=\endDirection@@ \relax \ifnum\count@@>\startDirection@@ |
| 275 |
\advance\count@@ by-8192 \edef\endDirection@@{\the\count@@}\fi |
| 276 |
\fi |
| 277 |
\ifnum\endDirection@@<\quadDirection@ |
| 278 |
\DN@{\expandafter\doCircleArc@@\expandafter{\arcSTYLE}{0}}% |
| 279 |
\else \DN@{\expandafter\doCircleArc@\expandafter{\arcSTYLE}{0}}\fi |
| 280 |
\fi |
| 281 |
\next@ \relax |
| 282 |
\count@=\quadDirection@ \relax\def\nextii@{^}\DN@{}% |
| 283 |
\ifx\nextii@\arcOrient@@ |
| 284 |
\count@@=\startDirection@@ \advance\count@@ by4096 \relax |
| 285 |
\ifnum \count@<\endDirection@@ \relax |
| 286 |
\ifnum\endDirection@@>\count@@ |
| 287 |
\DN@{\expandafter\doCircleArc@@\expandafter{\arcSTYLE}{1}}% |
| 288 |
\else \DN@{\expandafter\doCircleArc@\expandafter{\arcSTYLE}{1}}\fi |
| 289 |
\fi |
| 290 |
\else |
| 291 |
\count@@=\startDirection@@ \advance\count@@ by-4096 \relax |
| 292 |
\ifnum \count@>\endDirection@@ \relax |
| 293 |
\ifnum\endDirection@@<\count@@ |
| 294 |
\DN@{\expandafter\doCircleArc@@\expandafter{\arcSTYLE}{1}}% |
| 295 |
\else \DN@{\expandafter\doCircleArc@\expandafter{\arcSTYLE}{1}}\fi |
| 296 |
\fi\fi |
| 297 |
\next@ \relax |
| 298 |
\ifx\next@\empty \else \relax |
| 299 |
\count@=\startDirection@@ \relax\def\nextii@{^}\DN@{}% |
| 300 |
\ifx\nextii@\arcOrient@@ \advance\count@ by4096 \relax |
| 301 |
\count@@=\quadDirection@ \advance\count@@ by4096 \relax |
| 302 |
\ifnum \count@<\endDirection@@ |
| 303 |
\ifnum\endDirection@@>\count@@ |
| 304 |
\DN@{\expandafter\doCircleArc@@\expandafter{\arcSTYLE}{2}}% |
| 305 |
\else \DN@{\expandafter\doCircleArc@\expandafter{\arcSTYLE}{2}}\fi |
| 306 |
\fi |
| 307 |
\else \advance\count@ by-4096 \relax |
| 308 |
\count@@=\quadDirection@ \advance\count@@ by-4096 \relax |
| 309 |
\ifnum \count@>\endDirection@@ \relax |
| 310 |
\ifnum\endDirection@@<\count@@ |
| 311 |
\DN@{\expandafter\doCircleArc@@\expandafter{\arcSTYLE}{2}}% |
| 312 |
\else \DN@{\expandafter\doCircleArc@\expandafter{\arcSTYLE}{2}}\fi |
| 313 |
\fi\fi |
| 314 |
\next@ \relax |
| 315 |
\fi |
| 316 |
\ifx\next@\empty \else \relax |
| 317 |
\count@=\quadDirection@ \def\nextii@{^}\DN@{}% |
| 318 |
\ifx\nextii@\arcOrient@@ \advance\count@ by4096 \relax |
| 319 |
\ifnum \count@<\endDirection@@ |
| 320 |
\DN@{\expandafter\doCircleArc@\expandafter{\arcSTYLE}{3}}\fi |
| 321 |
\else \advance\count@ by-4096 \relax |
| 322 |
\ifnum \count@>\endDirection@@ |
| 323 |
\DN@{\expandafter\doCircleArc@\expandafter{\arcSTYLE}{3}}\fi |
| 324 |
\fi \next@ \relax |
| 325 |
\fi |
| 326 |
\leave@ } |
| 327 |
\message{elliptical arcs,} |
| 328 |
\xydef@\arcmagic@@{0.5517847} |
| 329 |
\xylet@\arcmagic=\arcmagic@@ |
| 330 |
\xydef@\tildeARC@#1{% |
| 331 |
\if q#1\DN@{\xy@{quadARC}\quadARC@ \arc@}% |
| 332 |
\else\if c#1\DN@{\xyFN@\cubicARC@i}% |
| 333 |
\else\if e#1\DN@{\xy@{ellipticARC}\ellipticARC@ \arc@}% |
| 334 |
\else\if i#1\DN@{\xy@{interpARC}\interpARC@ \arc@}% |
| 335 |
\else\if p#1\DN@{\xy@{cuspidalARC}\cuspidalARC@ \arc@}% |
| 336 |
\else\xywarning@{unknown arc type: #1 }% |
| 337 |
\DN@{\xy@{ellipticARC}\ellipticARC@ \arc@}% |
| 338 |
\fi\fi\fi\fi\fi \next@ } |
| 339 |
\xydef@\cubicARC@i{% |
| 340 |
\ifx\next\space@ \expandafter\DN@\space{\xyFN@\cubicARC@i}% |
| 341 |
\else\ifx\next (\DN@(##1){\xy@{cubicARC(##1)}{\cubicARC@{##1}}\arc@}% |
| 342 |
\else \DN@{\xy@{cubicARC(1)}{\cubicARC@{1}}\arc@}% |
| 343 |
\fi\fi \next@ } |
| 344 |
\xydef@\ellipticARC@{\let\arcControls@=\cubicARCcontrols@@ |
| 345 |
\edef\arcparam@{\arcmagic@@}} |
| 346 |
\xydef@\cubicARC@#1{\let\arcControls@=\cubicARCcontrols@@ |
| 347 |
\dimen@=#1\p@ \edef\arcparam@{\expandafter\removePT@\the\dimen@}} |
| 348 |
\xydef@\quadARC@{\let\arcControls@=\cubicARCcontrols@@ |
| 349 |
\def\arcparam@{.66667}} |
| 350 |
\xydef@\cuspidalARC@{\let\arcControls@=\cubicARCcontrols@@ |
| 351 |
\def\arcparam@{2}} |
| 352 |
\xydef@\interpARC@{\let\arcControls@=\cubicARCcontrols@@ |
| 353 |
\def\arcparam@{1.33333}} |
| 354 |
\xydef@\ARCturn@{\xy@@\bgroup\afterCOORD{% |
| 355 |
\xy@@{\edef\next@{\egroup \A@=\the\X@c \B@=\the\Y@c}\next@}\ARCturn@@}} |
| 356 |
\xydef@\ARCturn@@#1@{\DN@{#1}\DNii@{^}% |
| 357 |
\ifx\next@\nextii@ \xy@{^}{\def\arcOrient@@{^}}% |
| 358 |
\else\DNii@{_}\ifx\next@\nextii@ \xy@{_}{\def\arcOrient@@{_}}% |
| 359 |
\else\xy@{}{\def\arcOrient@@{}}\fi\fi |
| 360 |
\xy@@\ARCturn@@@ \processDirections@@ } |
| 361 |
\xydef@\ARCturn@@@{% |
| 362 |
\bgroup\cfromid@{0@p}\X@p=\X@c \Y@p=\Y@c \X@c=\A@ \Y@c=\B@ |
| 363 |
\setupDirection@ \edef\next@{\egroup\count@=\the\Direction}\next@\relax |
| 364 |
\edef\startDirection@@{\the\count@ }% |
| 365 |
\bgroup\cfromid@{0@c}\X@p=\A@ \Y@p=\B@ |
| 366 |
\setupDirection@ \edef\next@{\egroup\count@=\the\Direction}\next@\relax |
| 367 |
\edef\endDirection@@{\the\count@}% |
| 368 |
\ifx\arcOrient@@\empty |
| 369 |
\bgroup\cfromid@{0@p}\X@p=\X@c \Y@p=\Y@c \cfromid@{0@c}% |
| 370 |
\setupDirection@ \edef\next@{\egroup\count@@=\the\Direction}\next@\relax |
| 371 |
\count@=-\count@@ \advance\count@\startDirection@@ \relax \count@=-\count@ |
| 372 |
\ifnum\count@>4096 \def\arcOrient@@{_}% |
| 373 |
\else\ifnum\count@<-4096 \def\arcOrient@@{^}% |
| 374 |
\else\ifnum\count@>\z@ \def\arcOrient@@{^}% |
| 375 |
\else\def\arcOrient@@{_}\fi\fi\fi |
| 376 |
\fi } |
| 377 |
\xydef@\circleArc@{% |
| 378 |
\xy@{circARC@}{\cfromid@{0@p}\pfromc@\cfromp@\startDirection@ |
| 379 |
\arcCenter@\idfromc@{0@0}% |
| 380 |
\def\startDirection@{\bgroup |
| 381 |
\cfromid@{0@0}\pfromc@\cfromid@{0@p}\setupDirection@ |
| 382 |
\edef\next@{\egroup \Direction=\the\Direction}\next@ |
| 383 |
\relax\imposeDirection@}}% |
| 384 |
\ifx\endDirection@@\empty |
| 385 |
\ifx\arcRadius@\empty \ifx\ellipseRatio@\empty\else |
| 386 |
\DN@{\arcScale@@}\ifx\arcScale@\next@\else |
| 387 |
\xy@@{\bgroup\cfromid@{0@0}\pfromc@\cfromid@{0@c}\setupDirection@ |
| 388 |
\edef\next@{\egroup \Direction=\the\Direction}\next@ |
| 389 |
\edef\endDirection@@{\the\Direction}}\fi\fi\fi\fi |
| 390 |
\ellipseArc@ \xy@@{\leave@ \doCircleArcs@}\endarc@ } |
| 391 |
\xydef@\arcbisector{% |
| 392 |
\cfromid@{0@p}\pfromc@\cfromid@{0@c}\setupDirection@ |
| 393 |
\advance\X@c\X@p\divide\X@c\tw@ |
| 394 |
\advance\Y@c\Y@p\divide\Y@c\tw@ \czeroEdge@ \pfromc@ |
| 395 |
\enter@\cplusthec@ \enter@\relax\begingroup |
| 396 |
\aboveDirection@\xydashl@ \vfromslide@i{}@\leave@ } |
| 397 |
\xydef@\arcCenter@{% |
| 398 |
\cfromid@{0@p}\pfromc@\cfromid@{0@m}\setupDirection@ |
| 399 |
\cfromp@\enter@\cplusthec@ \enter@\relax\begingroup |
| 400 |
\aboveDirection@\xydashl@ \vfromslide@i{}@\leave@\no@@ |
| 401 |
\arcCenter@i } |
| 402 |
\xydef@\arcCenter@i{% |
| 403 |
\enter@{\pfromthep@}\setupDirection@ \Creset@@ |
| 404 |
\let\PLACEedgep@@=\PLACEedgep@ \let\PLACEedgec@@=\PLACEedgec@ |
| 405 |
\enter@{\pfromthep@\basefromthebase@}\bgroup |
| 406 |
\arcbisector \edef\next@{\egroup |
| 407 |
\X@c =\the\X@c \Y@c=\the\Y@c \X@p=\the\X@p \Y@p=\the\Y@p }% |
| 408 |
\next@ \Cintercept@@ \leave@\leave@ } |
| 409 |
\xydef@\getarcExtents@{% |
| 410 |
\ifx\space@\next\expandafter\DN@\space{\xyFN@\getarcExtents@}% |
| 411 |
\else\ifx\next @\xy@{@}{}\DN@ @{\fullEllipse@}% |
| 412 |
\else\DN@{\xy@{arcEXTENTs}{\save@ |
| 413 |
\def\startDirection@{\Direction=\startDirection@@ \imposeDirection@}}% |
| 414 |
\xyFN@\getarcExtents@ii}\fi\fi \next@ } |
| 415 |
\xydef@\getarcExtents@ii{% |
| 416 |
\ifx\next!\xy@{![[}{}\DN@![[##1]]{\getxyDirection@{##1}\getarcExtents@iv}% |
| 417 |
\else\DN@{\getarcExtents@iv}\fi \next@ } |
| 418 |
\xydef@\getarcExtents@iv{\afterDIRECTIONorEMPTY |
| 419 |
{\xy@{startDIR}{\edef\startDirection@@{\the\Direction}\leave@}% |
| 420 |
\xyFN@\getarcOrientation@}% |
| 421 |
{\xy@{startDIR}{\edef\startDirection@@{\the\Direction}\leave@}% |
| 422 |
\xyFN@\getarcOrientation@}} |
| 423 |
\xydef@\getarcOrientation@{% |
| 424 |
\ifx\space@\next\expandafter\DN@\space{\xyFN@\getarcOrientation@}% |
| 425 |
\else\ifx\next @\xy@{@}{}\DN@{\getEndDirection@x}% |
| 426 |
\else\ifx\next,\xy@{,}{}\DN@,{\xyFN@\getarcOrientation@i}% |
| 427 |
\else\DN@{\getarcOrientation@i}\fi\fi\fi \next@ }% |
| 428 |
\xydef@\getarcOrientation@i{% |
| 429 |
\ifx\space@\next\expandafter\DN@\space{\xyFN@\getarcOrientation@i}% |
| 430 |
\else\ifx\next @\xy@{@}{}\DN@{\getEndDirection@x}% |
| 431 |
\else\ifx\next^{}\DN@##1{\xy@{^}{\def\arcOrient@@{^}}% |
| 432 |
\def\arcOrient@@{^}\xyFN@\getEndDirection@}% |
| 433 |
\else\ifx\next_\DN@##1{\xy@{_}{\def\arcOrient@@{_}}% |
| 434 |
\def\arcOrient@@{_}\xyFN@\getEndDirection@}% |
| 435 |
\else\DN@{\xyFN@\getEndDirection@}% |
| 436 |
\fi\fi\fi\fi \next@ } |
| 437 |
\xydef@\getEndDirection@{% |
| 438 |
\ifx\space@\next\expandafter\DN@\space{\xyFN@\getEndDirection@}% |
| 439 |
\else\ifx\next,\DN@,{\xy@{,}{}\xyFN@\getEndDirection@}% |
| 440 |
\else\addEQ@\ifx\next\addEQ@\DN@{\xy@{=}{\save@\startDirection@}% |
| 441 |
\xyFN@\getEqDirection@}% |
| 442 |
\else \ifx\next!\DN@![[##1]]{\xy@{![[}{\save@}\getxyDirection@{##1}% |
| 443 |
\xy@{endDIR}{\edef\endDirection@@{\the\Direction}}% |
| 444 |
\xyFN@\getEndDirection@i}% |
| 445 |
\else \DN@{\xy@{origDIR}{\save@\origDirection@}\getEndDirection@i}% |
| 446 |
\fi\fi\fi\fi \next@ } |
| 447 |
\xydef@\getEqDirection@{% |
| 448 |
\ifx\space@\next\expandafter\DN@\space{\xyFN@\getEqDirection@}% |
| 449 |
\else\ifx\next @\xy@{@}{}\DN@ @{% |
| 450 |
\xy@{sameDIR}{\edef\endDirection@@{\startDirection@@}\leave@}% |
| 451 |
\parEllipse@{1}{}}% |
| 452 |
\else\ifx\next (\DN@({\xyFN@\checkEqOpen@}% |
| 453 |
\else \DN@{\getEndDirection@i}\fi\fi\fi \next@ } |
| 454 |
\xydef@\checkEqOpen@{% |
| 455 |
\ifx\next *\DN@{\getEndDirection@i (}% |
| 456 |
\else \DN@##1)##2@{\xy@{()}\leave@ \parEllipse@{##1}{##2}}% |
| 457 |
\fi \next@ } |
| 458 |
\xydef@\getEndDirection@i{\afterDIRECTIONorEMPTY |
| 459 |
{\xy@{endDIR}{\edef\endDirection@@{\the\Direction}\leave@}% |
| 460 |
\getEndDirection@x }% |
| 461 |
{\xy@{endDIR}\leave@ \getEndDirection@x }} |
| 462 |
\xydef@\getEndDirection@x#1@{% |
| 463 |
\DN@{#1}\ifx\next@\empty\relax \else\xywarning@{\omittingTokens@}\fi |
| 464 |
\processDirections@ } |
| 465 |
\xydef@\omittingTokens@{omitting unused tokens: \codeof\next@ } |
| 466 |
\xydef@\processDirections@@{% |
| 467 |
\ifx\endDirection@@\empty \skewCircle@ |
| 468 |
\else \skewEllipse@ \expandafter \afterARCextents@@ \fi } |
| 469 |
\xydef@\processArcDirections@{% |
| 470 |
\xy@{ARCdirs}{\ifx\endDirection@@\empty |
| 471 |
\origDirection@ \edef\endDirection@@{\the\Direction}\fi}% |
| 472 |
\ellipseArc@ |
| 473 |
\xy@{procARCdirs}\processArcDirections@@ |
| 474 |
\let\arcScale@\ellsave@ \let\arcRadius@\ellsave@ \def\ellipseRatio@{}% |
| 475 |
\xy@{circSECTORS}{\doCircleSectors@}\endarc@ } |
| 476 |
\xydef@\ellsave@{\xy@@{\save@}} |
| 477 |
\xydef@\processArcDirections@@{\save@ |
| 478 |
\bgroup \cfromid@{0@0}\pfromc@ \Direction=\startDirection@@ |
| 479 |
\DN@{_}\ifx\next@\arcOrient@@ |
| 480 |
\advance\Direction \ifnum\Direction<\z@-\fi 4096 \relax\fi |
| 481 |
\imposeDirection@ |
| 482 |
\d@X=\cosDirection\Y@ybase \advance\d@X-\sinDirection\X@ybase |
| 483 |
\d@Y=-\cosDirection\Y@xbase \advance\d@Y\sinDirection\X@xbase |
| 484 |
\setupDirection@i |
| 485 |
\d@X=-\cosDirection\X@ybase \advance\d@X\sinDirection\X@xbase |
| 486 |
\d@Y=-\cosDirection\Y@ybase \advance\d@Y\sinDirection\Y@xbase |
| 487 |
\enter@\cplusthec@\X@c=\d@X \Y@c=\d@Y \leave@ \czeroEdge@ |
| 488 |
\setupDirection@i |
| 489 |
\czeroEdge@ |
| 490 |
\edef\next@{\egroup \cfromthec@ \count@=\the\Direction}\next@ |
| 491 |
\edef\startDirection@@{\the\count@}\idfromc@{0@x}% |
| 492 |
\bgroup \cfromid@{0@0}\pfromc@ \Direction=\endDirection@@ |
| 493 |
\DN@{_}\ifx\next@\arcOrient@@ |
| 494 |
\advance\Direction \ifnum\Direction<\z@-\fi 4096 \relax\fi |
| 495 |
\imposeDirection@ |
| 496 |
\d@X=\cosDirection\Y@ybase \advance\d@X-\sinDirection\X@ybase |
| 497 |
\d@Y=-\cosDirection\Y@xbase \advance\d@Y\sinDirection\X@xbase |
| 498 |
\setupDirection@i |
| 499 |
\d@X=-\cosDirection\X@ybase \advance\d@X\sinDirection\X@xbase |
| 500 |
\d@Y=-\cosDirection\Y@ybase \advance\d@Y\sinDirection\Y@xbase |
| 501 |
\enter@\cplusthec@\X@c=\d@X \Y@c=\d@Y \leave@ |
| 502 |
\czeroEdge@ |
| 503 |
\setupDirection@i |
| 504 |
\edef\next@{\egroup \cfromthec@ \count@=\the\Direction}\next@ |
| 505 |
\edef\endDirection@@{\the\count@}\idfromc@{0@c}% |
| 506 |
\count@=\startDirection@@ \relax \count@@=\endDirection@@ \relax |
| 507 |
\DN@{^}\ifx\arcOrient@@\next@ |
| 508 |
\ifnum\count@@>\count@ \else\advance\count@@ 8192 \relax\fi |
| 509 |
\else |
| 510 |
\ifnum\count@@<\count@ \else\advance\count@@-8192 \relax\fi\fi |
| 511 |
\edef\startDirection@@{\the\count@}% |
| 512 |
\edef\endDirection@@{\the\count@@}}% |
| 513 |
\xydef@\doCircleSectors@{% |
| 514 |
\let\doCircleArc@=\doMergeEndArc@@ \leave@ \leave@ |
| 515 |
\cfromid@{0@0}\pfromc@\cfromid@{0@p}\setupDirection@ |
| 516 |
\count@=\Direction \DN@{^}\ifx\arcOrient@@\next@ |
| 517 |
\ifnum\count@>\startDirection@@ \advance\count@-8192 \fi\relax |
| 518 |
\count@@=\count@ \advance\count@@ 8192 \relax |
| 519 |
\ifnum\count@@<\endDirection@@ \advance\count@@ 8192 \fi\relax |
| 520 |
\else |
| 521 |
\ifnum\count@<\startDirection@@ \advance\count@ 8192 \fi\relax |
| 522 |
\count@@=\count@ \advance\count@@-8192 \relax |
| 523 |
\ifnum\count@@>\endDirection@@ \advance\count@@-8192 \fi\relax |
| 524 |
\fi \relax |
| 525 |
\edef\preDirection@@{\the\count@}\edef\postDirection@@{\the\count@@}% |
| 526 |
\cfromid@{1@c}\setupDirection@ \count@=\Direction |
| 527 |
\def\nextii@{^}\ifx\nextii@\arcOrient@@ |
| 528 |
\DN@{\forwardSectors@\doEllipseSectors@}% |
| 529 |
\ifnum\count@<\preDirection@@ \advance\count@ 8192 \relax |
| 530 |
\else \count@@=\count@\advance\count@-8192 \relax |
| 531 |
\ifnum\count@@<\preDirection@@ \else\count@=\count@@ \fi\fi |
| 532 |
\else |
| 533 |
\DN@{\backwardSectors@\doEllipseSectors@}% |
| 534 |
\ifnum\count@>\preDirection@@ \advance\count@-8192 \relax |
| 535 |
\else \count@@=\count@\advance\count@ 8192 \relax |
| 536 |
\ifnum\count@@>\preDirection@@ \else\count@=\count@@ \fi\fi |
| 537 |
\fi \edef\quadDirection@{\the\count@}% |
| 538 |
\next@ } |
| 539 |
\xydef@\forwardSectors@{% |
| 540 |
\ifnum \startDirection@@<\quadDirection@ \def\startSector@@{0}% |
| 541 |
\else\count@=\preDirection@@ \advance\count@ 4096 \relax |
| 542 |
\ifnum \startDirection@@<\count@ \def\startSector@@{1}% |
| 543 |
\else\count@=\quadDirection@ \advance\count@ 4096 \relax |
| 544 |
\ifnum\startDirection@@<\count@ \def\startSector@@{2}% |
| 545 |
\else \def\startSector@@{3}\fi\fi\fi |
| 546 |
\ifnum\quadDirection@ <\endDirection@@ \relax |
| 547 |
\count@=\preDirection@@ \advance\count@ 4096 \relax |
| 548 |
\ifnum\count@<\endDirection@@ \relax |
| 549 |
\count@=\quadDirection@ \advance\count@ 4096 \relax |
| 550 |
\ifnum\count@<\endDirection@@ \relax |
| 551 |
\count@=\preDirection@@ \advance\count@ 8192 \relax |
| 552 |
\ifnum\count@<\endDirection@@ \relax |
| 553 |
\count@=\quadDirection@ \advance\count@ 8192 \relax |
| 554 |
\ifnum\count@<\endDirection@@ \relax |
| 555 |
\count@=\preDirection@@ \advance\count@ 12288 \relax |
| 556 |
\ifnum\count@<\endDirection@@ \relax |
| 557 |
\count@=\quadDirection@ \advance\count@ 12288 \relax |
| 558 |
\ifnum\count@<\endDirection@@ \def\endSector@@{7}% |
| 559 |
\else \def\endSector@@{6}\fi |
| 560 |
\else \def\endSector@@{5}\fi |
| 561 |
\else \def\endSector@@{4}\fi |
| 562 |
\else \def\endSector@@{3}\fi |
| 563 |
\else \def\endSector@@{2}\fi |
| 564 |
\else \def\endSector@@{1}\fi |
| 565 |
\else \def\endSector@@{0}\fi } |
| 566 |
\xydef@\backwardSectors@{% |
| 567 |
\ifnum \startDirection@@>\quadDirection@ \def\startSector@@{0}% |
| 568 |
\else\count@=\preDirection@@ \advance\count@-4096 \relax |
| 569 |
\ifnum \startDirection@@>\count@ \def\startSector@@{1}% |
| 570 |
\else\count@=\quadDirection@ \advance\count@-4096 \relax |
| 571 |
\ifnum\startDirection@@>\count@ \def\startSector@@{2}% |
| 572 |
\else \def\startSector@@{3}\fi\fi\fi |
| 573 |
\ifnum\quadDirection@>\endDirection@@ \relax |
| 574 |
\count@=\preDirection@@ \advance\count@-4096 \relax |
| 575 |
\ifnum\count@>\endDirection@@ \relax |
| 576 |
\count@=\quadDirection@ \advance\count@-4096 \relax |
| 577 |
\ifnum\count@>\endDirection@@ \relax |
| 578 |
\count@=\preDirection@@ \advance\count@-8192 \relax |
| 579 |
\ifnum\count@>\endDirection@@ \relax |
| 580 |
\count@=\quadDirection@ \advance\count@-8192 \relax |
| 581 |
\ifnum\count@>\endDirection@@ \relax |
| 582 |
\count@=\preDirection@@ \advance\count@-12288 \relax |
| 583 |
\ifnum\count@>\endDirection@@ \relax |
| 584 |
\count@=\quadDirection@ \advance\count@-12288 \relax |
| 585 |
\ifnum\count@>\endDirection@@ \def\endSector@@{7}% |
| 586 |
\else \def\endSector@@{6}\fi |
| 587 |
\else \def\endSector@@{5}\fi |
| 588 |
\else \def\endSector@@{4}\fi |
| 589 |
\else \def\endSector@@{3}\fi |
| 590 |
\else \def\endSector@@{2}\fi |
| 591 |
\else \def\endSector@@{1}\fi |
| 592 |
\else \def\endSector@@{0}\fi } |
| 593 |
\xydef@\doEllipseSectors@{% |
| 594 |
\ifx\startSector@@\endSector@@ |
| 595 |
\DN@{\expandafter\doMergeBothArc@\expandafter{\arcSTYLE}{\endSector@@}}% |
| 596 |
\else |
| 597 |
\expandafter\doMergeStartArc@\expandafter{\arcSTYLE}{\startSector@@}% |
| 598 |
\edef\countArcs@@{\startSector@@}% |
| 599 |
\loop@ \count@=\countArcs@@ \relax \advance\count@\@ne |
| 600 |
\ifnum \count@ < \endSector@@ \edef\countArcs@@{\the\count@}% |
| 601 |
\bgroup\expandafter\doCircleArc@@\expandafter{\arcSTYLE}{\countArcs@@}% |
| 602 |
\egroup |
| 603 |
\repeat@ |
| 604 |
\DN@{\expandafter\doMergeEndArc@\expandafter{\arcSTYLE}{\endSector@@}}% |
| 605 |
\fi \next@ } |
| 606 |
\xydef@\checkstartDirection@{% |
| 607 |
\bgroup\no@@ \edef\next@{\egroup\count@@=\the\Direction}\next@\relax |
| 608 |
\ifnum\count@@=\startDirection@@ \relax \DN@{\straightArc@}% |
| 609 |
\else \advance\count@@-\startDirection@@ \relax |
| 610 |
\ifnum\count@@=\ifnum\count@@<\z@-\fi 4096 \relax \DN@{\straightArc@}% |
| 611 |
\else \DN@{\processDirections@@}\fi\fi \next@ } |
| 612 |
\xydef@\straightArc@{\xywarning@{straight arc encountered}% |
| 613 |
\xy@@{\let\bstartPLACE@=\relax |
| 614 |
\expandafter\doStraightArc@@\expandafter{\arcSTYLE}}\endarc@ }% |
| 615 |
\xydef@\skewEllipse@{\xy@@{\doskewEllipse@}% |
| 616 |
\def\afterARCextents@@{\xy@{aftARCext}{\let\doCircleArc@=\doMergeEndArc@@}% |
| 617 |
\ellipseArc@ \xy@{doCircARCs}{\doCircleArcs@}\endarc@ }% |
| 618 |
\let\arcScale@=\relax \def\arcRadius@{}\def\ellipseRatio@{}} |
| 619 |
\xydef@\skewCircle@{\xy@@{\setupDirection@}% |
| 620 |
\ifnum\Direction=\startDirection@@\relax\DN@{\halfEllipse@{1}}% |
| 621 |
\else |
| 622 |
\xy@@{\def\startDirection@{\Direction=\startDirection@@\imposeDirection@}% |
| 623 |
\cfromid@{0@p}\enter@\cplusthec@ \startDirection@ |
| 624 |
\enter@\relax\begingroup\vfromslide@i{}@\czeroEdge@\leave@\idfromc@{0@m}% |
| 625 |
\let\endDirection@=\relax \let\doCircleArc@=\doMergeEndArc@@}% |
| 626 |
\DN@{\circleArc@}% |
| 627 |
\fi \next@ } |
| 628 |
\xydef@\doskewEllipse@{% |
| 629 |
\def\startDirection@{\Direction=\startDirection@@ \relax |
| 630 |
\imposeDirection@}\startDirection@ \cfromid@{0@p}% |
| 631 |
\enter@\cplusthec@ \enter@\relax\begingroup\vfromslide@i{}@\leave@ |
| 632 |
\idfromc@{0@x}% |
| 633 |
\ifx\endDirection@@\empty \parallelDirection@ |
| 634 |
\else |
| 635 |
\def\endDirection@{\Direction=\endDirection@@ \relax |
| 636 |
\imposeDirection@ }\endDirection@ \skewEllB@ |
| 637 |
\bgroup\setupDirection@\edef\next@{\egroup\count@@=\the\Direction}\next@ |
| 638 |
\edef\endDirection@@{\the\count@@}% |
| 639 |
\fi |
| 640 |
\cfromid@{0@p}\bgroup \setupDirection@ |
| 641 |
\edef\next@{\egroup \count@@=\the\Direction}\next@ |
| 642 |
\edef\startDirection@@{\the\count@@}} |
| 643 |
\xydef@\halfEllipse@#1{\xy@@{% |
| 644 |
\cfromid@{0@p}\pfromc@\cfromid@{0@c}\no@@ |
| 645 |
\edef\endDirection@@{\the\Direction}% |
| 646 |
\advance\X@c\X@p \divide\X@c\tw@ \advance\Y@c\Y@p \divide\Y@c\tw@ |
| 647 |
\idfromc@{0@0}\pfromc@ \cfromid@{0@p}\setbase@\X@p\Y@p\X@c\Y@c |
| 648 |
\dimen@=\X@origin \advance\dimen@-\X@c \dimen@ii=\cosDirection\dimen@ |
| 649 |
\dimen@=\Y@origin \advance\dimen@-\Y@c \advance\dimen@ii \sinDirection\dimen@ |
| 650 |
\X@c=\X@origin \Y@c=\Y@origin \enter@\cplusthec@ |
| 651 |
\dimen@=#1\p@ \ifdim\dimen@<\z@ \DN@{^}\dimen@ii=-#1\dimen@ii |
| 652 |
\ifx\next@\arcOrient@@\def\arcOrient@@{_}\else\def\arcOrient@@{^}\fi |
| 653 |
\else \dimen@ii=#1\dimen@ii\fi |
| 654 |
\startDirection@ \enter@\relax\begingroup\expandafter |
| 655 |
\vfromslide@i\expandafter{\the\dimen@ii}@\leave@ |
| 656 |
\idfromc@{1@c}\setbase@@ \X@c \Y@c \adjustBaseOrient@ |
| 657 |
\count@@=\endDirection@@ \relax |
| 658 |
\DN@{^}\advance\count@@\ifx\arcOrient@@\next@\else-\fi 4096 \relax |
| 659 |
\edef\startDirection@@{\the\count@@}% |
| 660 |
\def\startDirection@{\Direction=\startDirection@@ \imposeDirection@ }% |
| 661 |
\let\doCircleArc@=\doMergeEndArc@@ }% |
| 662 |
\let\arcScale@=\relax \ellipseArc@ |
| 663 |
\xy@@{\doCircleArcs@}\endarc@ } |
| 664 |
\xydef@\parallelDirection@{\show\parallelDirection@}% |
| 665 |
\xydef@\parEllipse@#1#2{\DN@{#2}\ifx\next@\empty |
| 666 |
\else\xywarning@{\omittingTokens@ }\fi \halfEllipse@{#1}} |
| 667 |
\xydef@\skewEllB@{\cfromid@{0@c}\pfromc@\enter@\cplusthec@ |
| 668 |
\enter@\relax\begingroup\vfromslide@i{}@\leave@ |
| 669 |
\enter@{\pfromthep@\basefromthebase@}\no@@ |
| 670 |
\bgroup \cfromid@{0@p}\pfromc@\cfromid@{0@x}\edef\next@{\egroup |
| 671 |
\X@c =\the\X@c \Y@c=\the\Y@c \X@p=\the\X@p \Y@p=\the\Y@p }\next@ |
| 672 |
\Cintercept@@\leave@ \idfromc@{0@x}\cfromid@{0@p}\enter@\cplusthec@ |
| 673 |
\cfromid@{0@c}\leave@ \enter@\cplusthec@ \cfromid@{0@x}% |
| 674 |
\X@c=-\X@c \Y@c=-\Y@c \leave@ \idfromc@{0@0}\pfromc@\cfromid@{0@p}% |
| 675 |
\setbase@\X@p\Y@p\X@c\Y@c \cfromid@{0@c}\setbase@@\X@c\Y@c |
| 676 |
\adjustBaseOrient@ } |
| 677 |
\xydef@\adjustBaseOrient@{% |
| 678 |
\edef\tmp@{\expandafter\removePT@\the\X@xbase}\dimen@=\Y@ybase |
| 679 |
\divide\dimen@ 64 \relax \dimen@ii=\tmp@\dimen@ |
| 680 |
\edef\tmp@{\expandafter\removePT@\the\X@ybase}\dimen@=\Y@xbase |
| 681 |
\divide\dimen@ 64 \relax \dimen@=\tmp@\dimen@ |
| 682 |
\ifdim\dimen@>\dimen@ii \X@ybase=-\X@ybase \Y@ybase=-\Y@ybase \fi } |
| 683 |
\xyendinput |