changeset 791:8d96204a786a

merge
author Bernhard Reiter <bernhard@intevation.de>
date Thu, 27 Sep 2018 08:52:44 +0200
parents 1b82ae5e637e (current diff) d43e61044ad8 (diff)
children ce23a4192788
files
diffstat 1 files changed, 20 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/octree/vertex.go	Thu Sep 27 08:52:17 2018 +0200
+++ b/pkg/octree/vertex.go	Thu Sep 27 08:52:44 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: