Skip to content
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

epsilon3 and intersect(a, b) #3

Closed
Fil opened this issue Feb 22, 2018 · 2 comments
Closed

epsilon3 and intersect(a, b) #3

Fil opened this issue Feb 22, 2018 · 2 comments

Comments

@Fil
Copy link
Member

Fil commented Feb 22, 2018

From Jason Davies's code (ported in 82d9481#diff-1955ba130f17ffd3f1a5db97ee798e02R13 ), there was an epsilon2 test in this function.

Somehow it allowed lines to escape the clipping on some occasions, so I lowered it to epsilon3 in 202e604 and got much less errors.

But it still happens, and the fix is to get rid of any epsilon and compare the values with 0.

capture d ecran 2018-02-22 a 12 10 13
capture d ecran 2018-02-22 a 12 10 07

I wonder what I'm missing (in which cases this value should be st. positive), but testing in all my examples seems to be OK with 0 instead of epsilon3.

Fil added a commit that referenced this issue Feb 23, 2018
@Fil Fil closed this as completed Feb 23, 2018
@Fil
Copy link
Member Author

Fil commented Feb 24, 2018

Now this creates a random error in the d3-geo-projection tests: sometimes they give the exact image, and sometimes not (in different runs).

The difference between those images and the reference is so tiny only the test sees them. (Red dots on the top-left edge).
polyhedralcollignon-difference
polyhedralbutterfly-difference

@Fil Fil reopened this Feb 24, 2018
@Fil
Copy link
Member Author

Fil commented Feb 24, 2018

A way to get reproducible results and avoid the tests wobbling is to get rid of Math.random() and replace it with a deterministic function like Math.sin( 10000 * xxx). Fix coming soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant