aligator / gcode-viewer

A simple gcode viewer lib using three.js
MIT License
37 stars 8 forks source link

Blocking rendering -> Webworkers? #2

Open aligator opened 3 years ago

aligator commented 3 years ago

As the rendering blocks the whole js thread currently, maybe I should use webworkers to do this in a non-blocking way.

yvanblanchard commented 1 year ago

That’s a great idea !

aligator commented 1 year ago

@yvanblanchard I looked into it a bit, but I think it would need a bit more refactoring to add this feature. However for now I found another, very simple way to avoid too long blocks:

I now just call setTimeout with 0 all 200 lines while rendering. That way the browser gets a chance to handle its ui updates between rendering.

You can use v0.5.0 to use that feature.

yvanblanchard commented 1 year ago

Thank you very much for your work! I will test it soon. Let me know when the v0.5.0 will be published.

aligator commented 1 year ago

NPM is already😃 I just forgot to create a release in Github.