Closed vchizhov closed 4 years ago
The delaunay.points
array is also interleaved x, y
, so its length is also double the vertex count, evening things out. I agree this might look a little unintuitive in the code though.
@mourner So point.length
is not the point count but instead 2 * point_count
? Then I guess it should work. It's still probably better to just plug in the number of triangles there - would take less memory, and it will be more obvious that this is not a bug.
The
circumcenters
array is allocated as:Float64Array(delaunay.points.length * 2);
. Instead the size should be based on the number of triangles. Note that the number of triangles may be as high as2*vertex_count - 5
, which far exceedsdelaunay.points.length
(the multiplication by 2 in the allocation is for the (x,y) coordinates so that's not the 2 factor that we are looking for).