-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Edges Always 0 #7
Comments
Having the same problem you described, using the regions outputs the vertices just fine but the edges have coordinates (0,0). Unfortunately I also need to associate the edges coordinates and the sites they connect so can't build the list on my own. |
Looks like the vertices are added to a list in Voronoi.cs and then disposed of at the end causing them to zero out. See the last lines of the FortunesAlgorithm function. |
I'm also having this issue and can't rebuild the edges list from the region vertices... |
Thank you so much @k-vekos, I was pulling my hair out trying to figure out why all Vertices were (0, 0) :D |
|
I know this repository is somewhat not maintained anymore, but whenever I use the library, the edges are always 0, no matter what I do. The points are not zero, I have checked that. The strange thing is if I do something like
site.NearestEdge()
, it is not zero, but every edge insite.Edges
andvoronoi.Edges
is at (0, 0), always. (When I say the edges are zero, I mean that their vertices are both (0, 0), and that only theNearestEdge()
has non zero vertices, but only when printed using theToString()
method).Update: I actually think the vertex position is always (0, 0); when the
ToString()
method was used, it showed the site coords, which are not at (0, 0). The indices of the vertices are not 0, and neither is null.Update 2: Yup, the
LeftVertex
andRightVertex
are always shown as[Vector2f]0,0
no matter what. Now that I've pinpointed what exactly I'm complaining about, I shouldn't have to update this another fifteen times 👍Haha, I lied. Update 3: The regions in
Voronoi.Regions()
have the correct vertices, those can be rendered fine. I could manually build up a list of edges, which is what I may have to do anyway.Final update, I think: Disabling smoothing doesn't change anything (except the relaxation doesn't happen anymore, big surprise)
My solution to this issue is to build my own edge list:
The text was updated successfully, but these errors were encountered: