 |
|
 |
Ben,
Tried decimal type also, still its reporting 3 vertex at wrong coordinates. Even this circle at this vertex is not an empty circle.
Please look into this problem.
Thanks,
Sunil Terkar
|
|
|
|
 |
|
 |
I tried the numbers above, and with BenDi's version, I got 5 vertices:
y:10277.582825767151, x:10313.499324681763
y:10489.718951040446, x:9870.995694254938
y:10497.621153995677, x:10719.098572868817
y:10504.131065614873, x:9950.369665759434
y:13717.0357506786, x:12076.964532715061
(not 3 as you report, and neither 4 as you anticipate.)
|
|
|
|
 |
|
 |
Ben,
I have passed on following points to this algorithum,seems its generating atleast one less vertex and one less edge. I have compared voronoi diagram generated by these points wih standard GIS software like MapInfo, is it the thing that you need to address ?
1 399380.8371 -5526801.89
2 400882.095 -5525038.395
3 402256.1277 -5524122.657
4 399247.2089 -5525471.661
5 401383.9145 -5523790.174
Regards,
Sunil Terkar
|
|
|
|
 |
|
 |
I tried it, and BenDI's version correctly reports 4 vertices:
y:-5530625.902209154, x:405647.4244046288
y:-5526166.085865074, x:400398.8301785578
y:-5524717.980236851, x:401702.70591802325
y:-5523959.683474038, x:399813.0172873341
Are you saying your GIS software is reporting 5 vertices?
|
|
|
|
 |
|
 |
Hello: I'm working on a project that involves finding the medial axis of
vector polygons and was hoping from all that I've read that using the voronoi would allow me to do this.
has anyone has experience w/ working w/ this project and finding the medial axis?
thanks,
Proctor
|
|
|
|
 |
|
 |
Thank you very much for posting this! It's a great starting point for developing my own Voronoi solver.
|
|
|
|
 |
|
 |
How does the code return the rays (ie sides with only one vertex and a direction). From what I can tell VVertexB is just set to NaN. But how does one generate the rays from this information?
|
|
|
|
 |
|
|
 |
|
 |
Hi!
For (partly) infinite edges I provided two properties do make drawing easier: FixedPoint and DirectionVector. FixedPoint is either the (one) Vertex that exists or the middle between the two data points. DirectionVector is orthogonal to the connecting line between the data points (this is a property of all voronoi edges).
The secret to getting the direction of an infinite edge is in the voronoi algorithm itself - it provides edges with 'left' and 'right' data points. This gives a direct way to calculating the direction from the vertex. It goes in the direction where LeftData is left and RightData is right. Simple
Cheers,
Ben
|
|
|
|
 |
|
 |
Do you mean that the Voronoi edge ray must start at VVertexA and must have the direction of the line made by the points LeftData and RightData (i.e. from LeftData to RightData comes first). If yes, then your algorithm is wrong. Just test it on a rectangle and you will see the result. If I misunderstood you, please explain how to get the rays in more details.
VladovsoftSoftware products for fitness and health club management, storehouses, shops and barcode generation.
|
|
|
|
 |
|
 |
They start in VVertexA and go orthogonal to the line from LeftData to RightData, so that LeftData is on the left and RightData is on the right.
|
|
|
|
 |
|
 |
Ok, thanks. But what about the vertices. I made a simple polygon generator to test the algorithm and I saw that the location of the vertex for 3 points (i.e. a triangle) is sometimes out of the triangle. But it should be the center of the inscribed circle, shouldn't it ?
VladovsoftSoftware products for fitness and health club management, storehouses, shops and barcode generation.
|
|
|
|
 |
|
 |
No, Voronoi Vertex of a triangle is the center of it's outer circle, which is only inside the triangle for max(angle)<90 degree. (see wiki[^])
B.
|
|
|
|
 |
|
 |
Ok, thanks for the info. I was planning to use Voronoi diagrams for finding the Maximum Inscribed Circle in a simple polygon, but I guess I should read some more information about its properties to determine if it will work for me.
VladovsoftSoftware products for fitness and health club management, storehouses, shops and barcode generation.
|
|
|
|
 |
|
 |
According to this, if I take RightData-LeftData, I get the vector from left to right. Then swapping X and Y and negating one gets an orthogonal vector. Taking the non-unknown point and adding the orthogonal vector should produce the correct ray, with LeftData on the left and RightData on the right. However in some cases it does not, and the ray is cast in the wrong direction, as if LeftData and RightData are in the wrong order.
Do you have a correction for me, or updated version of this code?
|
|
|
|
 |
|
 |
Hi,
sorry, I dont have any free time at the moment... can you verify whether the left/right data points are actually wrong?
B.
|
|
|
|
 |
|
 |
I solved this the same way many other implementations do - don't try to draw the unbounded edges, just contain the points you want to draw within a much larger triangle or square.
With this, I don't have any issues.
|
|
|
|
 |
|
 |
Just a note to say I get the same thing unfortunately.
|
|
|
|
 |
|
 |
In most cases you have 2 infinite edges per area. Just find the crossing point of them and choose direction from this point to the VVertixA (or the midpoint between Left and Right points) of the edge.
|
|
|
|
 |
|
 |
Hi,
Can somebody provides sample code,how to call this function. I am trying following code & getting error as invalid cast
Vector V1 = new Vector(2,2);
Fourtune.ComputeVoronoiGraph(V1);
Quick help would be appreciated.
Thanks
Sunil Terkar
|
|
|
|
 |
|
 |
You need to put your values into a List.. like
List v=new List();
v.add(myVector);
//more points added
feed v into ComputeVoronoiGraph
Cheers
Wayne
|
|
|
|
 |
|
 |
Hi great code!
I am trying to change your algorithm to fit the needs of sharpmap.geometries.point.
Sharpamap is a GIS .net .
http://sharpmap.codeplex.com/[^]
As you can imagine I am having some difficulties.
any ideas on the steps i should take ?
|
|
|
|
 |
|
 |
What problems do you have? Contact me by direct message if you want
B.
|
|
|
|
 |
|
 |
i've a problem of virsion with the code diagrm voronoi
i've the virsion 2005 please help me!
|
|
|
|
 |
|
 |
MMMM, very good code! Thank's. I want make class for visualization 2D Voronoi diagram and building Delaunay triangulation.
|
|
|
|
 |