Retour

Source de protrace.tex

Fichier TeX
Image PNG
%@AUTEUR: Thomas Söll
%@DATE: 4 octobre 2012
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[frenchstyle]{kpfonts}
\usepackage{pstricks}
%\usepackage[distiller]{pstricks}
\usepackage{multido}
\def\protrace{%
\psset{unit=1.5,dimen=middle}
\SpecialCoor
%
\scriptsize
\begin{psclip}%
{\pspolygon[linestyle=none,linewidth=0pt,fillstyle=solid,fillcolor=white,opacity=0.3](-4.675,0.125)(4.675,0.125)(0,4.8)}%
\pspolygon[linewidth=0pt,fillstyle=solid,fillcolor=lightgray!30,linestyle=none,opacity=0.4](-5,0)(5,0)(0,5)%
\end{psclip}%
\begin{psclip}%
{\pspolygon[linestyle=none](5,0)(4.85,0)(-0.15,5)(0,5)}%
\multido{\n=1+1}{89}{%
\rput[l]{\n}(!\n\space dup sin exch cos div dup 1 add 5 exch div exch 1 index mul)%
{\psline[linewidth=.25\pslinewidth](0,0)(-.2,0)}%
}%
\end{psclip}%
\begin{psclip}%
{\pspolygon[linestyle=none](-5,0)(-4.85,0)(0.15,5)(0,5)}%
\multido{\n=1+1}{89}{%
\rput[l]{-\n}(!\n\space dup sin exch cos div dup 1 add 5 exch div neg exch 1 index mul neg)%
{\psline[linewidth=.25\pslinewidth](0,0)(.2,0)}%
}%
\end{psclip}%
\multido{\n=5+10}{9}{%
\rput[l]{\n}(!\n\space dup sin exch cos div dup 1 add 5 exch div exch 1 index mul)%
{\psline[linewidth=.5\pslinewidth](0,0)(-.4,0)}%
\rput[l]{-\n}(!\n\space dup sin exch cos div dup 1 add 5 exch div neg exch 1 index mul neg)%
{\psline[linewidth=.5\pslinewidth](0,0)(.4,0)}%
}%
\multido{\n=10+10}{8}{%
\psline(3.15;\n)(!\n\space dup sin exch cos div dup 1 add 5 exch div exch 1 index mul)%
\psline(-3.15;-\n)(!\n\space dup sin exch cos div dup 1 add 5 exch div neg exch 1 index mul neg)%
}%
\multido{\n=6+1}{84}{%
\psline[linewidth=.5\pslinewidth](-2.77;-\n)(-2.7;-\n)%
\psline[linewidth=.5\pslinewidth](2.77;\n)(2.7;\n)%
}%
\multido{\n=5+5}{17}{%
\psline(2.81;\n)(2.7;\n)%
\psline(-2.81;-\n)(-2.7;-\n)%
}
\psline[linestyle=dashed,dash=7pt 4pt](-2.6;-45)(-.5;-45)%
\psline[linestyle=dashed,dash=7pt 4pt](2.6;45)(.5;45)%
%
\pscustom[fillstyle=solid,fillcolor=yellow,linestyle=none,opacity=0.6]{%
\psarc(0,0){2.85}{7}{173}%
\psarcn(0,0){3.15}{173}{7}%
}%
{\multido{\n=10+10}{17}{\rput{0}(3;\n){\n}}}%
\multido{\n=0+1}{8}{\rput{180}(!\n\space 0.625 mul 0.25){\n}}%
\multido{\n=1+1}{7}{\rput{180}(!\n\space 0.625 mul neg 0.25){\n}}%
\multido{\n=-70+1}{141}{\rput{180}(!\n\space 0.0625 mul neg 0){\psline[linewidth=0.5\pslinewidth](0,0)(0,-0.08)}}%
\multido{\n=-14+1}{29}{\rput{180}(!\n\space 0.3125 mul neg 0){\psline(0,0)(0,-0.13)}}%
%
\multido{\n=3+1}{30}{\rput{180}(!0 \n\space 0.0625 mul 0.03 add){%
\psline[linewidth=0.5\pslinewidth](-1.625,0)(-1.5,0)%
\psline[linewidth=0.5\pslinewidth](1.625,0)(1.5,0)%
}}%
%
\begin{psclip}%
{\pscircle[linestyle=none](0,0){2.6}}%
\multido{\n=1+1}{7}{\rput{180}(!0 \n\space 0.3125 mul 0.03 add){%
\psline(-2.6,0)(-1.69,0)%
\psline(2.6,0)(1.69,0)%
\psline(1.625,0)(1.4375,0)%
\psline(-1.625,0)(-1.4375,0)%
\psline(1.1875,0)(0.15,0)%
\psline(-1.1875,0)(-0.15,0)%
}}%
\multido{\n=1+1}{3}{%
\rput{180}(!1.3 \n\space 0.625 mul 0.03 add){\n}%
\rput{180}(!-1.3 \n\space 0.625 mul 0.03 add){\n}%
}%
\end{psclip}%
%
\psline(0.4;90)(2.85;90)%
\psline(3.15;90)(5;90)%
\pspolygon(5,0)(0,5)(-5,0)%
}
 
\pagestyle{empty}
\begin{document}
\begin{center}
\begin{pspicture}(-5,0)(5,5)
\protrace
\end{pspicture}
\end{center}
 
\begin{center}
\begin{pspicture}(-5,0)(5,8)
\rput{30}(0,0){\psscalebox{0.6}{%
\protrace%
}}%
\end{pspicture}
\end{center}
 
\end{document}