summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-11-16 19:53:23 +0000
committerKarl Berry <karl@freefriends.org>2009-11-16 19:53:23 +0000
commita4d8f696b0807d001fa89b52b59552a669709a69 (patch)
tree461f99c441dd2bdf1aa58be15c6956a15754245d /Master/texmf-dist/tex/generic
parentc3c4375bcba41f1430e538b13b1a11300a1a1a5f (diff)
pst-knot update
git-svn-id: svn://tug.org/texlive/trunk@16033 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic')
-rw-r--r--Master/texmf-dist/tex/generic/pst-knot/pst-knot.tex66
1 files changed, 56 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/generic/pst-knot/pst-knot.tex b/Master/texmf-dist/tex/generic/pst-knot/pst-knot.tex
index ea222af4b4c..bf8a8d8ffd4 100644
--- a/Master/texmf-dist/tex/generic/pst-knot/pst-knot.tex
+++ b/Master/texmf-dist/tex/generic/pst-knot/pst-knot.tex
@@ -25,35 +25,81 @@
% interface to the `xkeyval' package
\pst@addfams{pst-knot}
-\def\fileversion{0.01}
-\def\filedate{2009/11/07}
+\def\fileversion{0.02}
+\def\filedate{2009/11/08}
\message{`PST-knot' v\fileversion, \filedate\space (hv)}
%
\SpecialCoor
\pstheader{pst-psm.pro}
%
-\define@key[psset]{pst-knot}{knotborder}[2]{\def\psk@knot@border{#1 }}
-\define@key[psset]{pst-knot}{knotbgcolor}[1]{\def\psk@knot@bgcolor{#1 }}
+\newdimen\psk@knot@border
+\define@key[psset]{pst-knot}{knotborder}[2]{\pssetlength\psk@knot@border{#1}}
+\define@key[psset]{pst-knot}{knotbgcolor}[1]{\pst@getcolor{#1}\psk@knot@bgcolor}
\define@key[psset]{pst-knot}{knotscale}[1 1]{\pst@getscale{#1}\psk@knot@scale}
-\psset[pst-knot]{knotborder=2,knotbgcolor=1,knotscale=1}
+\psset[pst-knot]{knotborder=5\pslinewidth,knotbgcolor=white,knotscale=1}
%
\def\psKnot{\def\pst@par{}\pst@object{psKnot}}
\def\psKnot@i(#1)#2{\expandafter\psKnot@ii(#1)#2}
\def\psKnot@ii(#1)#2-#3{%
\addto@par{border=.5\pslinewidth}%
\begin@ClosedObj%
+ \pst@getcolor{\pslinecolor}\psk@linecolor%
\pst@getcoor{#1}\pst@tempA%
\addto@pscode{
\pst@tempA\space moveto
tx@KnotDict begin
PSMinit
- /rgb {} def /gray {} def /cmyk {} def
- \pst@number\pslinewidth SLW
- \pst@usecolor\pslinecolor
\psk@knot@scale
- /knot-bgline { CLW \psk@knot@border mul SLW } def
- /knot-bgcolour \psk@knot@bgcolor def
+ \pst@number\pslinewidth SLW
+ \pst@usecolor\psk@linecolor
+ /knot-bgline { CLW \pst@number\psk@knot@border add SLW } def
+ /knot-bgcolour { \pst@usecolor\psk@knot@bgcolor } def
knot-#2-#3 \ifnum#2=0 \else knot \fi
+ PSMclose
+ end
+ }%
+ \end@ClosedObj}
+%
+\define@key[psset]{pst-knot}{bmcolor}{\expandafter\pst@borromean@color#1,\@nil}
+\def\pst@borromean@color#1,#2,#3,\@nil{%
+ \pst@getcolor{#1}\psk@borromean@colorA%
+ \pst@getcolor{#2}\psk@borromean@colorB%
+ \pst@getcolor{#3}\psk@borromean@colorC%
+}
+\psset[pst-knot]{bmcolor={red,green,blue}}
+%
+\def\psBorromean{\def\pst@par{}\pst@object{psBorromean}}
+\def\psBorromean@i(#1)#2#3{%
+% \addbefore@par{knotborder=3}%
+ \begin@ClosedObj%
+ \pst@getcoor{#1}\pst@tempA%
+ \pst@getcolor{\pslinecolor}\psk@linecolor%
+ \pssetlength\pst@dima{#2}%
+ \pssetlength\pst@dimb{#3}%
+ \addto@pscode{
+ tx@KnotDict begin
+ PSMinit
+ \pst@tempA\space translate
+ \psk@knot@scale
+ /rgb {} def /gray {} def /cmyk {} def
+ \pst@number\pslinewidth SLW
+ \pst@usecolor\psk@linecolor
+ /r \pst@number\pst@dima def % circle radius
+ /R \pst@number\pst@dimb def % inner circle radius
+ /c1 [R 90] p2r def
+ /c2 [R 210] p2r def
+ /c3 [R 330] p2r def
+ /knot-bgline { CLW \pst@number\psk@knot@border add SLW } def
+ /knot-bgcolour {\pst@usecolor\psk@knot@bgcolor} def
+ /stroke-shaded {
+ gsave knot-bgline knot-bgcolour stroke grestore stroke
+ } def
+ c1 r circle \pst@usecolor\psk@borromean@colorA stroke
+ c2 r circle \pst@usecolor\psk@borromean@colorB stroke-shaded
+ c3 r circle \pst@usecolor\psk@borromean@colorC stroke-shaded
+ c1 r -30 30 arc \pst@usecolor\psk@borromean@colorA stroke-shaded
+ c1 r -150 -90 arc stroke-shaded
+ PSMclose
end
}%
\end@ClosedObj}