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

Spurious points in the corner polygon #88

Closed
Fil opened this issue Sep 3, 2019 · 5 comments
Closed

Spurious points in the corner polygon #88

Fil opened this issue Sep 3, 2019 · 5 comments

Comments

@Fil
Copy link
Member

Fil commented Sep 3, 2019

This is not a graphic error, as the points are aligned, but topologically it could be nice (?) to avoid them, as we did in #83 to avoid repeated points.

In the following example the cell for point 0 has 6 different points, when 4 would be enough (discounting the last one which closes the path).

Capture d’écran 2019-09-03 à 17 08 31

https://observablehq.com/d/5c76273688ee3fc9

@mbostock
Copy link
Member

mbostock commented Sep 3, 2019

So, eliminate successive collinear points, the same way we eliminate coincident points to fix #42? My guess is that this probably isn’t worth the additional computational effort.

@mourner
Copy link
Collaborator

mourner commented Sep 3, 2019

Filtering out collinear points should be very fast so it likely won't add much overhead. And it only happens on cells near the border right?

@Fil
Copy link
Member Author

Fil commented Sep 3, 2019

I seem to find them only at the corners.

@Fil
Copy link
Member Author

Fil commented Sep 3, 2019

Here's an explorable notebook that seems to confirm it's only the corners:
https://observablehq.com/d/390c5610c938f86f

The filter I have works for what I was looking for, but maybe the situation can be prevented earlier.

@mourner
Copy link
Collaborator

mourner commented Sep 3, 2019

@Fil if it's only for the corners, you could replace orientation test with a much simpler check since edges are axis-aligned (x0 === x1 === x2 or y0 === y1 === y2).

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

3 participants