Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update #2

Open
wants to merge 270 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
270 commits
Select commit Hold shift + click to select a range
7d16e82
Merge branch 'release/3.1.7'
bjnortier Jul 10, 2018
0a67047
Merge branch 'release/3.1.7' into develop
bjnortier Jul 10, 2018
6424faf
#27 SVG spline interpolation count is proportional to number of contr…
bjnortier Jul 12, 2018
9a32c17
Upgrade b-spline to 2.x [-order,+degree]
bjnortier Jul 12, 2018
96d9600
3.2.0
bjnortier Jul 12, 2018
15f4e87
Merge branch 'release/3.2.0'
bjnortier Jul 12, 2018
facf738
Merge branch 'release/3.2.0' into develop
bjnortier Jul 12, 2018
1ee87dd
prepare script now prepublishOnly
bjnortier Jul 12, 2018
008c44f
update babel env and mocha flags
bjnortier Jul 12, 2018
249f1d0
remove gulp from travis. add Node @8 and @10
bjnortier Jul 12, 2018
e778614
3.2.1
bjnortier Jul 12, 2018
92d66df
Merge branch 'release/3.2.1'
bjnortier Jul 12, 2018
eabd0ff
Merge branch 'release/3.2.1' into develop
bjnortier Jul 12, 2018
446c0c4
Render SVG in DOM in examples/dxf.html
bjnortier Jul 13, 2018
8cf85b0
upgrade vecks after npm audit
bjnortier Jul 13, 2018
776a141
remove TODO
bjnortier Jul 13, 2018
fca0ee1
#29 Smarter b-spline interpolation
bjnortier Jul 13, 2018
150db0e
rename test DXFs
bjnortier Jul 13, 2018
3138e0e
require -> import
bjnortier Jul 13, 2018
e463fd1
add option for interpolation spline segments
bjnortier Jul 13, 2018
27360f7
compile
bjnortier Jul 13, 2018
d7b51a2
module.exports -> export
bjnortier Jul 13, 2018
90d5361
#29 Use black when DXF has no layertable for entity
bjnortier Jul 13, 2018
bbb65b8
3.2.2
bjnortier Jul 13, 2018
c45ad3b
Merge branch 'release/3.2.2'
bjnortier Jul 13, 2018
0acb9a6
Merge branch 'release/3.2.2' into develop
bjnortier Jul 13, 2018
78ebd52
Be nicer to person in comment
bjnortier Jul 16, 2018
fa6980f
remove lib/ and dist/ for git
bjnortier Jul 25, 2018
adb0df8
3.2.3
bjnortier Jul 25, 2018
650f5e4
Merge branch 'release/3.2.3'
bjnortier Jul 25, 2018
f7d12b9
Merge branch 'release/3.2.3' into develop
bjnortier Jul 25, 2018
54e96ac
delete old dist/ and lib/ on publish
bjnortier Jul 26, 2018
c7910d5
Updated LICENSE name & dates
bjnortier Sep 4, 2018
815eacd
#34 support DXF files without a TABLES section
bjnortier Sep 4, 2018
29f9a6d
feat(CLI): add dxf-to-svg cli command (#33)
Joge97 Sep 4, 2018
a680e12
Minor cosmetic change in CLI
bjnortier Sep 4, 2018
735c8de
Update package-lock
bjnortier Sep 4, 2018
33d0714
Add new contributors to README
bjnortier Sep 4, 2018
91edc94
3.3.0
bjnortier Sep 4, 2018
2517587
Merge branch 'release/3.3.0'
bjnortier Sep 4, 2018
3dda7e1
Merge branch 'release/3.3.0' into develop
bjnortier Sep 4, 2018
ecc96ce
Add CLI to README
bjnortier Sep 4, 2018
2939027
Merge branch 'develop'
bjnortier Sep 4, 2018
536d006
Correcting typo in README (#37)
jonseitz Oct 9, 2018
a2f0db1
3.3.1
bjnortier Oct 9, 2018
a3e8870
Merge branch 'hotfix/3.3.1'
bjnortier Oct 9, 2018
4829776
Merge branch 'hotfix/3.3.1' into develop
bjnortier Oct 9, 2018
f016237
incorporate b-spline into dxf
bjnortier Jan 16, 2019
a12dad7
convert all unit tests to 'expect'
bjnortier Jan 16, 2019
2cd6cd1
upgrade browserify
bjnortier Jan 16, 2019
9caa6ca
remove b-spline lib import
bjnortier Jan 16, 2019
b75a460
remove BoundingBox and use vecks.Box2
bjnortier Jan 16, 2019
7a8d840
Clean up library exports
bjnortier Jan 16, 2019
fe4c091
#28 move b-spline algorithm into dxf as the lib is no longer maintain…
bjnortier Jan 16, 2019
1ac9f93
3.4.0
bjnortier Jan 16, 2019
b3577d2
Merge branch 'release/3.4.0'
bjnortier Jan 16, 2019
f95f8de
Merge branch 'release/3.4.0' into develop
bjnortier Jan 16, 2019
a16a41d
webpage functional test
bjnortier Jan 16, 2019
2a25d18
Render single test case in functional test
bjnortier Jan 16, 2019
a708504
3.4.1
bjnortier Jan 16, 2019
aece63d
Merge branch 'release/3.4.1'
bjnortier Jan 16, 2019
3269551
Merge branch 'release/3.4.1' into develop
bjnortier Jan 16, 2019
3ed99b7
add colors back to the module
bjnortier Jan 17, 2019
337244a
3.4.2
bjnortier Jan 17, 2019
20c13b2
Merge branch 'release/3.4.2'
bjnortier Jan 17, 2019
9829c4a
Merge branch 'release/3.4.2' into develop
bjnortier Jan 17, 2019
42a9139
#39 fix insert issue the the block has an x and y value
bjnortier Jan 17, 2019
2b265c5
3.4.3
bjnortier Jan 17, 2019
3b78baf
Merge branch 'release/3.4.3'
bjnortier Jan 17, 2019
f23b850
Merge branch 'release/3.4.3' into develop
bjnortier Jan 17, 2019
ba84225
flip on Y axis if zscale === -1
bjnortier Jan 17, 2019
38d0237
3.4.4
bjnortier Jan 17, 2019
d9d45fc
Merge branch 'release/3.4.4'
bjnortier Jan 17, 2019
f09800e
Merge branch 'release/3.4.4' into develop
bjnortier Jan 17, 2019
235a358
rename extrusion & scale variables to be more readable
bjnortier Jan 22, 2019
07b56a9
Add a 'toPolylines' intermediate step for third party renderers
bjnortier Jan 22, 2019
57f8d1c
3.5.0
bjnortier Jan 22, 2019
9dc2a17
Merge branch 'release/3.5.0'
bjnortier Jan 22, 2019
c70ee20
Merge branch 'release/3.5.0' into develop
bjnortier Jan 22, 2019
eccde71
Remove support for Node v6 from Travis config
bjnortier Apr 2, 2019
551c27b
npm audit fixes
bjnortier Apr 2, 2019
d8fb504
3.6.0
bjnortier Apr 2, 2019
3f0d1d8
Merge branch 'release/3.6.0'
bjnortier Apr 2, 2019
53916f4
Merge branch 'release/3.6.0' into develop
bjnortier Apr 2, 2019
3cfb4d1
Fix typo in comment
bjnortier Apr 2, 2019
a5f9ba0
Fix unit test case name
bjnortier Apr 2, 2019
4c21e19
Fix comment
bjnortier Apr 2, 2019
2730abb
New SVG using <circle> and SVG transform is working
bjnortier Apr 2, 2019
9dbca7c
Fix transform ordering
bjnortier Apr 2, 2019
66f958a
Remove old toSVG & add toPolylines on helper
bjnortier Apr 2, 2019
b4c6208
Fix tests
bjnortier Apr 2, 2019
06ebe4f
Refactor get RGB for entity
bjnortier Apr 2, 2019
e45e0d2
add @babel/node for examples
bjnortier Apr 2, 2019
74e7fb1
Fix SVG XML error
bjnortier Apr 2, 2019
9a75e43
Update docs for 4.0 release
bjnortier Apr 2, 2019
e203146
Merge branch 'feature/v4.0' into develop
bjnortier Apr 2, 2019
09cdde0
4.0.0
bjnortier Apr 2, 2019
6a9757e
Merge branch 'release/4.0.0'
bjnortier Apr 2, 2019
4653c84
Merge branch 'release/4.0.0' into develop
bjnortier Apr 2, 2019
695db22
browser example uses Helper
bjnortier Apr 2, 2019
ec380de
4.0.1
bjnortier Apr 2, 2019
91328a1
Merge branch 'release/4.0.1'
bjnortier Apr 2, 2019
1c26d46
Merge branch 'release/4.0.1' into develop
bjnortier Apr 2, 2019
9c3e9ed
remove old paths from .gitignore
bjnortier Apr 15, 2019
cdff113
native <ellipse /> and <path /> for ELLIPSE entities
bjnortier Apr 15, 2019
a6082e4
DXF ARC uses native <ellipse /> or <path d="A..." />
bjnortier Apr 15, 2019
0257e6b
Refactoring & comments
bjnortier Apr 15, 2019
04ef18e
4.1.0
bjnortier Apr 15, 2019
8c2be14
Merge branch 'release/4.1.0'
bjnortier Apr 15, 2019
fb924e7
Merge branch 'release/4.1.0' into develop
bjnortier Apr 15, 2019
a9c59c4
#issue42 support entities that have extrusionZ === -1 defined on the …
bjnortier Jun 24, 2019
ee8094f
remove debug console.log
bjnortier Jun 24, 2019
bd11a60
4.1.1
bjnortier Jun 24, 2019
5938c52
Merge branch 'release/4.1.1'
bjnortier Jun 24, 2019
6f49156
Merge branch 'release/4.1.1' into develop
bjnortier Jun 24, 2019
fa6c9ca
Update README
bjnortier Jun 24, 2019
9e0615c
Update README
bjnortier Jun 24, 2019
d41d1c6
README fixes
bjnortier Jun 24, 2019
6916dc2
Add interpolation section to README
bjnortier Jun 24, 2019
6ba1e41
remove defunct try/catch for bSpline
bjnortier Jul 11, 2019
2ea3dc8
Remove debug statement
bjnortier Jul 11, 2019
d557fb0
#30 Use native SVG Quadratic and Cubic Beziers where possible
bjnortier Jul 12, 2019
4cfe1ae
Merge branch 'master' into develop
bjnortier Jul 12, 2019
89c1ad1
fix switch case for LINE and LWPOLYLINE
bjnortier Jul 12, 2019
9624063
Merge branch 'master' into develop
bjnortier Jul 12, 2019
1aab28f
4.2.0
bjnortier Jul 12, 2019
3104771
Merge branch 'release/4.2.0'
bjnortier Jul 12, 2019
75e9ddf
Merge branch 'release/4.2.0' into develop
bjnortier Jul 12, 2019
85a269b
Use main lodash because of security issue
bjnortier Jul 12, 2019
1cad14c
4.2.1
bjnortier Jul 12, 2019
880c12b
Merge branch 'release/4.2.1'
bjnortier Jul 12, 2019
09b86d0
Merge branch 'release/4.2.1' into develop
bjnortier Jul 12, 2019
cdc7cbf
Add HATCH to unsupported SVG entities in README
bjnortier Aug 8, 2019
da99973
Bump eslint-utils from 1.3.1 to 1.4.2 (#46)
dependabot[bot] Aug 27, 2019
a7d9b90
Merge branch 'master' into develop
bjnortier Aug 27, 2019
928e01a
4.2.2
bjnortier Aug 27, 2019
a732803
Merge branch 'release/4.2.2'
bjnortier Aug 27, 2019
ff398ce
Merge branch 'release/4.2.2' into develop
bjnortier Aug 27, 2019
96c433d
Add tests for elliptical arcs as-is
ericman314 Oct 26, 2019
985f864
Added circular arcs to tests
ericman314 Oct 26, 2019
0a200a0
Refactor ellipseOrArc; reqd to compute bbox
ericman314 Oct 26, 2019
3a4ab6f
Implemented bbox calculation, adjusted tests
ericman314 Oct 26, 2019
4ed9400
More accurate bounding boxes for arcs and ellipses (#48)
ericman314 Oct 30, 2019
7b6920f
Merge branch 'master' into develop
bjnortier Oct 30, 2019
f04c1e9
add example to func tests
bjnortier Oct 30, 2019
f9ee6d5
Add Eric Mansfield to contributors
bjnortier Oct 30, 2019
b1fd1c0
4.2.3
bjnortier Oct 30, 2019
801848a
Merge branch 'release/4.2.3'
bjnortier Oct 30, 2019
f149e55
Merge branch 'release/4.2.3' into develop
bjnortier Oct 30, 2019
285ee66
#50 Fix knot piecewise beziers
bjnortier Oct 30, 2019
cb6150b
4.2.4
bjnortier Oct 30, 2019
57ed228
Merge branch 'release/4.2.4'
bjnortier Oct 30, 2019
712a787
Merge branch 'release/4.2.4' into develop
bjnortier Oct 30, 2019
f3b0a43
eslint standard
bjnortier Nov 4, 2019
ad23350
Fix issue #51 (transforming invalid bounding boxes)
bjnortier Nov 4, 2019
749cb77
update RELEASE
bjnortier Nov 4, 2019
0c34da7
4.3.0
bjnortier Nov 4, 2019
a17d453
Merge branch 'release/4.3.0'
bjnortier Nov 4, 2019
040b05c
Merge branch 'release/4.3.0' into develop
bjnortier Nov 4, 2019
ff099dc
Update RELEASE
bjnortier Nov 4, 2019
c38dc3c
#51 - ignore invalid bounding boxes when expanding
bjnortier Nov 4, 2019
e0fbf7e
4.3.1
bjnortier Nov 4, 2019
c95127c
Merge branch 'release/4.3.1'
bjnortier Nov 4, 2019
137f656
Merge branch 'release/4.3.1' into develop
bjnortier Nov 4, 2019
ae5c8a8
#52 Fix transformation bug when inserting blocks
bjnortier Dec 10, 2019
2edb67b
4.3.2
bjnortier Dec 10, 2019
a7c1785
Merge tag '4.3.2' into develop
bjnortier Dec 10, 2019
746a887
Merge branch 'release/4.3.2'
bjnortier Dec 10, 2019
53edd4e
Update webpack to fix security issue
bjnortier Dec 10, 2019
30ca057
4.3.3
bjnortier Dec 10, 2019
b0b6d59
Merge tag '4.3.3' into develop
bjnortier Dec 10, 2019
00738c9
Merge branch 'release/4.3.3'
bjnortier Dec 10, 2019
e96ddb0
#53 Fix numerical precision issue for Splines
bjnortier Jan 7, 2020
e8f5111
Update dependencies
bjnortier Jan 7, 2020
816b5ab
4.3.4
bjnortier Jan 7, 2020
437f3a4
Merge branch 'release/4.3.4'
bjnortier Jan 7, 2020
d90732f
Merge tag '4.3.4' into develop
bjnortier Jan 7, 2020
49a7603
Fix compile script
bjnortier Jan 7, 2020
90336ab
Add #53 test case to functional tests
bjnortier Jan 9, 2020
500e795
Add support for 3DFACE
bjnortier Jan 28, 2020
7c9688a
4.3.5
bjnortier Jan 28, 2020
f9c03d7
Merge tag '4.3.5' into develop
bjnortier Jan 28, 2020
445b3be
Merge branch 'release/4.3.5'
bjnortier Jan 28, 2020
68324b0
Add 'measurement' and 'insUnits' to parsed header
bjnortier Feb 3, 2020
5fc9b58
4.3.6
bjnortier Feb 3, 2020
72da235
Merge branch 'release/4.3.6'
bjnortier Feb 3, 2020
62f567e
Merge tag '4.3.6' into develop
bjnortier Feb 3, 2020
e138b49
Bump acorn from 6.4.0 to 6.4.1 (#56)
dependabot[bot] Mar 16, 2020
024fd0a
Merge remote-tracking branch 'origin/master' into develop
bjnortier Mar 16, 2020
2c06e8f
npm audit fix
bjnortier Mar 16, 2020
b4dca09
4.3.7
bjnortier Mar 16, 2020
bd86db8
Merge tag '4.3.7' into develop
bjnortier Mar 16, 2020
76b7fc1
Merge branch 'release/4.3.7'
bjnortier Mar 16, 2020
0f7e9e5
npm update
bjnortier Mar 16, 2020
f87ad95
4.3.8
bjnortier Mar 16, 2020
6b7ed01
Merge tag '4.3.8' into develop
bjnortier Mar 16, 2020
ded6ca6
Merge branch 'release/4.3.8'
bjnortier Mar 16, 2020
509897c
Merge remote-tracking branch 'upstream/master'
ericman314 Apr 23, 2020
6f3d8d3
Support rectangular arrays
ericman314 Apr 23, 2020
ce4e56a
Make DXF example verbose
bjnortier Apr 23, 2020
3e8ffc2
Merge branch 'develop' into ericman314-feature/arrayed_insert
bjnortier Apr 23, 2020
11819e9
Fix != issue
bjnortier Apr 23, 2020
4b33ac2
Fix null-ish issue
bjnortier Apr 23, 2020
9c302e8
Add arrays to functional tests
bjnortier Apr 23, 2020
4cd211b
4.4.0
bjnortier Apr 23, 2020
b6d1e3d
Merge tag '4.4.0' into develop
bjnortier Apr 23, 2020
552e6b8
Merge branch 'release/4.4.0'
bjnortier Apr 23, 2020
52b3147
Security updates
bjnortier Jun 8, 2020
1a026be
4.4.1
bjnortier Jun 8, 2020
55de892
Merge branch 'release/4.4.1'
bjnortier Jun 8, 2020
4d5c8f8
Merge tag '4.4.1' into develop
bjnortier Jun 8, 2020
bc4e32b
Bump lodash from 4.17.15 to 4.17.19 (#62)
dependabot[bot] Jul 16, 2020
510e53f
Merge branch 'master' into develop
bjnortier Jul 16, 2020
900a8e0
update libs
bjnortier Jul 16, 2020
7fba425
4.2.
bjnortier Jul 16, 2020
216a952
Merge branch 'release/4.4.2'
bjnortier Jul 16, 2020
5962910
Merge tag '4.4.2' into develop
bjnortier Jul 16, 2020
8c29270
Bump ini from 1.3.5 to 1.3.7 (#64)
dependabot[bot] Jan 12, 2021
066b871
Merge branch 'master' into develop
bjnortier Jan 12, 2021
6a4736e
Parse and convert splines with weighted control pts (#65)
ericman314 Jan 12, 2021
32c808d
npm audit fix
bjnortier Jan 12, 2021
bdcdc93
4.4.3
bjnortier Jan 12, 2021
4bc3c53
Merge tag '4.4.3' into develop
bjnortier Jan 12, 2021
e012b4a
Merge branch 'release/4.4.3'
bjnortier Jan 12, 2021
10b1c0e
Fix typo in README
bjnortier Jan 19, 2021
b2c8a25
4.4.4
bjnortier Jan 19, 2021
edce48e
Merge tag '4.4.4' into develop
bjnortier Jan 19, 2021
47b0fa1
Merge branch 'release/4.4.4'
bjnortier Jan 19, 2021
134a6e0
Removed round10 dependency, added round10 function based on MDN examp…
rla May 3, 2021
441bd6b
npm audit fix
May 3, 2021
b0956d0
4.4.5
May 3, 2021
2b946b7
Merge branch 'release/4.4.5'
May 3, 2021
a6a850b
Merge tag '4.4.5' into develop
May 3, 2021
0e17fd3
Parsing of DIMENSION (#74)
kriffe May 27, 2021
67b3912
Merge branch 'master' into develop
May 27, 2021
040db1c
4.5.0
May 27, 2021
dd0659f
Merge branch 'release/4.5.0'
May 27, 2021
229d572
Merge tag '4.5.0' into develop
May 27, 2021
b9cae8d
Added contributor
May 27, 2021
b3ee163
Parsing of TEXT (#75)
kriffe Jun 8, 2021
6a5e42a
Bump ws from 6.2.1 to 6.2.2 (#76)
dependabot[bot] Jun 8, 2021
e4bb2f8
4.6.0
Jun 8, 2021
2cfec8d
Merge tag '4.6.0' into develop
Jun 8, 2021
c82c3f9
Merge branch 'release/4.6.0'
Jun 8, 2021
c444498
20210608 dimension patch (#77)
kriffe Jun 11, 2021
02f98c9
Merge branch 'develop' of github.com:bjnortier/dxf into develop
Jun 11, 2021
23cbbab
20210608 dimension patch 2 (#78)
kriffe Jun 11, 2021
0699245
Merge branch 'develop' of github.com:bjnortier/dxf into develop
Jun 11, 2021
946fbff
4.6.1
Jun 11, 2021
4216f50
Merge branch 'release/4.6.1'
Jun 11, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .babelrc

This file was deleted.

39 changes: 39 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": [
"plugin:react/recommended", "standard", "standard-react"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly",
"describe": "readonly",
"it": "readonly",
"before": "readonly",
"after": "readonly",
"beforeEach": "readonly",
"afterEach": "readonly"
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"react", "babel"
],
"parser": "babel-eslint",
"rules": {
"jest/valid-describe": 0
},
"settings": {
"react": {
"version": "detect"
}
}
}
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
node_modules/
test/functional/output/*.output.svg
test/functional/lib/
lib/
dist/
test/resources/#*
examples/example.es5.svg
examples/example.es6.svg
.DS_Store
*~
#*
.idea
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
babel.config.js
test/
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: node_js
node_js:
- "6"
- "7"
before_install: npm install -g gulp-cli
- "8"
- "10"
install: npm install
sudo: false
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014 Benjamin Nortier
Copyright (c) 2014-2018 Ben Nortier

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
92 changes: 78 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,112 @@

DXF parser for node/browser.

Uses several ES6 features in the source code (import, classes, let, const, arrows) but is packaged using babel so you can use it legacy JS environments.
Uses several ES6 features in the source code (import, classes, let, const, arrows) but is packaged using babel so you can use it in legacy JS environments.

Version 2.0 is a complete rewrite from the first attempt to write it in a SAX style, which wasn't really appropriate for a document with nested references (e.g inserts referencing blocks, nested inserts).

Version 3.0 converted the codebase to use [standard JS](https://standardjs.com), ES6 imports, stop using Gulp, and updated & removed some dependencies.
Version 3.0 converted the codebase to use [standard JS](https://standardjs.com), ES6 imports, stopped using Gulp, and updated & removed some dependencies.

Version 4.x is in progress and the aim is to use native SVG elements where possible, e.g. `<circle />`, `<ellipse />` etc. 4.0 introduces the `<circle />` element.

At this point in time, the important geometric entities are supported, but notably:

* MTEXT
* DIMENSION
* STYLE
* HATCH

and some others are **parsed**, but are **not supported for SVG rendering** (see section below on SVG rendering)

## Getting started

There is an ES5 and ES6 example in the ```examples/``` directory that show how to use the library, but there are 3 basic steps:
There is an ES5 and ES6 example in the ```examples/``` directory that show how to use the library. There are exposed functions for advanced users, but for the majority of users you can use the `Helper` object to get the data you're interested in (or convert to SVG):

```
const helper = new Helper(<DXF String>)

// The 1-to-1 object representation of the DXF
console.log('parsed:', helper.parsed)

1. Parse the DXF contents using ```dxf.parseString(<contents>)```. This will return an object representation of the DXF contents.
1. Denormalise the entities into an array using ```dxf.denormalize(<parsed>)```. After Step 1, the entities are still in the block hierarchy of the DXF file, denormalizing will create the *resulting* entities with the block transforms applied.
1. (Optional) Create an SVG using ```dxf.toSVG(<parsed>)```. Please refer to the SVG section below regarding limitations.
// Denormalised blocks inserted with transforms applied
console.log('denormalised:', helper.denormalised)

// Create an SVG
console.log('svg:', helper.toSVG())

// Create polylines (e.g. to render in WebGL)
console.log('polylines:', helper.toPolylines())
```

## Running the Examples

Node ES5:
`$ node examples/example.es5.js`
Node ES5. Will write an SVG to `examples/example.es5.svg`:

```
$ node examples/example.es5.js
```

Node ES6:
`$ babel-node examples/example.es6.js`
Node ES6. Will write an SVG to `examples/example.es6.svg`:

Browser:
`$ open examples/dxf.html`
```
$ npx babel-node examples/example.es6.js
```

Browser. Compile to a browser bundle and open the example webpage:

```
$ npm run compile
$ open examples/dxf.html
```

## SVG

The initial aim of this library was to support rendering of the main geometric components, not dimensions, text, hatches and styles. There is a mechanism for converting the parsed entities to SVG, but they are **all converted to polylines**, and if you look at the resulting SVG files when running the functional tests, you will see that all entities are rendered as paths.
Geometric elements are supported, but dimensions, text, hatches and styles (except for line colors) are ***not***.

Native SVG elements are used as far as possible for curved entities (`<circle />`, `<ellipse/>` etc.), ***except for the SPLINE entity***, which is interpolated.

Here's an example you will find in the functional test output:

![svg example image](https://cloud.githubusercontent.com/assets/57994/17583566/e00f5d78-5fb1-11e6-9030-55686f980e6f.png)

## Interpolation

The library supports outputting DXFs as interpolated polylines for custom rendering (e.g. WebGL) or other applications, by using:


```
> helper.toPolylines()
```


## Command line

There is a command-line utility (courtesy of [@Joge97](https://github.com/Joge97)) for converting DXF files to SVG:

```
$ npm i -g dxf
$ dxf-to-svg

Usage: dxf-to-svg [options] <dxfFile> [svgFile]

Converts a dxf file to a svg file.

Options:

-V, --version output the version number
-v --verbose Verbose output
-h, --help output usage information
```

## Tests

Running

```$ npm test```

will execute the unit tests and functional tests, which generate SVGs for reference DXF files. You can view these SVGs (located in test/functional/output) in a browser or other SVG viewer to see what is supported.
will execute the unit tests.

```$ npm run test:functional``` will run the functional tests in a browser. Please open `toSVG.html` when the file listing loads in the browser (or open `http://localhost:8030/toSVG.html#/`).

### Contributors

Expand All @@ -61,3 +119,9 @@ will execute the unit tests and functional tests, which generate SVGs for refere
- Ivan Baktsheev https://github.com/apla
- Jeff Chen https://github.com/jeffontheground
- Markko Paas https://github.com/markkopaas
- Kim Lokøy https://github.com/klokoy
- Erik Söhnel https://github.com/hoeck
- Teja https://github.com/hungerpirat
- Jakob Pallhuber https://github.com/Joge97
- Eric Mansfield https://github.com/ericman314
- Kristofer https://github.com/kriffe
44 changes: 44 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
4.4.4
- Fix typo in README

4.3.0
- #51 Fix bug when transforming empty bounding box

4.2.4
- #50 Fix knot piecewise beziers

4.2.3
- More accurate bounding boxes for arcs and ellipses (#48)

4.2.2
- Bump eslint-utils from 1.3.1 to 1.4.2
- Add HATCH to unsupported SVG entities in README

4.2.1
- Use main lodash package due to security issue(s)

4.2.0
- README updates

4.1.1
- #issue42 support entities that have extrusionZ === -1 defined on the entity itself (as opposed to the transform).

4.1.0
- CIRCLE DXF entities now produce native <circle /> SVG elements.
- ELLIPSE DXF entities now produce native <path d="A..."/> or <ellipse /> SVG elements.
- ARC DXF entities now produce native <path d="A..."/> or <ellipse /> SVG elements.

4.0.1
- Browser example uses Helper

4.0.0
- Use ES6 string interpolation in SVG generation.
- Use native SVG <circle /> elements for CIRCLE entities.
- Use SVG <g/> elements with a transform attribute for native and interpolated entities.
- Add a Helper object to simplify the workflow.
- The SVG output uses a root transform to flip the Y coordinates.

3.6.0
- NPM audit fixes.
- Remove support for Node v6 in Travis.
- Node engine is now >= 8.9.0.
5 changes: 5 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const presets = [
'@babel/env'
]

module.exports = { presets }
Loading