def getHexagonalGrid(diameter, loopsComplex, maximumComplex, minimumComplex, zigzag):
 diameter = complex(diameter.real, (math.sqrt(0.75) * diameter.imag))
 demiradius = (0.25 * diameter)
 xRadius = (0.5 * diameter.real)
 xStart = (minimumComplex.real - demiradius.real)
 y = (minimumComplex.imag - demiradius.imag)
 gridPath = []
 rowIndex = 0
 while (y < maximumComplex.imag):
  x = xStart
  if ((rowIndex % 2) == 1):
   x -= xRadius
  addGridRow(diameter, gridPath, loopsComplex, maximumComplex, rowIndex, x, y, zigzag)
  y += diameter.imag
  rowIndex += 1
 return gridPath

def getHexagonalGrid ( diameter , loopsComplex , maximumComplex , minimumComplex , zigzag ) : diameter = complex ( diameter . real , ( math . sqrt ( 0.75 ) * diameter . imag ) ) demiradius = ( 0.25 * diameter ) xRadius = ( 0.5 * diameter . real ) xStart = ( minimumComplex . real - demiradius . real ) y = ( minimumComplex . imag - demiradius . imag ) gridPath = [ ] rowIndex = 0 while ( y < maximumComplex . imag ) : x = xStart if ( ( rowIndex % 2 ) == 1 ) : x -= xRadius addGridRow ( diameter , gridPath , loopsComplex , maximumComplex , rowIndex , x , y , zigzag ) y += diameter . imag rowIndex += 1 return gridPath
get hexagonal grid .