Fix Makefile whitespace errors
[shapes.git] / examples / applications / logo.shape
blob21ca5acaa1c45657e59f9b3c3f076a1a0362f286
1 /** This file is part of Shapes.
2  **
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
6  ** any later version.
7  **
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.
12  **
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/>.
15  **
16  ** Copyright 2008, 2010, 2014 Henrik Tidefelt
17  **/
19 ##needs ..Shapes..Geometry / pathmapping
21 ##classoption 12pt
22 ##documenttop \bf
24 ##lookin ..Shapes
25 ##lookin ..Shapes..Geometry
27 TeXScale: [scale 2.5]
29 ##unit u = 1mm
31 yellow: Traits..@stroking:[Traits..rgb 1 0.7 0]
32 blue: Traits..@stroking:[Traits..rgb 0.3 0.6 1]
34 thickStyle: Traits..@width:3bp
35 thinStyle: Traits..@width:1.5bp & yellow & Traits..@cap:Traits..Cap..ROUND
37 succedesArrow:
39  bentPath: (0cm,0cm)>(1%C^0°)--(1%c^)<(+(1cm*[dir 40°]))>(^40°)
40  \ p ahLength:void ahAngle:30° tailAngle:60° →
41  (Traits..@blend:Traits..Blend..NORMAL
42   |
43   { sl: [p 0]
44     z: sl.p
45     d: [angle sl.T]
46     theLength: [if [typeof ahLength]=Data..Type..§Void Traits..@width*6 ahLength]
47     (>
48       picture: Traits..@cap:Traits..Cap..BUTT | [shift sl.p]*[rotate [angle sl.T]] [] [Graphics..stroke ([rotate ~0.5*ahAngle]*[scale theLength/1cm][]bentPath) & ([rotate 0.5*ahAngle]*[scale y:~1]*[scale theLength/1cm][]bentPath)]
49       cut: 0bp
50     <)
51   }
52  )
55 h_style: blue & Traits..@width:0.85bp /** Selected to match the thin line in the '@' sign. **/
57 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°)
58           --(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°)
60 arrowLength: 10u
62 sl1: [Geometry..maximizer s_path [dir 108°]]
63 the_c: sl1.p+sl1.ik*sl1.N
64 hook: [[shift sl1.p]*[scale ~1]*[shift ~sl1.p] s_path.begin--sl1]
65 rotateAbout: \ z angle → [shift z]*[rotate angle]*[shift ~z]
66 hookCount:'3
68 IO..•page << yellow & thickStyle & Traits..@nonstroking:[Traits..gray 0.94] | [Graphics..fillstroke [shift the_c] [] [Geometry..circle sl1.ik]]
69       << yellow & thickStyle & Traits..@cap:Traits..Cap..ROUND | [[Data..range '1 hookCount].foldl \ p e → ( p & [[rotateAbout the_c 360°/hookCount*(e-'1)] [Graphics..stroke hook]] ) Graphics..null]
71 sl2: [Geometry..maximizer s_path [dir ~10°]]-3u
72 the_c2: sl2.p+sl2.ik*sl2.N
73 IO..•page << yellow & thickStyle | [Graphics..stroke [shift the_c2] [] [Geometry..circle sl2.ik]]
75 subPath: [Geometry..sidepath2 [Geometry..upsample_every 2u sl1--sl2] 1u]
77 IO..•page << thickStyle & Traits..@cap:Traits..Cap..ROUND | [Graphics..stroke s_path]
78 |**      << h_style | [Graphics..stroke [Geometry..controlling s_path]]
80 IO..•page << h_style | [Graphics..stroke subPath]
82 IO..•page << h_style | [Graphics..stroke [shift sl1.p] [] [Geometry..circle 1u]]
83 IO..•page << thinStyle | [Graphics..stroke sl1.p--(+(sl1.T*arrowLength)) head:succedesArrow]
84 IO..•page << thinStyle | [Graphics..stroke sl1.p--(+(sl1.N*arrowLength)) head:succedesArrow]
86 IO..•page << h_style | [Graphics..stroke [shift sl2.p] [] [Geometry..circle 1u]]
87 IO..•page << thinStyle | [Graphics..stroke sl2.p--(+(sl2.T*arrowLength)) head:succedesArrow]
88 IO..•page << thinStyle | [Graphics..stroke sl2.p--(+(sl2.N*arrowLength)) head:succedesArrow]
90 Traits..@nonstroking:(blue|Traits..@stroking)
93   IO..•page << [shift sl2.p+sl2.N*(arrowLength+1u)] [] [Layout..center [TeXScale [Graphics..TeX `$\lambda$´]] (~1,0)]
94   IO..•page << [shift the_c2] [] [Layout..center [TeXScale [Graphics..TeX `@´]] (0,0)]
95   IO..•page << [shift the_c+(2u,~sl1.ik+1u)] [] [Layout..center [TeXScale [Graphics..TeX `\#´]] (0,~1)]