diff pkg/octree/vertex.go @ 789:d43e61044ad8

Fill in last remaining corner cases in vertical triangle interpolation.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 27 Sep 2018 08:24:23 +0200
parents 9f3a4a60dc04
children ce23a4192788
line wrap: on
line diff
--- a/pkg/octree/vertex.go	Thu Sep 27 08:15:28 2018 +0200
+++ b/pkg/octree/vertex.go	Thu Sep 27 08:24:23 2018 +0200
@@ -498,9 +498,27 @@
 				out = append(out, t[i], t[j])
 				return out
 			case !r1:
-				// TODO
+				if t1 < 0 {
+					// below first -> clip by first
+					lin := linear(t[i], t[j])
+					out = append(out, t[i], lin(t2))
+				} else {
+					// above second -> clip by second
+					lin := linear(t[i], t[j])
+					out = append(out, lin(t2), t[j])
+				}
+				return out
 			case !r2:
-				// TODO
+				if t2 < 0 {
+					// below first -> clip by first
+					lin := linear(t[i], t[j])
+					out = append(out, t[i], lin(t1))
+				} else {
+					// above second -> clip by second
+					lin := linear(t[i], t[j])
+					out = append(out, lin(t1), t[j])
+				}
+				return out
 			}
 
 		case o1: