jacobusmmsmit / DiscreteVoronoi.jl

Julia implementation of various algorithms for calculating discrete Voronoi diagrams.
MIT License
5 stars 1 forks source link

Avoid recomputation of sites (and other bugfixes) #29

Closed jacobusmmsmit closed 1 year ago

jacobusmmsmit commented 1 year ago

Apologies for the large, monolithic PR.

Major change: Avoid recomputation as much as possible by writing directly to the grid whenever a closest site is calculated and reading the closest site before calculation. Note, this does mean that grid cells that are not identically equal to Coord(0, 0) will be ignored during calculation for all algorithms.

This change is done by defining and exporting find_closest_site! and changing auxiliary functions to pass the grid as an argument.

Minor changes:

Bugfixes:

jacobusmmsmit commented 1 year ago

Making more changes, hold off on the review.