A simple function very much like the native Polar Grid Tool in AI, only this function actually creates individual cells rather than just some simple circles with lines in them.

center – Location of the grid origo, [point]
inner – The inner radius of the grid, [number]
outer – Radius of the grid, [number]
sectors – Sets the number of sector dividers, [array]
rings – Number of concentric dividers of the grid, [number]

“sectors” is an array carrying the number of sectors / concentric ring. This way, each ring may have a different number of sectors. For an ordinary grid just pass a one value array as “sectors” and make sure “rings” is at the right amount. ```function RadialGrid(center, inner, outer, sectors, rings){

var p1, p2, p3, p4, firstArcMid, secondArcMid,
ringRadius = (outer - inner) / rings,
sector

for(var i = 0; i < rings; i++){

sector		= rings > sectors.length ? sectors[sectors.length - 1] : sectors[i]
angle		= 90
angleStep	= 360 / sector

for(var j = 0; j < sector; j++){

p1				= center - new Point({length: innerRadius, angle: angle})
p2				= center - new Point({length: outerRadius, angle: angle})
p3				= center - new Point({length: outerRadius, angle: angle + angleStep})
p4				= center - new Point({length: innerRadius, angle: angle + angleStep})
firstArcMid		= center - new Point({length: outerRadius, angle: angle + angleStep / 2})
secondArcMid	= center - new Point({length: innerRadius, angle: angle + angleStep / 2})

if(sector == 1){
} else {
var path = new Path([p1, p2])
path.arcTo(firstArcMid, p3)