code: function buildJscadWorkerScript(fullpath, fullscript) {
  // determine the relative base path for include(<relativepath>)
    var relpath = fullpath;
    if (relpath.lastIndexOf('/') >= 0) {
      relpath = relpath.substring(0,relpath.lastIndexOf('/')+1);
    }
    var source = "";
    source += 'onmessage = function(e) {\n';
    source += '  include = includeJscad;\n';
    source += '  self.relpath = "'+relpath+'";\n';
    source += '\n';
    source += fullscript+'\n';
    source += includeJscad.toString()+'\n';
    source += runJscadWorker.toString()+'\n';
    source += '  runJscadWorker(e);\n';
    source += '};';
    return source;
  }
docs: Build the Worker script from the parts fullpath   - URL to the original file fullscript - full JSCAD script Note: The full script must be define all data and functions required