mikolalysenko / box-intersect

📦 Any dimensional box intersection
MIT License
280 stars 27 forks source link

how to specify an empty box? #4

Open mreinstein opened 6 years ago

mreinstein commented 6 years ago

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 commented 6 years ago

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

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