How to use the @jscad/core/code-evaluation/rebuildSolids.rebuildSolidsInWorker function in @jscad/core

To help you get started, we’ve selected a few @jscad/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jscad / OpenJSCAD.org / packages / web / src / jscad / processor.js View on Github external
errtxt += '\nStack trace:\n' + err.stack
        //    var errtxt = err.toString()
        }
        that.setStatus('error', err)// 'Error.'
        that.state = 3 // incomplete

      } else {
        that.setCurrentObjects(objects)
        that.setStatus('ready')
        that.state = 2 // complete
      }
      that.enableItems()
    }

    if (this.opts.useAsync) {
      this.builder = rebuildSolidsInWorker(script, fullurl, parameters, (err, objects) => {
        if (err && that.opts.useSync) {
          this.builder = rebuildSolids(script, fullurl, parameters, callback, options)
        } else (callback(undefined, objects))
      }, options)
    } else if (this.opts.useSync) {
      this.builder = rebuildSolids(script, fullurl, parameters, callback, options)
    }
  },