Modified program to use scipy Voronoi diagram construction (in conjunction with existing poisson discs function) to draw Voronoi Diagram
Voronoi cells are now drawn in white, with some artifacts causing problems
Discovered artifacts are caused by the voronoi ridges which run to infinity off the screen (indexed as -1 by qhull)
Regions (cell borders) are currently draw in white
voronoi ridge vertices which include a -1 index are drawn in blue - these are the artifact border lines
Geometry class defines Points and Cells
Points clamp x y values to fixed screen dimension of 800
Implemented margins so it is easier to see what is going on outside the bounds of the main diagram
Added drawing of cell borders so that effect of clipping is visible
Added white overlay drawing of the region in which points were generated (i.e. non-margin area)
Added back print statement indicating dimensions of point-space outline
Added buffer for poisson point generation which generaetes points over a larger area than desired (shifting generated points so the voronoi diagram is centred) to ensure perimeter cells are not those which tend to infinity
Added process for clamping points of cells which leave the centre region, and discarding cells which would have been clamped flat (had no points in region)
Commented out introduction of boundary points to initial point set as it was doing more harm than good, forcing cells in corners to have strongly diagonal ridges
Commented out some diagnostic print statements
Tested whether non-square region dimensions (for xDim and yDim) worked, which turned out to be successful
Calculated trueCentres (average point) of cells
Attempted to use trueCentres for correctly drawing cell fills, though some (awesome looking) bugs remain
Added a couple of lines for loading a mask texture for upcoming work
Added missing + symbol which was causing the inaccurate fill-drawing using the new true-centres
Added mouse interaction, with increased opacity for cell mouse hovers over
BUG: Closest centre point is being found, but this is not translating correctly into a cell selection (mismatch between keys and cells?)
Highlighting of hovered cells finally works, with some confusion when hovering near borders of cells
Hovering now increases opacity to 0.6, clicking toggles selection which increases opacity to 1
Cell centre distance from mouse location now uses voronoi centre rather than average of points
BUG: Cells are being given incorrect voronoi centre values
Fixed scipy voronoi region indexing using vor.point_region to convert point index to region index
Detection of which cell currently contains mouse cursor now works correctly
Mouse dragging now updates mouseX and mouseY variables
Added function for checking if the hoveredCell has changed
During mouse dragging, each cell is toggled only each time mouse enters it (is first detected inside it)