1 /** This file is part of Shapes.
3 ** Shapes is free software: you can redistribute it and/or modify
4 ** it under the terms of the GNU General Public License as published by
5 ** the Free Software Foundation, either version 3 of the License, or
8 ** Shapes is distributed in the hope that it will be useful,
9 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 ** GNU General Public License for more details.
13 ** You should have received a copy of the GNU General Public License
14 ** along with Shapes. If not, see <http://www.gnu.org/licenses/>.
16 ** Copyright 2008, 2010, 2014 Henrik Tidefelt
19 |** preamble \RequirePackage{../sigsysnotation}
22 ##needs demoprefs.shext
23 ##needs ..Applications..Blockdraw
26 ##lookin ..Applications..Blockdraw
28 demoprefs & @defaultunit:1%c
43 inflow: \ •dst x1 x2 txt doValve →
45 d: [normalized x2 - x1]
46 •dst << [stroke (x1,y1+@pipe_width/2)--(x2-d*(r+@pipe_width/2),y1+@pipe_width/2)>(^[angle (d,0)])--(^90°)<(x2+d*@pipe_width/2,y1-@pipe_width/2-r)--(x2+d*@pipe_width/2,y2)]
47 •dst << [stroke (x1,y1-@pipe_width/2)--(x2-d*(r+@pipe_width/2),y1-@pipe_width/2)>(^[angle (d,0)])--(^90°)<(x2-d*@pipe_width/2,y1-@pipe_width/2-r)--(x2-d*@pipe_width/2,y2)]
48 p: (x2-d*(r+7mm),y1)--(x2-d*(r+2mm),y1)
49 •dst <<[stroke p head:Graphics..ShapesArrow]
50 •dst << [[shift (x1+d*3mm,y1-@pipe_width/2-3mm)] [Layout..center [TeX txt] (0,1)]]
52 [[shift ([Layout..mediate 0.4 x1 x2],y1)]*[rotate 90°] [valve]]
56 [inflow •page ~2.5cm tank_W/3 `Acid process flow´ false]
57 [inflow •page tank_W+2.5cm tank_W*2/3 `NaOH solution´ true]
59 •page << @nonstroking: [gray 0.8] |
60 [fill (0cm,0cm)--(tank_W,0cm)--(tank_W,tank_L)--(0cm,tank_L)--cycle]
64 •page << @width: 0.5bp & @dash: [dashpattern 3mm 1mm] | [stroke (0,tank_L)>hdl--(^)<(lambda,tank_L)>hdl--(^)<(2*lambda,tank_L)>hdl--(^)<(3*lambda,tank_L)>hdl--(^)<(4*lambda,tank_L)>hdl]
72 •page << [stroke (xc,y1+5mm)--(xc,yc)>(^a)--(^180°-a)<(xc+r,yc)>(^180°+a)--(^~a)<(xc,yc)>(^180°-a)--(^a)<(xc-r,yc)>(^~a)--(^180°+a)<(xc,yc)]
75 •page << [stroke (0cm,tank_H)--(0cm,0cm)--(tank_W,0cm)--(tank_W,tank_H)]
76 •page << [stroke (tank_W/2,0cm)--(tank_W/2,~1.5cm)]
77 •page << [stroke (tank_W/2+@pipe_width,0cm)--(tank_W/2+@pipe_width,~1.5cm)]
79 p: (tank_W/2+@pipe_width/2,~5mm)--(tank_W/2+@pipe_width/2,~10mm)
80 •page << [stroke p head:Graphics..ShapesArrow]
81 •page << [putlabelRight [TeX `Flow with desired pH´] [p 0.5].p+(@pipe_width/2,0) 0]