dxf-json 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/FUNDING.yml +1 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- package/.github/ISSUE_TEMPLATE/custom.md +10 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/.github/pull_request_template.md +23 -0
- package/.github/workflows/npm-publish.yml +55 -0
- package/.swcrc +8 -0
- package/LICENSE +674 -0
- package/README.md +567 -0
- package/jest.config.js +20 -0
- package/package.json +56 -0
- package/src/consts/block.ts +22 -0
- package/src/consts/color.ts +6 -0
- package/src/consts/config.ts +2 -0
- package/src/consts/dimension.ts +69 -0
- package/src/consts/hatch.ts +52 -0
- package/src/consts/header.ts +10 -0
- package/src/consts/index.ts +9 -0
- package/src/consts/lineweight.ts +5 -0
- package/src/consts/measurement.ts +4 -0
- package/src/consts/obscuredLineTypes.ts +21 -0
- package/src/consts/scene.ts +2 -0
- package/src/consts/viewport.ts +62 -0
- package/src/index.ts +6 -0
- package/src/parser/AutoCadColorIndex.ts +265 -0
- package/src/parser/DxfArrayScanner.ts +161 -0
- package/src/parser/DxfParser.ts +108 -0
- package/src/parser/ParseHelpers.ts +124 -0
- package/src/parser/blocks/blocks.test.ts +97 -0
- package/src/parser/blocks/index.ts +88 -0
- package/src/parser/blocks/types.ts +15 -0
- package/src/parser/entities/arc/index.ts +2 -0
- package/src/parser/entities/arc/parser.ts +67 -0
- package/src/parser/entities/arc/types.ts +13 -0
- package/src/parser/entities/attdef/consts.ts +12 -0
- package/src/parser/entities/attdef/index.ts +3 -0
- package/src/parser/entities/attdef/parser.ts +119 -0
- package/src/parser/entities/attdef/types.ts +19 -0
- package/src/parser/entities/attribute/consts.ts +6 -0
- package/src/parser/entities/attribute/index.ts +3 -0
- package/src/parser/entities/attribute/parser.ts +198 -0
- package/src/parser/entities/attribute/types.ts +31 -0
- package/src/parser/entities/circle/index.ts +2 -0
- package/src/parser/entities/circle/parser.ts +58 -0
- package/src/parser/entities/circle/types.ts +11 -0
- package/src/parser/entities/dimension/common.ts +98 -0
- package/src/parser/entities/dimension/index.ts +24 -0
- package/src/parser/entities/dimension/types.ts +65 -0
- package/src/parser/entities/ellipse/index.ts +2 -0
- package/src/parser/entities/ellipse/parser.ts +66 -0
- package/src/parser/entities/ellipse/types.ts +13 -0
- package/src/parser/entities/entities.test.ts +86 -0
- package/src/parser/entities/hatch/boundaryPathData/edge.ts +190 -0
- package/src/parser/entities/hatch/boundaryPathData/index.ts +27 -0
- package/src/parser/entities/hatch/boundaryPathData/polyline.ts +43 -0
- package/src/parser/entities/hatch/boundaryPathData/shared.ts +16 -0
- package/src/parser/entities/hatch/index.ts +189 -0
- package/src/parser/entities/hatch/patternData.ts +57 -0
- package/src/parser/entities/hatch/types/boundaryPath.ts +72 -0
- package/src/parser/entities/hatch/types/definitionLine.ts +14 -0
- package/src/parser/entities/hatch/types/hatch.ts +47 -0
- package/src/parser/entities/hatch/types/index.ts +3 -0
- package/src/parser/entities/index.ts +87 -0
- package/src/parser/entities/insert/index.ts +2 -0
- package/src/parser/entities/insert/parser.ts +106 -0
- package/src/parser/entities/insert/types.ts +19 -0
- package/src/parser/entities/leader/consts.ts +6 -0
- package/src/parser/entities/leader/index.ts +3 -0
- package/src/parser/entities/leader/parser.ts +119 -0
- package/src/parser/entities/leader/types.ts +24 -0
- package/src/parser/entities/line/index.ts +2 -0
- package/src/parser/entities/line/parser.ts +55 -0
- package/src/parser/entities/line/types.ts +11 -0
- package/src/parser/entities/lwpolyline/consts.ts +4 -0
- package/src/parser/entities/lwpolyline/index.ts +3 -0
- package/src/parser/entities/lwpolyline/parser.ts +122 -0
- package/src/parser/entities/lwpolyline/types.ts +21 -0
- package/src/parser/entities/mtext/consts.ts +5 -0
- package/src/parser/entities/mtext/index.ts +3 -0
- package/src/parser/entities/mtext/parser.ts +195 -0
- package/src/parser/entities/mtext/types.ts +34 -0
- package/src/parser/entities/point/index.ts +2 -0
- package/src/parser/entities/point/parser.ts +60 -0
- package/src/parser/entities/point/types.ts +10 -0
- package/src/parser/entities/polyline/consts.ts +17 -0
- package/src/parser/entities/polyline/index.ts +3 -0
- package/src/parser/entities/polyline/parser.ts +126 -0
- package/src/parser/entities/polyline/types.ts +20 -0
- package/src/parser/entities/section/index.ts +2 -0
- package/src/parser/entities/section/parser.ts +104 -0
- package/src/parser/entities/section/types.ts +20 -0
- package/src/parser/entities/shared.ts +166 -0
- package/src/parser/entities/solid/index.ts +2 -0
- package/src/parser/entities/solid/parser.ts +56 -0
- package/src/parser/entities/solid/types.ts +10 -0
- package/src/parser/entities/spline/consts.ts +8 -0
- package/src/parser/entities/spline/index.ts +3 -0
- package/src/parser/entities/spline/parser.ts +121 -0
- package/src/parser/entities/spline/types.ts +22 -0
- package/src/parser/entities/text/consts.ts +21 -0
- package/src/parser/entities/text/index.ts +3 -0
- package/src/parser/entities/text/parser.ts +117 -0
- package/src/parser/entities/text/types.ts +21 -0
- package/src/parser/entities/vertex/consts.ts +10 -0
- package/src/parser/entities/vertex/index.ts +3 -0
- package/src/parser/entities/vertex/parser.ts +90 -0
- package/src/parser/entities/vertex/types.ts +17 -0
- package/src/parser/entities/viewport/index.ts +178 -0
- package/src/parser/entities/viewport/types.ts +58 -0
- package/src/parser/filterDummyBlocks.ts +49 -0
- package/src/parser/header/index.ts +30 -0
- package/src/parser/objects/common.ts +55 -0
- package/src/parser/objects/dictionary.ts +61 -0
- package/src/parser/objects/index.ts +45 -0
- package/src/parser/objects/layout.ts +136 -0
- package/src/parser/objects/plotSettings.ts +231 -0
- package/src/parser/objects/treefy.ts +53 -0
- package/src/parser/objects/types.ts +17 -0
- package/src/parser/shared/index.ts +21 -0
- package/src/parser/shared/parsePoint.ts +37 -0
- package/src/parser/shared/parserGenerator.test.ts +164 -0
- package/src/parser/shared/parserGenerator.ts +180 -0
- package/src/parser/shared/xdata/index.ts +3 -0
- package/src/parser/shared/xdata/interpreter.test.ts +85 -0
- package/src/parser/shared/xdata/interpreter.ts +65 -0
- package/src/parser/shared/xdata/parser.test.ts +66 -0
- package/src/parser/shared/xdata/parser.ts +140 -0
- package/src/parser/shared/xdata/types.ts +22 -0
- package/src/parser/tables/blockRecord/index.ts +2 -0
- package/src/parser/tables/blockRecord/parser.ts +49 -0
- package/src/parser/tables/blockRecord/types.ts +11 -0
- package/src/parser/tables/dimStyle/consts.ts +428 -0
- package/src/parser/tables/dimStyle/index.ts +3 -0
- package/src/parser/tables/dimStyle/parser.ts +37 -0
- package/src/parser/tables/dimStyle/types.ts +164 -0
- package/src/parser/tables/index.ts +2 -0
- package/src/parser/tables/layer/index.ts +2 -0
- package/src/parser/tables/layer/parser.ts +58 -0
- package/src/parser/tables/layer/types.ts +14 -0
- package/src/parser/tables/ltype/consts.ts +6 -0
- package/src/parser/tables/ltype/index.ts +3 -0
- package/src/parser/tables/ltype/parser.ts +110 -0
- package/src/parser/tables/ltype/types.ts +23 -0
- package/src/parser/tables/parser.ts +100 -0
- package/src/parser/tables/shared.ts +32 -0
- package/src/parser/tables/style/index.ts +2 -0
- package/src/parser/tables/style/parser.ts +70 -0
- package/src/parser/tables/style/types.ts +15 -0
- package/src/parser/tables/types.ts +15 -0
- package/src/parser/tables/vport/index.ts +2 -0
- package/src/parser/tables/vport/parser.ts +205 -0
- package/src/parser/tables/vport/types.ts +48 -0
- package/src/parser/types.ts +30 -0
- package/src/types/color.ts +5 -0
- package/src/types/dxfHeader.ts +21 -0
- package/src/types/entity.ts +7 -0
- package/src/types/index.ts +30 -0
- package/src/utils/binarySearch.ts +20 -0
- package/src/utils/disjointSet.ts +52 -0
- package/src/utils/flooding.ts +37 -0
- package/src/utils/functional.ts +124 -0
- package/src/utils/graph.ts +53 -0
- package/src/utils/index.ts +102 -0
- package/src/utils/queue.ts +77 -0
- package/src/utils/triangle.ts +28 -0
- package/tsconfig.json +34 -0
- package/webpack.config.js +46 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
github: [dotoritos-kim]
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Create a report to help us improve
|
|
4
|
+
title: ''
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Describe the bug**
|
|
11
|
+
A clear and concise description of what the bug is.
|
|
12
|
+
|
|
13
|
+
**To Reproduce**
|
|
14
|
+
Steps to reproduce the behavior:
|
|
15
|
+
1. Go to '...'
|
|
16
|
+
2. Click on '....'
|
|
17
|
+
3. Scroll down to '....'
|
|
18
|
+
4. See error
|
|
19
|
+
|
|
20
|
+
**Expected behavior**
|
|
21
|
+
A clear and concise description of what you expected to happen.
|
|
22
|
+
|
|
23
|
+
**Screenshots**
|
|
24
|
+
If applicable, add screenshots to help explain your problem.
|
|
25
|
+
|
|
26
|
+
**Desktop (please complete the following information):**
|
|
27
|
+
- OS: [e.g. iOS]
|
|
28
|
+
- Browser [e.g. chrome, safari]
|
|
29
|
+
- Version [e.g. 22]
|
|
30
|
+
|
|
31
|
+
**Smartphone (please complete the following information):**
|
|
32
|
+
- Device: [e.g. iPhone6]
|
|
33
|
+
- OS: [e.g. iOS8.1]
|
|
34
|
+
- Browser [e.g. stock browser, safari]
|
|
35
|
+
- Version [e.g. 22]
|
|
36
|
+
|
|
37
|
+
**Additional context**
|
|
38
|
+
Add any other context about the problem here.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest an idea for this project
|
|
4
|
+
title: ''
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Is your feature request related to a problem? Please describe.**
|
|
11
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
12
|
+
|
|
13
|
+
**Describe the solution you'd like**
|
|
14
|
+
A clear and concise description of what you want to happen.
|
|
15
|
+
|
|
16
|
+
**Describe alternatives you've considered**
|
|
17
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
|
18
|
+
|
|
19
|
+
**Additional context**
|
|
20
|
+
Add any other context or screenshots about the feature request here.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
## Overview
|
|
2
|
+
<!---- Please briefly describe the changes and related issues. Please explain what and why you modified it rather than how. -->
|
|
3
|
+
|
|
4
|
+
<!---- Resolves: #(Isuue Number) -->
|
|
5
|
+
|
|
6
|
+
## PR category
|
|
7
|
+
What changes?
|
|
8
|
+
|
|
9
|
+
- [ ] Add new features
|
|
10
|
+
- [ ] Bug fix
|
|
11
|
+
- [ ] Changes that do not affect the code (correct typos, change tab size, change variable names)
|
|
12
|
+
- [ ] Code refactoring
|
|
13
|
+
- [ ] Add and edit comments
|
|
14
|
+
- [ ] Edit document
|
|
15
|
+
- [ ] Add tests, refactor tests
|
|
16
|
+
- [ ] Edit the build part or package manager
|
|
17
|
+
- [ ] Edit file or folder name
|
|
18
|
+
- [ ] Delete file or folder
|
|
19
|
+
|
|
20
|
+
## PR Checklist
|
|
21
|
+
Make sure your PR meets the following requirements:
|
|
22
|
+
|
|
23
|
+
- [ ] Tested the changes (bug fixes/tested features).
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
2
|
+
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
|
|
3
|
+
|
|
4
|
+
name: dxf-json package
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v3
|
|
16
|
+
- uses: actions/setup-node@v3
|
|
17
|
+
with:
|
|
18
|
+
node-version: 18
|
|
19
|
+
- run: npm ci
|
|
20
|
+
- run: npm run test:parser
|
|
21
|
+
setup-build-deploy:
|
|
22
|
+
needs: build
|
|
23
|
+
name: Setup, Build, and Deploy
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
permissions:
|
|
26
|
+
packages: write
|
|
27
|
+
contents: write
|
|
28
|
+
id-token: write
|
|
29
|
+
|
|
30
|
+
steps:
|
|
31
|
+
- name: Bump version and push tag
|
|
32
|
+
id: tag_version
|
|
33
|
+
uses: mathieudutour/github-tag-action@v6.1
|
|
34
|
+
with:
|
|
35
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
36
|
+
|
|
37
|
+
- name: Create a GitHub release
|
|
38
|
+
uses: ncipollo/release-action@v1
|
|
39
|
+
with:
|
|
40
|
+
tag: ${{ steps.tag_version.outputs.new_tag }}
|
|
41
|
+
name: Release ${{ steps.tag_version.outputs.new_tag }}
|
|
42
|
+
body: ${{ steps.tag_version.outputs.changelog }}
|
|
43
|
+
- uses: actions/checkout@v3
|
|
44
|
+
- uses: actions/setup-node@v3
|
|
45
|
+
with:
|
|
46
|
+
node-version: 18
|
|
47
|
+
registry-url: https://registry.npmjs.org
|
|
48
|
+
- run: npm ci
|
|
49
|
+
- run: git config --global user.name "${{ github.actor }}"
|
|
50
|
+
- run: git config --global user.email "github-action-${{ github.actor }}@users.noreply.github.com"
|
|
51
|
+
- run: npm run build
|
|
52
|
+
- run: npm version ${{ steps.tag_version.outputs.new_tag }}
|
|
53
|
+
- run: npm publish
|
|
54
|
+
env:
|
|
55
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|