How to use the @jscad/io.dxfDeSerializer function in @jscad/io

To help you get started, we’ve selected a few @jscad/io 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 / core / code-loading / transformSources.js View on Github external
const transformDxfToJscad = (options, entry) => {
  // console.log('***** transformDxfToJscad',options,entry)
  const deserialize = require('@jscad/io').dxfDeSerializer.deserialize
  const source = deserialize(entry.source, entry.name, options)
  return createJscadEntry(entry, source)
}
github jscad / OpenJSCAD.org / packages / core / io / registerExtensions.js View on Github external
const registerDxfExtension = (fs, _require) => {
  const deserializer = require('@jscad/io').dxfDeSerializer
  _require.extensions['.dxf'] = (module, filename) => {
    const content = fs.readFileSync(filename, 'utf8')
    const parsed = deserializer.deserialize(content, filename, { output: 'geometry' })
    module.exports = parsed
  }
}
const unRegisterDxfExtension = (fs, _require) => {