Code Monkey home page Code Monkey logo

dxf-parser's Introduction

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

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

var parser = new DxfParser();
try {
    var dxf = parser.parseSync(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

node samples/parseSync
node samples/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

dxf-parser's People

Contributors

bzuillsmith avatar danmarshall avatar gpbmike avatar iceblu3710 avatar jakubnavratil avatar kpetrow avatar mankyd avatar serthys avatar sigill avatar supporting avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.