gramsight / fortune-voronoi Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/fortune-voronoi
Automatically exported from code.google.com/p/fortune-voronoi
Hi BenDi
Using the current version of the dll-code in VS2008, in VB.Net
Thanks very much for sharing the code. The downloaded project zip file contains
code to generate the FortuneVoronoi.dll but nothing on how to use it.
Would you have a small code example that shows the use the dll, especially how to construct the edges from results returned from the ComputeVoronoiGraph call, please?
Alternatively, can you please tell us which data from the VoronoiGraph.Edges
structure we should use to construct the edges (from and to-points).
Note: I get a few 1.#INF values in Bx and By using 5 input vertices.
Cheers
Original issue reported on code.google.com by [email protected]
on 6 Jan 2014 at 8:15
Hi folks,
First of all, cool code. It is somewhat over my skill level. I am therefore
posting my issue here in the hope of a hint.
Here is what I did:
1) Create 5 datapoints and run the algorithm:
places = new List<Vector>();
float low = 0.1f;
float high = 0.9f;
places.Add(new Vector(low, low));
places.Add(new Vector(high, low));
places.Add(new Vector(low, high));
places.Add(new Vector(high, high));
places.Add(new Vector(0.5f, 0.5f));
Debug.Log ("Number of entries in places: " + places.Count);
vg = Fortune.ComputeVoronoiGraph(places);
Debug.Log ("Number of entries in graph datapoints: " + vg.Vertizes.Count);
List<Vector3> verts = new List<Vector3>();
List<Vector2> uvs = new List<Vector2>();
int ix = 0;
foreach(VoronoiEdge ve in vg.Edges)
Debug.Log (string.Format("{0}) L: {1} R: {2} A: {3} B: {4} D: {5}", ix++, ve.LeftData, ve.RightData, ve.VVertexA, ve.VVertexB, ve.DirectionVector));
The output is:
Number of entries in places: 5
Number of entries in graph datapoints: 4
0) L: (0.9;0.1) R: (0.1;0.1) A: (0.5;0.1) B: (Infinity;Infinity) D: (0;-1)
1) L: (0.9;0.1) R: (0.5;0.5) A: (0.5;0.1) B: (0.9;0.5) D: (0.7071;0.7071)
2) L: (0.1;0.1) R: (0.5;0.5) A: (0.5;0.1) B: (0.1;0.5) D: (-0.7071;0.7071)
3) L: (0.1;0.1) R: (0.1;0.9) A: (0.1;0.5) B: (Infinity;Infinity) D: (-1;0)
4) L: (0.5;0.5) R: (0.9;0.9) A: (0.9;0.5) B: (0.5;0.9) D: (-0.7071;0.7071)
5) L: (0.1;0.9) R: (0.5;0.5) A: (0.1;0.5) B: (0.5;0.9) D: (0.7071;0.7071)
6) L: (0.9;0.9) R: (0.9;0.1) A: (0.9;0.5) B: (Infinity;Infinity) D: (1;0)
7) L: (0.1;0.9) R: (0.9;0.9) A: (0.5;0.9) B: (Infinity;Infinity) D: (0;1)
Problems
1) I expected vertizes and places to be of same length?
2) Edge #1 has swapped left and right datapoint.
I am using 0.1 on OSX
I am using the algorithm to split a rectangle into polygons. I am having an
easy time doing so just by creating two triangles from every edge. But its more
complicated to handle the areas touching the sides. Is there a hint on how to
generate those?
Kind regards
Jesper Taxbøl
Original issue reported on code.google.com by [email protected]
on 16 Sep 2013 at 8:04
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.