About

io-grid.js computes points on a grid that are inside a closed polygon.

It is (much) more efficient than naively checking each point because it takes advantage of the fact that the points in question are structured into a grid.

Download the library from github.