create regular polygons with
nsides
A "polygon" is just an array of [ x, y ] points, which allows you to map it to a new size and position.
const gon = require('n-gon')
let polygon = gon(7)
.map(([ x, y ]) => [
x * size + offset[0],
y * size + offset[1]
])
