I'm using Lee Byron's Mesh Library (
http://www.leebyron.com/else/mesh/) to create triangulations of source images. I am picking a random selection of pixels within the source image, and then using a Voronoi object to create the list of regions to draw. This works fine when I sample a smaller number of points, but when I increase the number of sample points to approximately 1500 or more, I get an exception when creating the Voronoi object:
Exception in thread "Animation Thread" java.lang.ArrayIndexOutOfBoundsException: 0
at megamu.mesh.IntArray.add(IntArray.java:22)
at megamu.mesh.Voronoi.<init>(Voronoi.java:127)
at MIF_delauney.setup(MIF_delauney.java:55)
at processing.core.PApplet.handleDraw(PApplet.java:1608)
at processing.core.PApplet.run(PApplet.java:1530)
at java.lang.Thread.run(Thread.java:680)
What is causing this exception? I can't figure out where I'm going out of bounds at all...