Comments (6)
// small example of the error
import megamu.mesh.*;
float[][] p = {
{142.78653, 364.8811},
{142.80171, 361.90747},
{142.8004, 361.91183},
{141.72589, 363.63394},
};
Voronoi v = new Voronoi(p);
from mesh.
// if called with 0 then this creates a non-array
public MPolygon(int points){
coords = new float[points][2];
count = 0;
}
// which this then tries to access element 0 of, causing the error.
public void add(float x, float y){
coords[count][0] = x;
coords[count++][1] = y;
}
from mesh.
but i think that the problem is actually that the MPolygon is ever being called with 0
problem in Voronoi constructor?
//regions[i] = new MPolygon(pointBuckets[i].length); // wrong?
// should that be this?
regions[i] = new MPolygon(faceOrder.length);
from mesh.
I can confirm that this seems to fix the issue. I can try and create a pull request for this but is @leebyron still around to accept it. I ran into this when trying to regularize Voronoi graphs.
from mesh.
PR it!
from mesh.
@leebyron I made a pull and it fixed that issue that I was having and the issue that acdean was defining however if you have some more test cases to but it through that's probably smart. I've only been using the library for a week so my testing code is pretty limited
from mesh.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mesh.