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 Henrik Tidefelt
23 helper: \ sl → [if sl.looped [list] [cons sl [helper sl+1]]]
24 \ pth → [helper pth.begin]
29 ( (@stroking:RGB_BLACK | [[pathpoints pth].foldl \ p sl → ( p & [stroke [shift sl.p][]( (sl.N*6*@width)--(sl.N*~5*@width) )] ) null])
36 (@stroking:RGB_GREEN & @width:(2*@width) | [stroke [controlling pth]] )
41 testPth: @defaultunit:1%C | (0cm,0cm)>(^~30°)--(^)<(2cm,3cm)>(^45°)--(^)<(5cm,2cm)>(^0°)--(6cm,2cm)--(8cm,4cm)
43 test: \ •dst pth method →
48 •dst << @stroking:RGB_RED | [cstroke pth]
49 •dst << [debuglog_after `1´ ...][][stroke [method pth 2mm]]
50 •dst << [debuglog_after `1´ ...][][stroke [method pth ~2mm]]
53 pth: [shift (0,~5cm)][][upsample_inflections ../pth]
54 •dst << @stroking:RGB_RED | [cstroke pth]
55 •dst << [debuglog_after `2´ ...][][stroke [method pth 2mm]]
56 •dst << [debuglog_after `2´ ...][][stroke [method pth ~2mm]]
60 pth: ../pth >> upsample_inflections >> upsample_balance >> [shift (0,~10cm)]
61 •dst << @stroking:RGB_RED | [cstroke pth]
62 •dst << [debuglog_after `3´ ...][][stroke [method pth 2mm]]
63 •dst << [debuglog_after `3´ ...][][stroke [method pth ~2mm]]
67 pth: [shift (0,~15cm)][][upsample_bends 20° ../pth]
68 •dst << @stroking:RGB_RED | [cstroke pth]
69 •dst << [debuglog_after `4´ ...][][stroke [method pth 2mm]]
70 •dst << [debuglog_after `4´ ...][][stroke [method pth ~2mm]]
75 [debuglog_before `sidepath´+"{n} ...][][test •page testPth sidepath]
76 |**[debuglog_before `sidepath2´+"{n} ...][][test •page [shift (9cm,0)][]testPth sidepath2]