-
Notifications
You must be signed in to change notification settings - Fork 1
/
fluidsystem.shape
61 lines (49 loc) · 2.33 KB
/
fluidsystem.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
##preamble \usepackage{mlsstyle}
##needs ..Shapes..Layout / centering-X
##needs ..Applications..Blockdraw
##lookin ..Shapes
##lookin ..Shapes..Graphics
##lookin ..Shapes..Geometry
##lookin ..Applications..Blockdraw
connectWidth: Traits..@width:0.8bp
solderDot: [Graphics..fill [circle 1.5bp]]
/** Variant of Layout..Xcenter_y, using lowercase instead of upper case 'X' for centering.
**/
xcenter_y:
{thebb: [Layout..bbox [Graphics..TeX `$x$´]]
\ obj y:0 → [[Geometry..shift (0cm, ~(y+1)/2*[Layout..ymax thebb])] obj]}
insideConnector: \ label →
{
c:
(Traits..@width:@blocklw & Traits..@fill:Traits..BW..WHITE | [Graphics..fillstroke [rectangle (~2.2mm,~2.2mm) (2.2mm,2.2mm)]])
&
[Layout..center [TeX `\lstinline!c!´]]
(Traits..@width:@blocklw | [Graphics..stroke [rectangle (~0.7cm,~0.4cm) (0.7cm,0.4cm)]])
&
(label >> xcenter_y >> Layout..center_x) /** Note that Blockdraw..centerlabel is normally used for this kind of label. **/
&
[[shift (0.7cm,0)] c]
}
outsideConnector: \ label →
{
(Traits..@width:@blocklw | [Graphics..stroke [rectangle (~0.3cm,~0.3cm) (0.3cm,0.3cm)]])
&
(label >> xcenter_y >> Layout..center_x) /** Note that Blockdraw..centerlabel is normally used for this kind of label. **/
}
dy: 1.3cm
m1: [putblockOrigin IO..•page [insideConnector [TeX `$m_{1}$´]] >> [Layout..center_x x:1 ...] >> [shift (~1cm,~0*dy)]]
m2: [putblockOrigin IO..•page [insideConnector [TeX `$m_{2}$´]] >> [Layout..center_x x:1 ...] >> [shift (~1cm,~1*dy)]]
m3: [putblockOrigin IO..•page [insideConnector [TeX `$m_{3}$´]] >> [Layout..center_x x:1 ...] >> [shift (~1cm,~2*dy)]]
c1: [putblockOrigin IO..•page [outsideConnector [TeX `$c_{1}$´]] >> [Layout..center_x x:~1 ...] >> [shift (1cm,~0.5cm-0*dy)]]
c2: [putblockOrigin IO..•page [outsideConnector [TeX `$c_{2}$´]] >> [Layout..center_x x:~1 ...] >> [shift (1cm,~0.5cm-1*dy)]]
connectWidth
|
{
IO..•page << [Graphics..stroke [rightpoint m1]--(0m,(+0m))--(0m,[rightpoint m3].y)--[rightpoint m3]]
IO..•page << [Graphics..stroke [rightpoint m2]--(0m,(+0m))]
IO..•page << [Graphics..stroke [leftpoint c1]--(0m,(+0m))]
IO..•page << [Graphics..stroke [leftpoint c2]--(0m,(+0m))]
IO..•page << solderDot >> [shift (0,[rightpoint m2].y)]
IO..•page << solderDot >> [shift (0,[leftpoint c1].y)]
IO..•page << solderDot >> [shift (0,[leftpoint c2].y)]
}