How do you save an image from a Three.js canvas?
I\'m attempting to use Canvas2Image but it doesn\'t like to play with Threejs. Since the canvas isn\'t defined until
use canvas to create the url, and then the same can be downloaded
function createImage(saveAsFileName) {
var canvas = document.getElementById("canvas");
var url = canvas.toDataURL();
var link = document.createElement('a');
link.setAttribute('href', url);
link.setAttribute('target', '_blank');
link.setAttribute('download', saveAsFileName);
link.click();
}