Update suitable examples and tests to use blank mode
[shapes.git] / examples / doc / tutorial-approximator-intersection.shape
blob412bcd1b4ea4b1bdf9b5077cb057b39429c3e991
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 2009, 2014 Henrik Tidefelt
17  **/
19 ##lookin ..Shapes
20 ##lookin ..Shapes..Geometry
22 a: (1.5cm,4.5cm)
24 pth: Geometry..@defaultunit:1%C | (0cm,0cm)>(^20°)--(1cm,2cm)--(^)<(2.5cm,2cm)>(^)--(2cm^)<(4cm,5cm)>(^~30°)--(^)<(5cm,4cm)
26 circMark: Traits..@width:0.5bp | [Graphics..stroke [Geometry..circle 4bp]]
27 crossMark: Traits..@width:0.5bp | [Graphics..stroke (~4bp,~4bp)--(4bp,4bp) & (~4bp,4bp)--(4bp,~4bp)]
29 helper: \ pth2 →
31   ( Traits..@width:0.5bp & Traits..@stroking:Traits..RGB..BLUE & Traits..@dash:[Traits..dashpattern 2bp 1bp] | [Graphics..stroke pth2] )
32   &
33   ( Traits..@width:0.5bp | [Graphics..stroke pth] )
34   &
35   ( Traits..@width:0.0bp | [Graphics..stroke [pth 0.5cm]--[pth 1cm] head:[Graphics..ShapesArrow width:2mm ...]] )
36   &
37   ( Traits..@width:5bp & Traits..@stroking:Traits..RGB..RED | [Graphics..spot [Geometry..approximator pth pth2].p] )
40 IO..•page << [helper [shift (1.3cm,4cm)][][Geometry..circle 0.5cm]]
41       << [shift (6cm,0cm)] [] [helper [shift (1cm,2.5cm)][][Geometry..circle 1.5cm]]
42       << [shift (12cm,0cm)] [] [helper [shift (2cm,2cm)][][Geometry..circle 3cm]]