Skip to content

wulifangy/three-dxf

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

> cd sample
> npm install
> cd ..
> npm install -g http-server
> http-server .
# use `http-server -c-0 .` to prevent caching

After performing the steps above, you can see the example at http://127.0.0.1:8080/sample. You can use the dxf file included in the sample.

Supported DXF Features

Supports:

  • Header
  • Most LW entities (lines, polylines, circles, etc)
  • Layers
  • Some support for line types
  • Simple Text
  • Viewport
  • Splines (Quadratic and Cubic)
  • Ellipses

Does not yet support:

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

About

A dxf viewer for the browser using three.js

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%