You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
[email protected]
on 16 Sep 2013 at 8:04The text was updated successfully, but these errors were encountered: