Replace some tabs by spaces in interaction messages
[shapes.git] / resources / extensions / linkpaths.shext
blobbed637b7bd809aa040bef2e2391100d69f342ad4
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 ##needs conssupport
21 ##push Shapes
23 linkpaths: \ p1 p2 →
25   t: [intersection p1 p2]
26   [meetpaths [p1 0]--t [approximator p2 t.p]--[p2 ∞]]
29 buildchain: \ pthList →
31   l1: pthList.car
32   l2: pthList.cdr.car
33   lr: pthList.cdr.cdr
34   tmp: [lr.foldl (\ p e → [linkpaths p e]) l2]
35   t1: [intersection l1 tmp]
36   ttmp: [intersection tmp l1]
37   [meetpaths t1--[approximator l1 ttmp.p]
38              ttmp--[approximator tmp t1.p]]
41 ##pop Shapes