1.1.2 • Published 2 years ago

dxf-parser v1.1.2

Weekly downloads
1,625
License
MIT
Repository
github
Last release
2 years ago

Dxf-Parser

Dxf Parser is a javascript parser for dxf files. It reads dxf files into one large javascript object with readable properties and a more logical structure.

Also, keep an eye on three-dxf, a browser module for rendering the output of Dxf-Parser in the browser.

Install

npm install dxf-parser

Browsers -- As of 0.1.3 standalone browserify version is in the dist/ folder. Copy it out of the install directory or just download it from the GitHub repo directly. We may evetually publish this to bower, but the build environment needs a little work first.

Usage

import parse, { DxfParser } from 'dxf-parser';

// Grab fileText in node.js or browser
const fileText = ...;

const parser = new DxfParser();
try {
    const dxf = parser.parseSync(fileText);
}catch(err) {
    return console.error(err.stack);
}

or

// Grab fileText in node.js or browser
import parse from 'dxf-parser';

const fileText = ...;

try {
    const dxf = parse(fileText);
}catch(err) {
    return console.error(err.stack);
}

See the wiki Example Output page to get an idea of what the results look like.

Run Samples

node.js

npm install
npm run build
node samples/node/parseSync
node samples/node/parseStream

browser - the three-dxf repo has a sample for viewing dxf cad in the browser

What's Supported

Support

  • Header
  • Most 2D entities
  • Layers
  • LType table
  • Block table and inserts
  • VPort table
  • Text and some MTEXT
  • Some XData

Does not yet support

  • 3DSolids
  • All types of Leaders
  • other less common objects and entities.

Contributing

See the wiki for info on contributing

Run Tests

npm install -g mocha
//Then
npm test
//OR
mocha test
1.1.1

3 years ago

1.1.0

3 years ago

1.1.2

2 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

1.0.0-alpha.2

4 years ago

1.0.0-alpha.1

5 years ago

0.6.1

6 years ago

0.6.0

6 years ago

0.5.1

6 years ago

0.5.0

6 years ago

0.4.8

7 years ago

0.4.7

7 years ago

0.4.6

8 years ago

0.4.5

8 years ago

0.4.4

8 years ago

0.4.3

8 years ago

0.4.2

8 years ago

0.4.1

8 years ago

0.4.0

9 years ago

0.3.0

9 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago