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
24 [if p1.null? >> [debuglog_before p1 ...] >> [debuglog_before "{n} ...]
26 (escape_continuation cont
27 @handler_NoIntersection: (\ pth1 pth2 →
28 (escape_continue cont (pth1.begin--pth1.end>(1%C^[angle (-pth1.end.rT)]))--((1%C^[angle (-pth2.begin.T)])<pth2.begin--pth2.end)))
31 t: [intersection p1 p2] >> [debuglog_before `search...´ ...] >> [debuglog_after `found´ ...]
32 [meetpaths [p1 0]--t [approximator p2 t.p]--[p2 ∞]]
37 helper: \ f sl1 sl2 res →
40 [helper f sl2 sl2+1 [meeter res [f sl1 sl2]]]]
44 tmp: [helper f [pth 0] [pth 1] emptypath]
57 (sl1.p + sl1.N*dst)>(^[angle sl1.T])--
58 (^[angle sl2.rT])<(sl2.p - sl2.rN*dst)]
60 sidepath2: \ pth dst →
65 p3: sl2.p - sl2.rN*dst
66 p0 > ( (1/3)*sl1.v*( (sl1.T*p3) / (sl1.T*sl2.p) ) ^ [angle sl1.T] ) --
67 ( (1/3)*sl2.rv*( (sl2.rT*p0) / (sl2.rT*sl1.p) ) ^ [angle sl2.rT] ) < p3