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

how to specify an empty box? #4

Open
mreinstein opened this issue Oct 22, 2017 · 1 comment
Open

how to specify an empty box? #4

mreinstein opened this issue Oct 22, 2017 · 1 comment

Comments

@mreinstein
Copy link

looking at boxEmpty(d, box) function here https://github.com/mikolalysenko/box-intersect/blob/master/index.js#L9

I'm wondering what the format is for declaring a box empty, so that it's not included in intersection tests.

Is it simply passing an empty array [] ?

Or do we 0 out the box dimensions as in[0, 0, 0, 0] ?

@mreinstein mreinstein changed the title how to specify an empty box how to specify an empty box? Oct 30, 2017
@mreinstein
Copy link
Author

mreinstein commented Oct 30, 2017

It seems there are 2 cases where a box will be considered empty, and excluded from intersection tests:

  • an empty array []
  • an array where any dimension's min value is > max value. An example: assuming a 2d array, the format is [minX, minY, maxX, maxY] this array: [ 4, 2, 0, 2 ] will be considered empty because minX (4) > maxX (0)

So it seems boxEmpty() is doing all of the validity checking for a given box.

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

No branches or pull requests

1 participant