|
thread:{l(0,1), l(1, 2), … l(N − 1, N)} ▷ N num projected line segments |
|
t: |
▷ tool projection |
1: |
procedure loopDetection(thread, t) |
2: |
for
i = 0 to N − 1 do
|
3: |
for
j = i+2 to N
do
|
4: |
e ← line-line-intersection(l(i, i + 1), l(j, j + 1)) |
5: |
if (e ≠ null) then
|
6: |
loopp ← e, i + 1, … j, e
|
7: |
intersection pair ← l(i, i + 1), l(j, j + 1) |
8: |
if (point-polygon-Inclusion(t, loopp)) then
|
9: |
record loopp, intersection pair
|
10: |
i ← j+ 1 |
11: |
break
|
12: |
end if
|
13: |
end if
|
14: |
end for
|
15: |
end for
|
16: |
end procedure |