summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/pstricks-examples-en/36-00-16.ltx
blob: 6f526cd9dfd89bf90f8e90fc76e6a1558a6a4af6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
%% 
%%  A DANTE-Edition example
%% 
%%  Example 36-00-16 on page 775.
%% 
%%  Copyright (C) 2011 Herbert Voss
%% 
%%  It may be distributed and/or modified under the conditions
%%  of the LaTeX Project Public License, either version 1.3
%%  of this license or (at your option) any later version.
%% 
%%  See http://www.latex-project.org/lppl.txt for details.
%% 
%% 
%% ==== 
% Show page(s) 1
%% 
\documentclass[]{article}
\pagestyle{empty}
\setlength\textwidth{201.70511pt}
\setlength\parindent{0pt}

\usepackage[dvipsnames]{pstricks}
\usepackage{pst-labo,pst-grad,multido}
\SpecialCoor
\definecolor{Bluea}{cmyk}{.2,0,0,0}
\definecolor{MonGris}{rgb}{0.9,0.9,0.9}
\definecolor{Indigo}{cmyk}{0.07,0.90,0,0.34}
\definecolor{Violet}{cmyk}{0.79,0.88,0,0}
\definecolor{BleuVerre}{cmyk}{0.2,0,0,0}
\definecolor{Brown}{cmyk}{0,0.81,1,0.60}
\definecolor{Salmon}{cmyk}{0,0.53,0.38,0}
\newpsstyle{ChampagneSurface}{linecolor=gray,linewidth=2pt,fillstyle=solid,fillcolor=Beige}
\def\manometre{%
  \rput(0,0){%
    \psline[doubleline=true,doublesep=0.12,linearc=0.2](0,0)(2,0)(2,-2)
    \pscircle[doubleline=true,fillstyle=solid](0,0){0.9}
    \psarc(0,0){0.65}{-60}{240}
    \multido{\i=-60+30}{11}{\psline(0.65;\i)(0.45;\i)}
    \psline[arrowscale=2,linewidth=2\pslinewidth]{->}(0.5;-20)(0.65;160)
    \pscircle[fillstyle=solid]{0.1}%
  }%
}
\def\Bouchon{%
  \psellipse[linewidth=1.5\pslinewidth](0,0.2)(0.6,0.1)
  \begingroup
    \psset{fillstyle=solid,fillcolor=lightgray}
    \psellipse(0,-0.4)(0.32,0.1)
    \pspolygon(-0.5,0.5)(-0.32,-0.4)(0.32,-0.4)(0.5,0.5)
    \psellipse[linestyle=none,dimen=outer,linewidth=0.07](0,-0.4)(0.32,0.1)
    \psellipse(0,0.5)(0.5,0.1)
  \endgroup
  \psellipticarc[linewidth=1.5\pslinewidth](0,0.2)(0.6,0.1){180}{0}
  \psline[doubleline=true,doublesep=0.12,doublecolor=white](-0.2,0.5)(-0.2,0.6)
  \psline[doubleline=true,dimen=outer,doublesep=0.05,doublecolor=red](0.2,0.5)(0.2,1)%
}
\newcommand\erlen{%
  \begin{psclip}{%
    \pspolygon[linestyle=none,linearc=0.2](-0.6,3.2)(-0.4,3)(-0.4,2)(-1.2,0)(1.2,0)(0.4,2)%
            (0.4,3)(0.6,3.2)}
    \psclip{\pscustom[linecolor=cyan,fillstyle=solid,fillcolor=Bluea]{%
      \pscurve(-2,0.9)(-1.75,1)(-1.5,0.9)(-1.25,1)(-1,0.9)
              (-0.75,1)(-0.5,0.9)(-0.25,1)(0,0.9)
              (0.25,1)(0.5,0.9)(0.75,1)(1,0.9)
              (1.25,1)(1.5,0.9)(1.75,1)(2,0.9)
      \psline(2,0.9)(2,-1)(-2,-1)(-2,0.9)}}
            \BILLES
      \endpsclip
  \end{psclip}
  \psline[linearc=0.2](-0.6,3.2)(-0.4,3)(-0.4,2)(-1.2,0)(1.2,0)(0.4,2)
  \psline[linearc=0.05](0.4,2)(0.4,2.4)(1.4,2.4)
  \psline[linearc=0.05](1.4,2.6)(0.4,2.6)(0.4,3)(0.6,3.2)%
}
\def\thermometre{%
    \pspolygon[linearc=0.05,fillstyle=solid,fillcolor=red](0.05,3)(0.05,-1.2)
    (0.15,-1.2)(0.15,-1.8)(-0.15,-1.8)(-0.15,-1.2)(-0.05,-1.2)(-0.05,3)
    \psframe[linearc=0.05,fillstyle=solid](-0.05,1)(0.05,3)%
}
\newdimen\BX
\newdimen\BY
\newdimen\RAYONBULLE
\newcommand\BILLES[1][50]{%
  \multido{\IBULLE=1+1}{#1}{%
    \setrandim{\BX}{-1.5\psunit}{1.5\psunit}
    \setrandim{\BY}{0\psunit}{1\psunit}
    \setrandim{\RAYONBULLE}{0.01\psunit}{0.15\psunit}
    \ifdim\BY>2\psunit \multiply \RAYONBULLE by 3
    \else
      \ifdim\BY < 2\psunit \ifdim\BY >1\psunit \multiply \RAYONBULLE by 2\fi
      \else \multiply \RAYONBULLE by 1 \fi
    \fi
    \rput(0,0){%
      \pscircle[style=BilleThreeD](\BX,\BY){\RAYONBULLE}%
    }%
  }%
}


\begin{document}
\begin{pspicture}(-3,0)(3,6)
  \rput(-2.2,4){\manometre}
  \erlen
  \rput(0.2,3){\thermometre}
  \rput(0,3){\Bouchon}
  \psline[linecolor=blue,linewidth=2pt]{->}(1.5,2.5)(2.5,2.5)
\end{pspicture}
\end{document}