jonobr1 / two.js

A renderer agnostic two-dimensional drawing api for the web.
https://two.js.org
MIT License
8.3k stars 455 forks source link

[How to use arrays or objects to draw curves?] #662

Closed landy101 closed 1 year ago

landy101 commented 2 years ago

No tutorials using arrays or objects

var ddd = [400, 600, 120, 50, 140, 150, 160, 50, 180, 150, 190, 100, true] this.electronArray.push( this._two.makeCurve(ddd) )

landy101 commented 2 years ago

Ask the mouse to draw the Versailles line example

jonobr1 commented 2 years ago

This would be a way to to accept an array of points by [x, y, x, y ...] configuration:

const path = two.makeCurve.apply(two, ddd);