|
Algorithm 1 Edge acquisition in quads intersecting with line |
| Input:
|
| Output:
|
| 1: |
function LineIntersectPoly() |
| 2: |
GetEdges
|
| 3: |
for
= 1 to N //N is the number of edges in
|
| 4: |
If
() then
return true |
| 5: |
end for
|
| 6: |
return false |
| 7: |
end function |
| 8: |
function GetEdges
|
| 9: |
if
.child
and
.edges
then
|
| 10: |
.append(.edges) |
| 11: |
else
|
| 12: |
child = {NE, NW, SE, SW} |
| 13: |
for
i = 1:4 do
|
| 14: |
if .bound () then
|
| 15: |
GetEdges
|
| 16: |
end if
|
| 17: |
end for
|
| 18: |
end if
|
| 19: |
end function |