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, 2015 Henrik Tidefelt
22 [if p1.null? >> [Debug..log_before p1 ...] >> [Debug..log_before "{n} ...]
24 (escape_continuation cont
25 @handler_NoIntersection: (\ pth1 pth2 →
26 (escape_continue cont (pth1.begin--pth1.end>(1%C^[angle (-pth1.end.rT)]))--((1%C^[angle (-pth2.begin.T)])<pth2.begin--pth2.end)))
29 t: [intersection p1 p2] >> [Debug..log_before `search...´ ...] >> [Debug..log_after `found´ ...]
30 [meetpaths [p1 0]--t [approximator p2 t.p]--[p2 ∞]]
35 helper: \ f sl1 sl2 res →
38 [helper f sl2 sl2+1 [meeter res [f sl1 sl2]]]]
42 tmp: [helper f [pth 0] [pth 1] Geometry..emptypath]
51 Geometry..@defaultunit:1%C
55 (sl1.p + sl1.N*dst)>(^[angle sl1.T])--
56 (^[angle sl2.rT])<(sl2.p - sl2.rN*dst)]
58 sidepath2: \ pth dst →
63 p3: sl2.p - sl2.rN*dst
64 p0 > ( (1/3)*sl1.v*( (sl1.T*p3) / (sl1.T*sl2.p) ) ^ [angle sl1.T] ) --
65 ( (1/3)*sl2.rv*( (sl2.rT*p0) / (sl2.rT*sl1.p) ) ^ [angle sl2.rT] ) < p3