[orx-triangulator] fix .update() methods (#163)

This commit is contained in:
Ricardo Matias
2021-01-29 12:24:44 +01:00
committed by GitHub
parent a3fea2daa6
commit b58870bee9
3 changed files with 14 additions and 7 deletions

View File

@@ -59,10 +59,8 @@ class Delaunay(val points: DoubleArray) {
private var delaunator = Delaunator(points)
val inedges = IntArray(points.size / 2) { -1 }
private val hullIndex = IntArray(points.size / 2) { -1 }
private var collinear = IntArray(points.size / 2) { it }
val inedges = IntArray(points.size / 2)
private val hullIndex = IntArray(points.size / 2)
var halfedges = delaunator.halfedges
var hull = delaunator.hull
@@ -82,6 +80,9 @@ class Delaunay(val points: DoubleArray) {
hull = delaunator.hull
triangles = delaunator.triangles
inedges.fill(-1)
hullIndex.fill(-1)
// Compute an index from each point to an (arbitrary) incoming halfedge
// Used to give the first neighbor of each point for this reason,
// on the hull we give priority to exterior halfedges