xy-plotter / xy

:pencil2: node.js for Makeblock XY plotter v2.0

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

job.polygon(points) example in API reference uses objects instead of arrays for points

jvolker opened this issue · comments

The job.polygon(points) example in API reference uses objects instead of arrays for points. The example doesn't work and throws an error. It should instead look like this:

const job = plotter.Job('my-awesome-drawing')

let points = []
for (let i = 0; i < 100; i++) {
  let point = [Math.random() * plotter.width, Math.random() * plotter.height]
  points.push(point)
}

job.polygon(points)

Thanks for the catch, it is now fixed 👍