-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfluidmix4.shape
193 lines (177 loc) · 6.95 KB
/
fluidmix4.shape
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
##preamble \usepackage{mlsstyle}
##needs ..Shapes..Layout / centering-X
##needs ..Applications..Blockdraw
##needs fluidmix-common.shext
##lookin ..Shapes..Graphics
##lookin ..Shapes..Geometry
##lookin ..Shapes..Layout
##lookin ..Shapes..Traits
##lookin ..Shapes..Data
##lookin ..Shapes..IO
##lookin ..Shapes..Numeric..Math
##lookin ..Applications..Blockdraw
green: [rgb 0.17 0.82 0.09]
box_ry: 10mm
box_len: 45mm
flowBoxPth: [rectangle (~0.5*box_len,~box_ry) (0.5*box_len,box_ry)]
volume_r: 9mm
volumePth: [circle volume_r]
sensor_y: 13mm
sensor_y_top: 13mm + 25mm
sensorPth:
{
halfPth: (~5mm,0m)--((+0m),sensor_y)--(~box_ry,(+0m))--((+0m),sensor_y_top)
halfPth--[[scale x:~1] [reverse halfPth]]--cycle
}
perm_ry: 6mm
volume_x: box_len + 20mm
leftFlowPth: flowBoxPth >> [shift (~(0.5*box_len + 5mm),0)]
rightFlowPth: flowBoxPth >> [shift ((0.5*box_len + 5mm),0)]
leftVolumePth: volumePth >> [shift (~volume_x,0)]
rightVolumePth: volumePth >> [shift (volume_x,0)]
bboxed_lbl_enlarge: [bboxed_enlarge xy:(0.3mm,0.3mm) ...]
@fill:fluid_blue & @width:0.3bp
|
{
•page << [fillstroke sensorPth]
•page << [fillstroke leftFlowPth]
•page << [fillstroke rightFlowPth]
•page << [fillstroke leftVolumePth]
•page << [fillstroke rightVolumePth]
•page << [fill [rectangle (~volume_x,~perm_ry) (volume_x,perm_ry)]]
}
(< lblA lblB >):
@width:0.3bp
|
{
lblB:
{
uHelper: (box_len, perm_ry)--(volume_x, (+0m))
lHelper: (box_len, ~perm_ry)--(volume_x, (+0m))
comp1Pth: rightFlowPth
comp2Pth: rightVolumePth
ua: [intersection uHelper comp1Pth]
ub: [intersection uHelper comp2Pth]
la: [intersection lHelper comp1Pth]
lb: [intersection lHelper comp2Pth]
•page << [stroke ua--ub]
•page << [stroke la--lb]
•page << permeableDash | [stroke ua.p--la.p]
•page << permeableDash | [stroke ub.p--lb.p]
[putblockOrigin •page [TeX `$h_{\mathrm{B}}$´] >> center_y >> [shift (ub.p.x + 2mm, 0)]] >> bboxed_lbl_enlarge
}
lblA:
{
uHelper: (~box_len, perm_ry)--(~volume_x, (+0m))
lHelper: (~box_len, ~perm_ry)--(~volume_x, (+0m))
comp1Pth: leftFlowPth
comp2Pth: leftVolumePth
ua: [intersection uHelper comp1Pth]
ub: [intersection uHelper comp2Pth]
la: [intersection lHelper comp1Pth]
lb: [intersection lHelper comp2Pth]
•page << [stroke ua--ub]
•page << [stroke la--lb]
•page << permeableDash | [stroke ua.p--la.p]
•page << permeableDash | [stroke ub.p--lb.p]
[putblockOrigin •page [TeX `$h_{\mathrm{A}}$´] >> center_y >> [center_x x:1 ...] >> [shift (ub.p.x - 2mm, 0)]] >> bboxed_lbl_enlarge
}
{
uHelper: (~box_len, perm_ry)--(box_len, (+0m))
lHelper: (~box_len, ~perm_ry)--(box_len, (+0m))
comp1Pth: leftFlowPth
comp2Pth: rightFlowPth
ua: [intersection uHelper comp1Pth]
ub: [intersection uHelper comp2Pth]
la: [intersection lHelper comp1Pth]
lb: [intersection lHelper comp2Pth]
•page << permeableDash | [stroke ua--ub]
•page << [stroke la--lb]
•page << permeableDash | [stroke ua.p--la.p]
•page << permeableDash | [stroke ub.p--lb.p]
}
(> lblA lblB <)
}
lbl1a: [putblockOrigin •page
[TeX `\begin{minipage}{41mm}\lstinline!inStream($h_{1\mathrm{a}}$)!\\$h_{1\mathrm{a}}$\\\end{minipage}´]
>> center_y >> [shift (2mm, 0)]
>> [shift (~(box_len + 5mm),0)]
] >> bboxed_lbl_enlarge
lbl1b: [putblockOrigin •page
[TeX `\begin{minipage}{41mm}\begin{flushright}~\\$h_{1\mathrm{b}}$\\\lstinline!inStream($h_{1\mathrm{b}}$)!\end{flushright}\end{minipage}´]
>> center_y >> [shift (2mm, 0)]
>> [shift (~(box_len + 5mm),0)]
] >> bboxed_lbl_enlarge
lbl2a: [putblockOrigin •page
[TeX `\begin{minipage}{41mm}\lstinline!inStream($h_{2\mathrm{a}}$)!\\$h_{2\mathrm{a}}$\\\end{minipage}´]
>> center_y >> [shift (2mm, 0)]
>> [shift (5mm,0)]
] >> bboxed_lbl_enlarge
lbl2b: [putblockOrigin •page
[TeX `\begin{minipage}{41mm}\begin{flushright}~\\$h_{2\mathrm{b}}$\\\lstinline!inStream($h_{2\mathrm{b}}$)!\end{flushright}\end{minipage}´]
>> center_y >> [shift (2mm, 0)]
>> [shift (5mm,0)]
] >> bboxed_lbl_enlarge
lblSensor: [putblockOrigin •page
[TeX `\begin{minipage}{41mm}\lstinline!inStream($h_{3}$)!\\\color{olive}$h_{3}$\end{minipage}´]
>> center_y >> [shift (2mm, 0)]
>> [rotate 90°] >> [shift (0,sensor_y)]
] >> bboxed_lbl_enlarge
{
sensor_h_c: [[shift (2mm, 0)] (2mm,~2mm)] >> [rotate 90°] >> [shift (0,sensor_y)]
r: 2.5mm
•page <<
@width:0.5bp | [stroke [[shift sensor_h_c] (~r,~r)--(r,r) & (~r,r)--(r,~r)]]
}
@stroke:flow_red
& @fill:flow_red
& connectWidth
|
{
•page << [stroke [rightpoint lblA]--[leftpoint lbl1a 3 3] head:flow_head]
•page << [stroke ([leftpoint lbl1a 3 3]+(24mm,0))--([rightpoint lbl1b 2 2]-(6mm,0)) head:flow_head]
•page << [stroke ([leftpoint lbl2a 3 3]+(24mm,0))--([rightpoint lbl2b 2 2]-(6mm,0)) head:flow_head]
c: (~3mm,4mm)
•page << [stroke c--[rightpoint lbl1b 2 2]]
•page << [stroke c--[leftpoint lbl2a 3 3]]
•page << [stroke c--[bottompoint lblSensor 5 1] head:flow_head]
•page << [fill flowJointPth >> [shift c]]
}
@stroke:flow_purple
& @fill:flow_purple
& connectWidth
|
{
•page << [stroke [leftpoint lblB]--[rightpoint lbl2b 3 1] head:flow_head]
•page << [stroke ([rightpoint lbl2b 3 1]-(24.5mm,0))--([leftpoint lbl2a 3 2]+(6mm,0)) head:flow_head]
•page << [stroke ([rightpoint lbl1b 3 1]-(24.5mm,0))--([leftpoint lbl1a 3 2]+(6mm,0)) head:flow_head]
c: (1mm,1mm)
•page << [stroke c--[rightpoint lbl1b 3 1]]
•page << [stroke c--[leftpoint lbl2a 3 2]]
•page << [stroke c--[bottompoint lblSensor 5 2] head:flow_head]
•page << [fill flowJointPth >> [shift c]]
}
•page <<
[TeX `\begin{minipage}{19mm}\begin{center}Volume\\A\end{center}\end{minipage}´]
>> [center z:(0, ~1) ...] >> [shift (~volume_x, (box_ry + 2mm))]
•page <<
[TeX `\begin{minipage}{19mm}\begin{center}Volume\\B\end{center}\end{minipage}´]
>> [center z:(0, ~1) ...] >> [shift (volume_x, (box_ry + 2mm))]
•page <<
[TeX `\begin{minipage}{19mm}\begin{center}Flow\\1\end{center}\end{minipage}´]
>> [center z:(0, ~1) ...] >> [shift (~(0.5*box_len + 5mm), (box_ry + 2mm))]
•page <<
[TeX `\begin{minipage}{19mm}\begin{center}Flow\\2\end{center}\end{minipage}´]
>> [center z:(0, ~1) ...] >> [shift ((0.5*box_len + 5mm), (box_ry + 2mm))]
•page <<
[TeX `\begin{minipage}{50mm}\begin{center}Sensor\\3\\\lstinline!m3.c.m_flow(min=0)!\end{center}\end{minipage}´]
>> [center z:(0, ~1) ...] >> [shift (0, (sensor_y_top + 2mm))]
•page <<
[TeX `\begin{minipage}{25mm}\begin{center}Connection\\A --- 1a\end{center}\end{minipage}´]
>> [center z:(0, 1) ...] >> [shift (~(volume_x - volume_r), ~(box_ry + 2mm))]
•page <<
[TeX `\begin{minipage}{25mm}\begin{center}Connection\\1b --- B\end{center}\end{minipage}´]
>> [center z:(0, 1) ...] >> [shift ((volume_x - volume_r), ~(box_ry + 2mm))]
•page <<
[TeX `\begin{minipage}{25mm}\begin{center}Connection\\1b --- 2a\end{center}\end{minipage}´]
>> [center z:(0, 1) ...] >> [shift (0, ~(box_ry + 2mm))]