How to use the @jscad/core/io/prepareOutput.prepareOutput 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
currentObjectsToBlob: function () {
    var startpoint = this.selectStartPoint
    var endpoint = this.selectEndPoint
    if (startpoint > endpoint) { startpoint = this.selectEndPoint; endpoint = this.selectStartPoint }

    const format = this.selectedFormat()

    // if output format is jscad or js , use that, otherwise use currentObjects
    const objects = (format === 'jscad' || format === 'js') ? this.script : this.currentObjects.slice(startpoint, endpoint + 1)

    return convertToBlob(prepareOutput(objects, {format}))
  },
github jscad / OpenJSCAD.org / packages / cli / generateOutputData.js View on Github external
.then(function (objects) {
      // Buffer.from(outputData.data),{encoding: outputData.mimeType},
      return convertToBlob(prepareOutput(objects, {format: outputFormat}))
    })