Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gdsestimating/three-dxf
A dxf viewer for the browser using three.js
https://github.com/gdsestimating/three-dxf
browser dxf nodejs threejs
Last synced: about 1 month ago
JSON representation
A dxf viewer for the browser using three.js
- Host: GitHub
- URL: https://github.com/gdsestimating/three-dxf
- Owner: gdsestimating
- License: mit
- Created: 2015-04-23T15:09:55.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-01-29T09:05:30.000Z (10 months ago)
- Last Synced: 2024-09-28T23:42:44.542Z (about 1 month ago)
- Topics: browser, dxf, nodejs, threejs
- Language: JavaScript
- Size: 922 KB
- Stars: 541
- Watchers: 35
- Forks: 171
- Open Issues: 29
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://github.com/gdsestimating/three-dxf/blob/screenshots/screenshots/three-dxf-screenshot.png?raw=true "What the sample looks like")
#### Usage
```javascript
// 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](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.