Javascript-Voronoi icon indicating copy to clipboard operation
Javascript-Voronoi copied to clipboard

Uncaught TypeError: Cannot read property 'rbRed' of null (line 316)

Open nsursock opened this issue 4 years ago • 0 comments

My implementation works sometimes but since I want to do Lloyd's relaxation, I really need the compute method to work all the time. I copied the code in the demo and I was expecting to have good results. But no matter how hard I try or the input, I still get this error Cannot read property 'rbRed' of null. Sometimes it's Cannot read property 'rbLeft' of null.

I'm using random numbers to generate the sites. And it seems the more sites I have, the less likely I am to have a working diagram. Can you please tell me if there's a fix? I already tried replacing the sibling var with sibling?: that way I'm checking if the var is null before referencing a property. But I got another error.

Many thanks.

EDIT: this bug doesn't happen when I use the code with Node. It only happens when I generate the map in a browser

nsursock avatar Aug 09 '21 05:08 nsursock