xy-plotter / xy

:pencil2: node.js for Makeblock XY plotter v2.0
MIT License
24 stars 6 forks source link

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

Closed jvolker closed 6 years ago

jvolker commented 6 years ago

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)
arnaudjuracek commented 6 years ago

Thanks for the catch, it is now fixed 👍