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
30 yellow: @stroking:[rgb 1 0.7 0]
31 blue: @stroking:[rgb 0.3 0.6 1]
33 thickStyle: @width:3bp
34 thinStyle: @width:1.5bp & yellow & @cap:CAP_ROUND
38 bentPath: (0cm,0cm)>(1%C^0°)--(1%c^)<(+(1cm*[dir 40°]))>(^40°)
39 \ p ahLength:void ahAngle:30° tailAngle:60° →
45 theLength: [if [typeof ahLength]=§Void @width*6 ahLength]
47 picture: @cap:CAP_BUTT | [shift sl.p]*[rotate [angle sl.T]] [] [stroke ([rotate ~0.5*ahAngle]*[scale theLength/1cm][]bentPath) & ([rotate 0.5*ahAngle]*[scale y:~1]*[scale theLength/1cm][]bentPath)]
54 h_style: blue & @width:0.85bp /** Selected to match the thin line in the '@' sign. **/
56 s_path: (0u,0u)>(0.8%c^140°)--(0.8%c^)<(~1.1u,0u)>(^~120°)--(^)<(0.5u,~1.4u)>(0.7%C^~10°)--(^)<(3u,1u)>(0.6%c^100°)--(1%C^)<(~4u,3u)>(0.7%C^~168°)
57 --(1%C^)<(~13u,~4.5u)>(0.6%C^~90°)--(1.1%C^)<(1u,~17u)>(1%C^~90°)--(^)<(~9u,~25u)>(1%C^180°)--(1%c^)<(~22u,~18u)>(^120°)
61 sl1: [maximizer s_path [dir 108°]]
62 the_c: sl1.p+sl1.ik*sl1.N
63 hook: [[shift sl1.p]*[scale ~1]*[shift ~sl1.p] s_path.begin--sl1]
64 rotateAbout: \ z angle → [shift z]*[rotate angle]*[shift ~z]
67 •page << yellow & thickStyle & @nonstroking:[gray 0.94] | [fillstroke [shift the_c] [] [circle sl1.ik]]
68 << yellow & thickStyle & @cap:CAP_ROUND | [[range '1 hookCount].foldl \ p e → ( p & [[rotateAbout the_c 360°/hookCount*(e-'1)] [stroke hook]] ) null]
70 sl2: [maximizer s_path [dir ~10°]]-3u
71 the_c2: sl2.p+sl2.ik*sl2.N
72 •page << yellow & thickStyle | [stroke [shift the_c2] [] [circle sl2.ik]]
74 subPath: [sidepath2 [upsample_every 2u sl1--sl2] 1u]
76 •page << thickStyle & @cap:CAP_ROUND | [stroke s_path]
77 |** << h_style | [stroke [controlling s_path]]
79 •page << h_style | [stroke subPath]
81 •page << h_style | [stroke [shift sl1.p] [] [circle 1u]]
82 •page << thinStyle | [stroke sl1.p--(+(sl1.T*arrowLength)) head:succedesArrow]
83 •page << thinStyle | [stroke sl1.p--(+(sl1.N*arrowLength)) head:succedesArrow]
85 •page << h_style | [stroke [shift sl2.p] [] [circle 1u]]
86 •page << thinStyle | [stroke sl2.p--(+(sl2.T*arrowLength)) head:succedesArrow]
87 •page << thinStyle | [stroke sl2.p--(+(sl2.N*arrowLength)) head:succedesArrow]
89 @nonstroking:(blue|@stroking)
92 •page << [shift sl2.p+sl2.N*(arrowLength+1u)] [] [center [TeXScale [TeX `$\lambda$´]] (~1,0)]
93 •page << [shift the_c2] [] [center [TeXScale [TeX `@´]] (0,0)]
94 •page << [shift the_c+(2u,~sl1.ik+1u)] [] [center [TeXScale [TeX `\#´]] (0,~1)]