Mercurial > gemma
comparison pkg/octree/vertex.go @ 813:1a808929c2c5
Cross sections: Fixed problem that certain inputs don't deliver data.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 27 Sep 2018 17:32:25 +0200 |
parents | 0cc97135717c |
children | 01019d4c8359 |
comparison
equal
deleted
inserted
replaced
812:98a7776100fb | 813:1a808929c2c5 |
---|---|
565 if k == i { | 565 if k == i { |
566 continue | 566 continue |
567 } | 567 } |
568 l := (k + 1) % 3 | 568 l := (k + 1) % 3 |
569 other := NewPlane2D(t[k].X, t[k].Y, t[l].X, t[l].Y) | 569 other := NewPlane2D(t[k].X, t[k].Y, t[l].X, t[l].Y) |
570 xo, yo, intersects := vl.line.Intersection(edge) | 570 xo, yo, intersects := vl.line.Intersection(other) |
571 if !intersects { | 571 if !intersects { |
572 continue | 572 continue |
573 } | 573 } |
574 t2 := relative(t[k], t[j])(xo, yo) | 574 t2 := relative(t[k], t[l])(xo, yo) |
575 if !inRange(t2) { | 575 if !inRange(t2) { |
576 continue | 576 continue |
577 } | 577 } |
578 zo := interpolate(t[k].Z, t[j].Z)(t2) | 578 zo := interpolate(t[k].Z, t[l].Z)(t2) |
579 | 579 |
580 m := Vertex{xo, yo, zo} | 580 m := Vertex{xo, yo, zo} |
581 | 581 |
582 var xn, yn, xf, yf float64 | 582 var xn, yn, xf, yf float64 |
583 | 583 |