3 ms·
I made a gcode render in three.js last summer and although three.js worked as advertised it's canvas rendering was by no means optimized. It was quite slow fo
by d1pl01d 15y ago
I made a gcode render in three.js last summer and although three.js worked as advertised it's canvas rendering was by no means optimized.
It was quite slow for complex geometry so the whole fall-back to canvas strategy won't be terribly useful for any even moderately 3d intense applications.. And then there's Firefox, oh the horrors of canvas's performance in Firefox 3.x.
CloudSCAD gets away with it AFAIK because generally OpenSCAD is not generating overly complicated models. However once you convert those polygons into stacks of infill and perimeter lines (a la gcode) you really begin to see the limits of three.js's canvas rendering setup.
Heres an example of rendering 2d gcode (simple enough that it doesn't crash most PCs in Chrome or FF4):
http://www.d1plo1d.com/cad_canvas/examples/gcode_canvas.html http://www.d1plo1d.com/cad_canvas/examples/gcode_canvas.html (same controls as emc2 axis)
src: https://github.com/D1plo1d/CadCanvas https://github.com/D1plo1d/CadCanvas
TL;DR: canvas support can be horrifically laggy but otherwise three.js is good things.
- DTrejo 15y agoCheck out the strategies used in http://raptjs.com/ http://raptjs.com/ (https://github.com/evanw/rapt https://github.com/evanw/rapt). Specifically the background cache and fast blitting: https://github.com/evanw/rapt/blob/master/game/src/game/backgroundcache.js#L98 https://github.com/evanw/rapt/blob/master/game/src/game/back...