CreativeInquiry / PEmbroider

Embroidery Library for Processing
Other
442 stars 28 forks source link

Demo example which does animated stitch playback, using E.polylines #49

Closed golanlevin closed 4 years ago

golanlevin commented 4 years ago

Saving this one for me, just wanted to put it up so I could cross it off.

LingDong- commented 4 years ago

Hi @golanlevin

There's now an easier way to do this than using E.polylines()! I added a fourth optional argument to E.visualize(), which is the number of stitches to visualize. So simply passing frameCount to it in draw() gives you the playback animation, e.g.:

void draw(){
  E.visualize(false,true,true,frameCount);
}

For 10x playback speed, you can use E.visualize(false,true,true,frameCount*10);

Full example: b07857e3ecdbbe2af34de197cb323a581ec79d01

golanlevin commented 4 years ago

Marvelous. I've made a demo, examples/PEmbroider_animated_playback.