Updating documentation and examples with new core namespaces
[shapes.git] / examples / applications / droo.shape
blobc9db8a2e273df85e4cce80fdb4cc51849aa29d10
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, 2014 Henrik Tidefelt
17  **/
19 ##lookin ..Shapes
21 t1: 1bp
22 t2: 2bp
23 t3: t2 * Numeric..golden
25 x1: ~2.5mm
26 x3: 7mm
27 sep: 2.3mm
28 y2: 5mm
29 x2: x3 - sep
30 y1: y2 - sep
31 ypart: 0.96
33 d_curve: [[shift (0,y2)]
34   Geometry..@defaultunit:1%c | (0mm,y2)>(^0°)--(1%c^)<(0.5*x3,ypart*y2)>(1%C^~10°)--(^)<(x3,0)>(^)--(1%C^10°)<(0.5*x3,~ypart*y2)>(1%c^)--(^0°)<(0mm,~y2)
36 r_curve: [[shift (0,y2)]
37   Geometry..@defaultunit:1%c | (0mm,y1)>(^0°)--(1%c^)<(0.5*x2,ypart*y1)>(1%C^~10°)--(^)<(x2,0)>(^)--(1%C^10°)<(0.5*x2,~ypart*y1)>(1%c^)--(^0°)<(0mm,~y1)
40 fillColor: @nonstroking:[rgb 205/255 49/255 0/255]
42 IO..•page << fillColor | [Graphics..fill d_curve--[Geometry..reverse r_curve]--cycle]
44 IO..•page << @width:t3 & @cap:Traits..Cap..BUTT | [Graphics..stroke (0cm,2*y2)--(0mm,0mm)]
45 IO..•page << @width:t2 & @cap:Traits..Cap..ROUND & Geometry..@defaultunit:1%c | [Graphics..stroke (x1,2*y2)--d_curve--(x1,0mm)]
46 IO..•page << @width:t2 & @cap:Traits..Cap..ROUND & Geometry..@defaultunit:1%c | [Graphics..stroke r_curve]
47 r_point: (7mm,~2mm)
48 r_ray: r_point--(r_curve.end - 3mm).p
49 IO..•page << @width:t2 & @cap:Traits..Cap..ROUND & Geometry..@defaultunit:1%c | [Graphics..stroke r_ray]
51 o_radius: 1.2mm
52 @width:t1 |
54   radius: o_radius
55   c: [shift (x1,radius-0.5*t2+0.5*@width)][][Geometry..circle radius]
56   IO..•page << fillColor | [Graphics..fill c]
57   IO..•page << [Graphics..stroke c]
60 @width:t1 |
62   radius: o_radius
63   sl: r_ray.begin
64   c: [shift sl.p]*[rotate 180°+[angle sl.T]]*[shift (0,radius-0.5*t2+0.5*@width)] [] [Geometry..circle radius]
65   IO..•page << fillColor | [Graphics..fill c]
66   IO..•page << [Graphics..stroke c]