numgrid, a MATLAB code which defines and numbers a subset of the nodes in a regular nxn grid of the [-1,+1]x[-1,+1] unit square. MATLAB includes a built-in version of this function.
The regions that can be defined include
Based on code that is copyright 1984-2015 The MathWorks, Inc.
numgrid is available in a MATLAB version and an Octave version and a Python version.