Source PostScript (dinamometro.pps)

Retour Texte non formaté
%%Luis A. V. Ferreira %%luisav.ferreira@netcabo.pt %%luisav.ferreira@gmail.com %%23DEZ2006 %%GNU General Public License /dinamometro_dic 5 dict def /dinamometro_dim { 1 dict begin 3 copy pop pop /ell exch 6 min def -2.5 ell neg jtoppoint 2.5 23.5 jtoppoint end } def /dinamometro { %%Luís A. V. Ferreira %%luisav.ferreira@netcabo.pt %%luisav.ferreira@gmail.com %%23DEZ2006 %%GNU General Public License 30 dict begin gsave currentpoint translate -6.5 -1 stranslate /ell exch 6 min def %% longueur d'elongation dinamometro_dic /aiguille [ 0 13 ell sub ] cvx put %% elementos - pontos /a { 4 6 } def %segmento de recta: ponto a /b { 9 6 } def %segmento de recta: ponto b /c { 4 20 } def %segmento de recta: ponto c /d { 9 20 } def %segmento de recta: ponto d /e { 6.5 17.5} def %arco superior: ponto e /f { 6.5 8.5} def %arco superior: ponto f /g { 6.25 8 } def %segmento de recta: ponto g /h { 6.75 8 } def %segmento de recta: ponto h /i { 6.75 18 } def %segmento de recta: ponto i /j { 6.25 18 } def %segmento de recta: ponto j %%valores /A {5.5} def /E {6.0} def /B {8.2} def /C {17.8} def /D {C B sub} def %% calculos /comp01 {2.5 2 exp 2 mul sqrt} def %comprimento 01 %%corpo do dinamometro 0.75 setlinewidth [a c] ligne [b d] ligne 45 135 e comp01 Cercle 225 315 f comp01 Cercle %%ranhura do dinamometro 0.5 setlinewidth [g h i j] polygone %%tracejado da escala 0.2 setlinewidth [A B E B] polygone /var_i 1 def /N 20 def N { /var_B {D N div var_i mul B add} def [A var_B E var_B] polygone /var_i var_i 1 add store } repeat %%ponteiro 2 setlinewidth [6 14 ell sub 7 14 ell sub] polygone %%argola superior gris 4 setlinewidth /p1 {17.5 comp01 add} def /p2 {6.5 p1} def /p3 {17.5 comp01 add 1 add} def /p4 {6.5 p3} def [p2 p4] polygone /p1 {17.5 comp01 add 2 add} def /p2 {6.5 p1} def p2 1.5 cercle %%gancho inferior 2 setlinecap /p1 {8.5 comp01 sub} def /p2 {6.5 p1} def %% attache du crochet inferieur au corps %% gsave bleu p2 plus3 grestore /p3 {8.5 comp01 sub 1 sub} def /p4 {6.5 p3 ell sub} def %% attache du crochet inferieur [p2 p4] polygone /p1 {8.5 comp01 sub 2.5 sub} def /p2 {6.5 p1 ell sub} def %% centre du crochet inferieur 90 -180 p2 1.5 Cercle grestore end } def