diff --git a/design/duvenhage-inner-recursion-activity-diagram.puml b/design/duvenhage-inner-recursion-activity-diagram.puml index 04efd176e4ee4604a12b3027d0f960110a27e178..e16ec8dad5aba18dc04224e15a3a4ad24e38f1fa 100644 --- a/design/duvenhage-inner-recursion-activity-diagram.puml +++ b/design/duvenhage-inner-recursion-activity-diagram.puml @@ -29,21 +29,26 @@ skinparam ActivityFontSize 11 start - if (recursion depth > 30) then (yes) + if (recursion depth > 30?) then (yes) : search failed; stop endif - if (start and end point on same pixel) then (yes) - : return pixel intersection; + if (compare start and end point) then (same pixel) + : intersection ⇦ pixel intersection, with bilinear model; + : return intersection; + note left + this is the nominal return, + at final recursion level + end note stop endif - : compute kd-tree deepest level\ncontaining both start and end points; + :compute kd-tree deepest\nlevel sub-tile containing\nboth segment endpoints; if (compare segment and sub-tile maximum elevation) then (fully above) : return null; - note right + note left when the line-of-sight segment is fully above Digital Elevation Model, we can safely reject - it and proceed to next segment + it and proceed immediately to next segment end note stop endif @@ -56,7 +61,7 @@ end note repeat :intersection ⇦ recurse(previous, crossing); - if (found intersection?) then (yes) + if (intersection found?) then (yes) : return intersection; stop endif diff --git a/design/duvenhage-top-loop-activity-diagram.puml b/design/duvenhage-top-loop-activity-diagram.puml index 773abc72a9e4a4165ffd4069773223b348764b5f..f311395ff7943abf914f8040d117577282df4926 100644 --- a/design/duvenhage-top-loop-activity-diagram.puml +++ b/design/duvenhage-top-loop-activity-diagram.puml @@ -34,10 +34,10 @@ : current point ⇦ null; : hmax ⇦ tile maximum elevation; while (current point is null) - : entry ⇦ point at altitude hmax; - if (locate entry point) then (in selected tile) + : current ⇦ point at altitude hmax; + if (locate current point) then (in selected tile) else (outside of selected tile) - : select tile containing entry point; + : select tile containing current point; : hmax ⇦ max(hmax, tile maximum elevation); : current point ⇦ null; endif @@ -45,16 +45,16 @@ repeat : exit ⇦ line-of-sight exit point from tile; : intersection ⇦ Duvenhage(current, exit); - if (found intersection?) then (yes) + if (intersection found?) then (yes) : return intersection; stop endif - if (tile exited at side?) then (no) + if (tile exit) then (bottom) : searching ⇦ false; - else (yes) + else (side) : forward point ⇦ point slightly after exit point; : select tile containing forward point; - if (DEM traversed between\ncurrent and forward points) then (yes) + if (DEM traversed between\ncurrent and forward points?) then (yes) : return current point; note right extremely rare case!