jscad / io

DEPRECATED : Input Output handling for JSCAD (see the link below)
https://github.com/jscad/OpenJSCAD.org/tree/V2/packages
34 stars 13 forks source link

dxf deserialize and serialize lose some info #82

Closed Mrluobo closed 5 years ago

Mrluobo commented 5 years ago

i use dxf-deserialize parse a dxf file to cag object,then i parse the cag object to a dxf file.compare the pre-file and the parsed-file ,there are some line lost.

the pre-file is https://github.com/jscad/sample-files/blob/master/dxf/autocad2017/2Dxlines.dxf

here is my code:

const rawData = fs.readFileSync(path.join(root, name), 'utf-8')
  const cag = io.dxfDeSerializer.deserialize(rawData, 'test', { output: 'cag' })
  const dxf = io.dxfSerializer.serialize({}, cag)
  fs.writeFileSync(`./ntdxf/${name}.dxf`, dxf)

hope your help thx