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, 2014 Henrik Tidefelt
23 pth: Geometry..@defaultunit:1%C | (0cm,0cm)>(^20°)--(1cm,2cm)--(^)<(2.5cm,2cm)>(^)--(2cm^)<(4cm,5cm)>(^~30°)--(^)<(5cm,4cm)
27 circMark: @width:0.5bp | [Graphics..stroke [Geometry..circle 4bp]]
28 crossMark: @width:0.5bp | [Graphics..stroke (~4bp,~4bp)--(4bp,4bp) & (~4bp,4bp)--(4bp,~4bp)]
30 subpath_intersection: \ sl1 sl2 pth → (sl1+[Geometry..intersection sl1--sl2 pth].length)
34 ( @width:0.5bp & @stroking:Traits..RGB..BLUE & @dash:[dashpattern 2bp 1bp] | [Graphics..stroke pth2] )
36 ( @width:0.5bp | [Graphics..stroke pth] )
38 ( @width:0.0bp | [Graphics..stroke [pth 0.5cm]--[pth 1cm] head:[Graphics..ShapesArrow width:2mm ...]] )
40 [[shift sl1.p] circMark]
42 [[shift sl2.p] circMark]
44 ( @width:5bp & @stroking:Traits..RGB..RED | [spot [subpath_intersection sl1 sl2 pth2].p] ) /** We know that there will be an intersection, so no error handler this time. **/
47 IO..•page << [helper (0cm,0.3cm)--(5cm,5cm)]