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
When using jc_voronoi for a natural neighbor interpolation problem, I was testing jc_voronoi to make sure it was getting linked correctly by giving it a square of points at {0,0}, {val, 0}, {0, val}, {-val, 0}, and {0, -val}.
There appears to be a bug when val = 2 in this case.
I went through and was checking the number of edges that each site said it had, and the {0,0} site is always supposed to say 4. When val = 2, it says it has two. This doesn't seem to happen when I rotate or shift the square. This code runs through these cases and some other vals other than 2
Demonstration of bug at 2
Start Of Test
At site index 4 with position (0, -1)
Number of edges is 4
At site index 3 with position (-1, 0)
Number of edges is 4
At site index 0 with position (0, 0)
Number of edges is 4
As expected, the cell at (0,0) has 4 edges
At site index 1 with position (1, 0)
Number of edges is 4
At site index 2 with position (0, 1)
Number of edges is 4
Done printing sites and edge counts for this test
Start Of Test
At site index 4 with position (0, -3)
Number of edges is 4
At site index 3 with position (-3, 0)
Number of edges is 4
At site index 0 with position (0, 0)
Number of edges is 4
As expected, the cell at (0,0) has 4 edges
At site index 1 with position (3, 0)
Number of edges is 4
At site index 2 with position (0, 3)
Number of edges is 4
Done printing sites and edge counts for this test
This is the buggy one
Start Of Test
At site index 4 with position (0, -2)
Number of edges is 3
At site index 3 with position (-2, 0)
Number of edges is 2
At site index 0 with position (0, 0)
Number of edges is 2
At (0,0) the cell does not have 4 edges!!!!!!!!!!!
At site index 1 with position (2, 0)
Number of edges is 4
At site index 2 with position (0, 2)
Number of edges is 4
Done printing sites and edge counts for this test
End of the buggy one
Start Of Test
At site index 4 with position (-1.41421, -1.41421)
Number of edges is 5
At site index 3 with position (1.41421, -1.41421)
Number of edges is 5
At site index 0 with position (0, 0)
Number of edges is 4
As expected, the cell at (0,0) has 4 edges
At site index 2 with position (-1.41421, 1.41421)
Number of edges is 5
At site index 1 with position (1.41421, 1.41421)
Number of edges is 5
Done printing sites and edge counts for this test
Start Of Test
At site index 4 with position (8, 48)
Number of edges is 4
At site index 3 with position (6, 50)
Number of edges is 4
At site index 0 with position (8, 50)
Number of edges is 4
At site index 1 with position (10, 50)
Number of edges is 4
At site index 2 with position (8, 52)
Number of edges is 4
Done printing sites and edge counts for this test
Start Of Test
At site index 4 with position (0, -2)
Number of edges is 4
At site index 3 with position (-2, 0)
Number of edges is 4
At site index 0 with position (0, 0)
Number of edges is 4
As expected, the cell at (0,0) has 4 edges
At site index 1 with position (2, 0)
Number of edges is 4
At site index 2 with position (0, 2)
Number of edges is 4
Done printing sites and edge counts for this test
Start Of Test
At site index 4 with position (0, -2)
Number of edges is 4
At site index 3 with position (-2, 0)
Number of edges is 4
At site index 0 with position (0, 0)
Number of edges is 4
As expected, the cell at (0,0) has 4 edges
At site index 1 with position (2, 0)
Number of edges is 4
At site index 2 with position (0, 2)
Number of edges is 4
Done printing sites and edge counts for this test
End of Tests
I am not sure why this is happening, especially since it works when val = 2 + 2 *numeric_limits::epsilon.
I am hoping someone more familiar with the code can find it the reason
The text was updated successfully, but these errors were encountered:
I'm pretty sure this is the same problem I ran into. When a site is on the boundary, the edges are not created properly. The open pull request I have fixes this issue; try applying it to your branch.
When using jc_voronoi for a natural neighbor interpolation problem, I was testing jc_voronoi to make sure it was getting linked correctly by giving it a square of points at {0,0}, {val, 0}, {0, val}, {-val, 0}, and {0, -val}.
There appears to be a bug when val = 2 in this case.
I went through and was checking the number of edges that each site said it had, and the {0,0} site is always supposed to say 4. When val = 2, it says it has two. This doesn't seem to happen when I rotate or shift the square. This code runs through these cases and some other vals other than 2
The result from this is
I am not sure why this is happening, especially since it works when val = 2 + 2 *numeric_limits::epsilon.
I am hoping someone more familiar with the code can find it the reason
The text was updated successfully, but these errors were encountered: