GithubHelp home page GithubHelp logo

euharrison / three-dxf Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gdsestimating/three-dxf

0.0 0.0 0.0 793 KB

A dxf viewer for the browser using three.js

License: MIT License

JavaScript 100.00%

three-dxf's Introduction

Three-Dxf

Three-Dxf is a javascript viewer for dxf files. It takes dxf objects produced from Dxf-Parser and renders them using three.js.

Install

npm install three-dxf

For now we recommend cloning the repo, and starting with our sample. See Run Samples below.

Example of the viewer

Usage

// See index.js in the sample for more details
var parser = new window.DxfParser();
var dxf = parser.parseSync(fileReader.result);
cadCanvas = new ThreeDxf.Viewer(dxf, document.getElementById('cad-view'), 400, 400);

Run Samples

# first, compile three-dxf
> npm install
> npm run build

# then install the sample's dependencies
> cd sample
> npm install

# go back to the root and run http-server to run the sample
> cd ..
> npm install -g [email protected]
> http-server .
# use `http-server -c-1 .` to prevent caching

After performing the steps above, you can see the example at http://127.0.0.1:8080/sample/index.html. You can use the dxf file included in the sample. NOTE: the latest version of http-server will go into a redirect loop if you exlcude "/index.html" from the url.

Supported DXF Features

Supports:

  • Most LW entities (lines, polylines, circles, etc)
  • Layers
  • Simple Text
  • Splines
  • Ellipses
  • Text and MText (Basic multiline support available in v1.3.0 but not all formatting is supported)

Does not yet support:

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

three-dxf's People

Contributors

bzuillsmith avatar duncanthrax avatar euharrison avatar gouldingken avatar serthys avatar tat757 avatar vinzentvega 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.