dxf-json 0.0.21 → 0.0.22
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/package.json +5 -2
- package/.github/FUNDING.yml +0 -1
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -38
- package/.github/ISSUE_TEMPLATE/custom.md +0 -10
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/.github/pull_request_template.md +0 -23
- package/.github/workflows/npm-publish.yml +0 -55
- package/.swcrc +0 -8
- package/jest.config.js +0 -20
- package/src/consts/block.ts +0 -22
- package/src/consts/color.ts +0 -6
- package/src/consts/config.ts +0 -2
- package/src/consts/dimension.ts +0 -69
- package/src/consts/hatch.ts +0 -52
- package/src/consts/header.ts +0 -10
- package/src/consts/index.ts +0 -9
- package/src/consts/lineweight.ts +0 -5
- package/src/consts/measurement.ts +0 -4
- package/src/consts/obscuredLineTypes.ts +0 -21
- package/src/consts/scene.ts +0 -2
- package/src/consts/viewport.ts +0 -62
- package/src/index.ts +0 -3
- package/src/parser/AutoCadColorIndex.ts +0 -265
- package/src/parser/DxfArrayScanner.ts +0 -161
- package/src/parser/DxfParser.ts +0 -109
- package/src/parser/ParseHelpers.ts +0 -124
- package/src/parser/blocks/blocks.test.ts +0 -97
- package/src/parser/blocks/index.ts +0 -88
- package/src/parser/blocks/types.ts +0 -15
- package/src/parser/entities/arc/index.ts +0 -2
- package/src/parser/entities/arc/parser.ts +0 -67
- package/src/parser/entities/arc/types.ts +0 -13
- package/src/parser/entities/attdef/consts.ts +0 -12
- package/src/parser/entities/attdef/index.ts +0 -3
- package/src/parser/entities/attdef/parser.ts +0 -119
- package/src/parser/entities/attdef/types.ts +0 -19
- package/src/parser/entities/attribute/consts.ts +0 -6
- package/src/parser/entities/attribute/index.ts +0 -3
- package/src/parser/entities/attribute/parser.ts +0 -198
- package/src/parser/entities/attribute/types.ts +0 -31
- package/src/parser/entities/circle/index.ts +0 -2
- package/src/parser/entities/circle/parser.ts +0 -58
- package/src/parser/entities/circle/types.ts +0 -11
- package/src/parser/entities/dimension/common.ts +0 -98
- package/src/parser/entities/dimension/index.ts +0 -24
- package/src/parser/entities/dimension/types.ts +0 -65
- package/src/parser/entities/ellipse/index.ts +0 -2
- package/src/parser/entities/ellipse/parser.ts +0 -66
- package/src/parser/entities/ellipse/types.ts +0 -13
- package/src/parser/entities/entities.test.ts +0 -86
- package/src/parser/entities/hatch/boundaryPathData/edge.ts +0 -190
- package/src/parser/entities/hatch/boundaryPathData/index.ts +0 -27
- package/src/parser/entities/hatch/boundaryPathData/polyline.ts +0 -43
- package/src/parser/entities/hatch/boundaryPathData/shared.ts +0 -16
- package/src/parser/entities/hatch/index.ts +0 -189
- package/src/parser/entities/hatch/patternData.ts +0 -57
- package/src/parser/entities/hatch/types/boundaryPath.ts +0 -72
- package/src/parser/entities/hatch/types/definitionLine.ts +0 -14
- package/src/parser/entities/hatch/types/hatch.ts +0 -47
- package/src/parser/entities/hatch/types/index.ts +0 -3
- package/src/parser/entities/index.ts +0 -87
- package/src/parser/entities/insert/index.ts +0 -2
- package/src/parser/entities/insert/parser.ts +0 -106
- package/src/parser/entities/insert/types.ts +0 -19
- package/src/parser/entities/leader/consts.ts +0 -6
- package/src/parser/entities/leader/index.ts +0 -3
- package/src/parser/entities/leader/parser.ts +0 -119
- package/src/parser/entities/leader/types.ts +0 -24
- package/src/parser/entities/line/index.ts +0 -2
- package/src/parser/entities/line/parser.ts +0 -55
- package/src/parser/entities/line/types.ts +0 -11
- package/src/parser/entities/lwpolyline/consts.ts +0 -4
- package/src/parser/entities/lwpolyline/index.ts +0 -3
- package/src/parser/entities/lwpolyline/parser.ts +0 -122
- package/src/parser/entities/lwpolyline/types.ts +0 -21
- package/src/parser/entities/mtext/consts.ts +0 -5
- package/src/parser/entities/mtext/index.ts +0 -3
- package/src/parser/entities/mtext/parser.ts +0 -195
- package/src/parser/entities/mtext/types.ts +0 -34
- package/src/parser/entities/point/index.ts +0 -2
- package/src/parser/entities/point/parser.ts +0 -60
- package/src/parser/entities/point/types.ts +0 -10
- package/src/parser/entities/polyline/consts.ts +0 -17
- package/src/parser/entities/polyline/index.ts +0 -3
- package/src/parser/entities/polyline/parser.ts +0 -126
- package/src/parser/entities/polyline/types.ts +0 -20
- package/src/parser/entities/section/index.ts +0 -2
- package/src/parser/entities/section/parser.ts +0 -104
- package/src/parser/entities/section/types.ts +0 -20
- package/src/parser/entities/shared.ts +0 -166
- package/src/parser/entities/solid/index.ts +0 -2
- package/src/parser/entities/solid/parser.ts +0 -56
- package/src/parser/entities/solid/types.ts +0 -10
- package/src/parser/entities/spline/consts.ts +0 -8
- package/src/parser/entities/spline/index.ts +0 -3
- package/src/parser/entities/spline/parser.ts +0 -121
- package/src/parser/entities/spline/types.ts +0 -22
- package/src/parser/entities/text/consts.ts +0 -21
- package/src/parser/entities/text/index.ts +0 -3
- package/src/parser/entities/text/parser.ts +0 -117
- package/src/parser/entities/text/types.ts +0 -21
- package/src/parser/entities/vertex/consts.ts +0 -10
- package/src/parser/entities/vertex/index.ts +0 -3
- package/src/parser/entities/vertex/parser.ts +0 -90
- package/src/parser/entities/vertex/types.ts +0 -17
- package/src/parser/entities/viewport/index.ts +0 -178
- package/src/parser/entities/viewport/types.ts +0 -58
- package/src/parser/filterDummyBlocks.ts +0 -49
- package/src/parser/header/index.ts +0 -30
- package/src/parser/objects/common.ts +0 -55
- package/src/parser/objects/dictionary.ts +0 -61
- package/src/parser/objects/index.ts +0 -45
- package/src/parser/objects/layout.ts +0 -136
- package/src/parser/objects/plotSettings.ts +0 -231
- package/src/parser/objects/treefy.ts +0 -53
- package/src/parser/objects/types.ts +0 -17
- package/src/parser/shared/index.ts +0 -21
- package/src/parser/shared/parsePoint.ts +0 -37
- package/src/parser/shared/parserGenerator.test.ts +0 -164
- package/src/parser/shared/parserGenerator.ts +0 -180
- package/src/parser/shared/xdata/index.ts +0 -3
- package/src/parser/shared/xdata/interpreter.test.ts +0 -85
- package/src/parser/shared/xdata/interpreter.ts +0 -65
- package/src/parser/shared/xdata/parser.test.ts +0 -66
- package/src/parser/shared/xdata/parser.ts +0 -140
- package/src/parser/shared/xdata/types.ts +0 -22
- package/src/parser/tables/blockRecord/index.ts +0 -2
- package/src/parser/tables/blockRecord/parser.ts +0 -49
- package/src/parser/tables/blockRecord/types.ts +0 -11
- package/src/parser/tables/dimStyle/consts.ts +0 -428
- package/src/parser/tables/dimStyle/index.ts +0 -3
- package/src/parser/tables/dimStyle/parser.ts +0 -37
- package/src/parser/tables/dimStyle/types.ts +0 -164
- package/src/parser/tables/index.ts +0 -2
- package/src/parser/tables/layer/index.ts +0 -2
- package/src/parser/tables/layer/parser.ts +0 -58
- package/src/parser/tables/layer/types.ts +0 -14
- package/src/parser/tables/ltype/consts.ts +0 -6
- package/src/parser/tables/ltype/index.ts +0 -3
- package/src/parser/tables/ltype/parser.ts +0 -110
- package/src/parser/tables/ltype/types.ts +0 -23
- package/src/parser/tables/parser.ts +0 -100
- package/src/parser/tables/shared.ts +0 -32
- package/src/parser/tables/style/index.ts +0 -2
- package/src/parser/tables/style/parser.ts +0 -70
- package/src/parser/tables/style/types.ts +0 -15
- package/src/parser/tables/types.ts +0 -15
- package/src/parser/tables/vport/index.ts +0 -2
- package/src/parser/tables/vport/parser.ts +0 -205
- package/src/parser/tables/vport/types.ts +0 -48
- package/src/parser/types.ts +0 -30
- package/src/types/color.ts +0 -5
- package/src/types/dxfHeader.ts +0 -21
- package/src/types/entity.ts +0 -7
- package/src/types/index.ts +0 -30
- package/src/utils/binarySearch.ts +0 -20
- package/src/utils/disjointSet.ts +0 -52
- package/src/utils/flooding.ts +0 -37
- package/src/utils/functional.ts +0 -124
- package/src/utils/graph.ts +0 -53
- package/src/utils/index.ts +0 -102
- package/src/utils/queue.ts +0 -77
- package/src/utils/triangle.ts +0 -28
- package/tsconfig.json +0 -37
- package/webpack.config.js +0 -53
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import type DxfArrayScanner from '../../DxfArrayScanner';
|
|
2
|
-
import type { ScannerGroup } from '../../DxfArrayScanner';
|
|
3
|
-
import { isMatched } from '../../shared';
|
|
4
|
-
import {
|
|
5
|
-
Abort,
|
|
6
|
-
createParser,
|
|
7
|
-
DXFParserSnippet,
|
|
8
|
-
Identity,
|
|
9
|
-
PointParser,
|
|
10
|
-
} from '../../shared/parserGenerator';
|
|
11
|
-
import { CommonEntitySnippets } from '../shared';
|
|
12
|
-
import { VertexParser } from '../vertex';
|
|
13
|
-
|
|
14
|
-
const DefaultPolylineEntity = {
|
|
15
|
-
thickness: 0,
|
|
16
|
-
flag: 0,
|
|
17
|
-
startWidth: 0,
|
|
18
|
-
endWidth: 0,
|
|
19
|
-
meshMVertexCount: 0,
|
|
20
|
-
meshNVertexCount: 0,
|
|
21
|
-
surfaceMDensity: 0,
|
|
22
|
-
surfaceNDensity: 0,
|
|
23
|
-
smoothType: 0,
|
|
24
|
-
extrusionDirection: { x: 0, y: 0, z: 1 },
|
|
25
|
-
vertices: [],
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const PolylineParserSnippets: DXFParserSnippet[] = [
|
|
29
|
-
{
|
|
30
|
-
code: 0,
|
|
31
|
-
name: 'vertices',
|
|
32
|
-
isMultiple: true,
|
|
33
|
-
parser(curr, scanner) {
|
|
34
|
-
// Polyline 정의부 이후 바로 다음에 이것들이 나옴
|
|
35
|
-
if (!isMatched(curr, 0, 'VERTEX')) {
|
|
36
|
-
return Abort;
|
|
37
|
-
}
|
|
38
|
-
curr = scanner.next();
|
|
39
|
-
return new VertexParser().parseEntity(scanner, curr);
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
code: 210,
|
|
44
|
-
name: 'extrusionDirection',
|
|
45
|
-
parser: PointParser,
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
code: 75,
|
|
49
|
-
name: 'smoothType',
|
|
50
|
-
parser: Identity,
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
code: 74,
|
|
54
|
-
name: 'surfaceNDensity',
|
|
55
|
-
parser: Identity,
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
code: 73,
|
|
59
|
-
name: 'surfaceMDensity',
|
|
60
|
-
parser: Identity,
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
code: 72,
|
|
64
|
-
name: 'meshNVertexCount',
|
|
65
|
-
parser: Identity,
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
code: 71,
|
|
69
|
-
name: 'meshMVertexCount',
|
|
70
|
-
parser: Identity,
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
code: 41,
|
|
74
|
-
name: 'endWidth',
|
|
75
|
-
parser: Identity,
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
code: 40,
|
|
79
|
-
name: 'startWidth',
|
|
80
|
-
parser: Identity,
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
code: 70,
|
|
84
|
-
name: 'flag',
|
|
85
|
-
parser: Identity,
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
code: 39,
|
|
89
|
-
name: 'thickness',
|
|
90
|
-
parser: Identity,
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
code: 30,
|
|
94
|
-
name: 'elevation',
|
|
95
|
-
parser: Identity,
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
code: 20, // dummy point, always 0
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
code: 10, // dummy point, always 0
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
code: 66, // obsolete, ignore
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
code: 100,
|
|
108
|
-
name: 'subclassMarker',
|
|
109
|
-
parser: Identity,
|
|
110
|
-
},
|
|
111
|
-
...CommonEntitySnippets,
|
|
112
|
-
];
|
|
113
|
-
|
|
114
|
-
export class PolylineParser {
|
|
115
|
-
static ForEntityName = 'POLYLINE';
|
|
116
|
-
private parser = createParser(
|
|
117
|
-
PolylineParserSnippets,
|
|
118
|
-
DefaultPolylineEntity,
|
|
119
|
-
);
|
|
120
|
-
|
|
121
|
-
parseEntity(scanner: DxfArrayScanner, curr: ScannerGroup) {
|
|
122
|
-
const entity = {} as any;
|
|
123
|
-
this.parser(curr, scanner, entity);
|
|
124
|
-
return entity;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Point3D } from '../../../types';
|
|
2
|
-
import { CommonDxfEntity } from '../shared';
|
|
3
|
-
import { VertexEntity } from '../vertex/types';
|
|
4
|
-
import type { SmoothType } from './consts';
|
|
5
|
-
|
|
6
|
-
export interface PolylineEntity extends CommonDxfEntity {
|
|
7
|
-
type: 'POLYLINE';
|
|
8
|
-
subclassMarker: 'AcDb2dPolyline | AcDb3dPolyline';
|
|
9
|
-
thickness: number;
|
|
10
|
-
flag: number;
|
|
11
|
-
startWidth: number;
|
|
12
|
-
endWidth: number;
|
|
13
|
-
meshMVertexCount: number;
|
|
14
|
-
meshNVertexCount: number;
|
|
15
|
-
surfaceMDensity: number;
|
|
16
|
-
surfaceNDensity: number;
|
|
17
|
-
smoothType: SmoothType;
|
|
18
|
-
extrusionDirection: Point3D;
|
|
19
|
-
vertices: VertexEntity[];
|
|
20
|
-
}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createParser,
|
|
3
|
-
DXFParserSnippet,
|
|
4
|
-
Identity,
|
|
5
|
-
PointParser,
|
|
6
|
-
} from '../../shared/parserGenerator';
|
|
7
|
-
import { CommonEntitySnippets } from '../shared';
|
|
8
|
-
import type DxfArrayScanner from '../../DxfArrayScanner';
|
|
9
|
-
import type { ScannerGroup } from '../../DxfArrayScanner';
|
|
10
|
-
|
|
11
|
-
const DefaultSectionEntity = {
|
|
12
|
-
vertices: [],
|
|
13
|
-
backLineVertices: [],
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const SectionEntityParserSnippets: DXFParserSnippet[] = [
|
|
17
|
-
{
|
|
18
|
-
code: 360,
|
|
19
|
-
name: 'geometrySettingHardId',
|
|
20
|
-
parser: Identity,
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
code: 12,
|
|
24
|
-
name: 'backLineVertices',
|
|
25
|
-
isMultiple: true,
|
|
26
|
-
parser: PointParser,
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
code: 93,
|
|
30
|
-
name: 'numberOfBackLineVertices',
|
|
31
|
-
parser: Identity,
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
code: 11,
|
|
35
|
-
name: 'vertices',
|
|
36
|
-
isMultiple: true,
|
|
37
|
-
parser: PointParser,
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
code: 92,
|
|
41
|
-
name: 'verticesCount',
|
|
42
|
-
parser: Identity,
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
code: [63, 411],
|
|
46
|
-
name: 'indicatorColor',
|
|
47
|
-
parser: Identity,
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
code: 70,
|
|
51
|
-
name: 'indicatorTransparency',
|
|
52
|
-
parser: Identity,
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
code: 41,
|
|
56
|
-
name: 'bottomHeight',
|
|
57
|
-
parser: Identity,
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
code: 40,
|
|
61
|
-
name: 'topHeight',
|
|
62
|
-
parser: Identity,
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
code: 10,
|
|
66
|
-
name: 'verticalDirection',
|
|
67
|
-
parser: PointParser,
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
code: 1,
|
|
71
|
-
name: 'name',
|
|
72
|
-
parser: Identity,
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
code: 91,
|
|
76
|
-
name: 'flag',
|
|
77
|
-
parser: Identity,
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
code: 90,
|
|
81
|
-
name: 'state',
|
|
82
|
-
parser: Identity,
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
code: 100,
|
|
86
|
-
name: 'subclassMarker',
|
|
87
|
-
parser: Identity,
|
|
88
|
-
},
|
|
89
|
-
...CommonEntitySnippets,
|
|
90
|
-
];
|
|
91
|
-
|
|
92
|
-
export class SectionEntityParser {
|
|
93
|
-
static ForEntityName = 'SECTION';
|
|
94
|
-
private parser = createParser(
|
|
95
|
-
SectionEntityParserSnippets,
|
|
96
|
-
DefaultSectionEntity,
|
|
97
|
-
);
|
|
98
|
-
|
|
99
|
-
parseEntity(scanner: DxfArrayScanner, curr: ScannerGroup) {
|
|
100
|
-
const entity = {} as any;
|
|
101
|
-
this.parser(curr, scanner, entity);
|
|
102
|
-
return entity;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Point3D } from '../../../types';
|
|
2
|
-
import type { CommonDxfEntity } from '../shared';
|
|
3
|
-
|
|
4
|
-
export interface SectionEntity extends CommonDxfEntity {
|
|
5
|
-
type: 'SECTION';
|
|
6
|
-
subclassMarker: 'AcDbSection';
|
|
7
|
-
state: number;
|
|
8
|
-
flag: number;
|
|
9
|
-
name: string;
|
|
10
|
-
verticalDirection: Point3D;
|
|
11
|
-
topHeight: number;
|
|
12
|
-
bottomHeight: number;
|
|
13
|
-
indicatorTransparency: number;
|
|
14
|
-
indicatorColor: number;
|
|
15
|
-
numberOfVertices: number;
|
|
16
|
-
vertices: Point3D[];
|
|
17
|
-
numberOfBackLineVertices: number;
|
|
18
|
-
backLineVertices: Point3D[];
|
|
19
|
-
geometrySettingHardId: string;
|
|
20
|
-
}
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import type { ColorIndex, ColorInstance } from '../../types';
|
|
2
|
-
import DxfArrayScanner, { ScannerGroup } from '../DxfArrayScanner';
|
|
3
|
-
import { getAcadColor } from '../ParseHelpers';
|
|
4
|
-
import { isMatched } from '../shared';
|
|
5
|
-
import {
|
|
6
|
-
DXFParserSnippet,
|
|
7
|
-
Identity,
|
|
8
|
-
ToBoolean,
|
|
9
|
-
} from '../shared/parserGenerator';
|
|
10
|
-
import { XData, XDataParserSnippets } from '../shared/xdata';
|
|
11
|
-
|
|
12
|
-
export interface CommonDxfEntity {
|
|
13
|
-
type: string;
|
|
14
|
-
handle: string;
|
|
15
|
-
ownerBlockRecordSoftId?: string;
|
|
16
|
-
isInPaperSpace?: boolean;
|
|
17
|
-
layer: string;
|
|
18
|
-
lineType?: string;
|
|
19
|
-
materialObjectHardId?: string;
|
|
20
|
-
colorIndex?: ColorIndex;
|
|
21
|
-
lineweight?: number; // 문서에는 무조건 있다고 하는데, 실제로는 없는 경우 많음
|
|
22
|
-
lineTypeScale?: number; // default = 1
|
|
23
|
-
isVisible?: boolean;
|
|
24
|
-
proxyByte?: number;
|
|
25
|
-
proxyEntity?: string;
|
|
26
|
-
color?: ColorInstance;
|
|
27
|
-
colorName?: string;
|
|
28
|
-
transparency?: number;
|
|
29
|
-
plotStyleHardId?: string;
|
|
30
|
-
shadowMode?: ShadowMode;
|
|
31
|
-
xdata?: XData;
|
|
32
|
-
ownerdictionaryHardId?: string | number | boolean;
|
|
33
|
-
ownerDictionarySoftId?: string | number | boolean;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export enum ShadowMode {
|
|
37
|
-
CAST_AND_RECEIVE = 0,
|
|
38
|
-
CAST = 1,
|
|
39
|
-
RECEIVE = 2,
|
|
40
|
-
IGNORE = 3,
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// 이게 top에 와야함. 우선순위가 더 높다.
|
|
44
|
-
export const CommonEntitySnippets: DXFParserSnippet[] = [
|
|
45
|
-
...XDataParserSnippets,
|
|
46
|
-
{
|
|
47
|
-
code: 284,
|
|
48
|
-
name: 'shadowMode',
|
|
49
|
-
parser: Identity,
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
code: 390,
|
|
53
|
-
name: 'plotStyleHardId',
|
|
54
|
-
parser: Identity,
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
code: 440,
|
|
58
|
-
name: 'transparency',
|
|
59
|
-
parser: Identity,
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
code: 430,
|
|
63
|
-
name: 'colorName',
|
|
64
|
-
parser: Identity,
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
code: 420,
|
|
68
|
-
name: 'color',
|
|
69
|
-
parser: Identity,
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
code: 310,
|
|
73
|
-
name: 'proxyEntity',
|
|
74
|
-
parser: Identity,
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
code: 92,
|
|
78
|
-
name: 'proxyByte',
|
|
79
|
-
parser: Identity,
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
code: 60,
|
|
83
|
-
name: 'isVisible',
|
|
84
|
-
parser: ToBoolean,
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
code: 48,
|
|
88
|
-
name: 'lineTypeScale',
|
|
89
|
-
parser: Identity,
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
code: 370,
|
|
93
|
-
name: 'lineweight',
|
|
94
|
-
parser: Identity,
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
code: 62,
|
|
98
|
-
name: 'colorIndex',
|
|
99
|
-
parser(curr, scanner, entity) {
|
|
100
|
-
const colorIndex = curr.value;
|
|
101
|
-
entity.color = getAcadColor(Math.abs(colorIndex));
|
|
102
|
-
return colorIndex;
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
code: 347,
|
|
107
|
-
name: 'materialObjectHardId',
|
|
108
|
-
parser: Identity,
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
code: 6,
|
|
112
|
-
name: 'lineType',
|
|
113
|
-
parser: Identity,
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
code: 8,
|
|
117
|
-
name: 'layer',
|
|
118
|
-
parser: Identity,
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
code: 410,
|
|
122
|
-
name: 'layoutTabName',
|
|
123
|
-
parser: Identity,
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
code: 67,
|
|
127
|
-
name: 'isInPaperSpace',
|
|
128
|
-
parser: ToBoolean,
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
code: 100, // AcDbEntity를 소모시키기 위함
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
code: 330,
|
|
135
|
-
name: 'ownerBlockRecordSoftId',
|
|
136
|
-
parser: Identity,
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
code: 102, // {ACAD_XDICTIONARY
|
|
140
|
-
parser: skipApplicationGroups,
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
code: 102, // {ACAD_REACTORS
|
|
144
|
-
parser: skipApplicationGroups,
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
code: 102, // {application_name
|
|
148
|
-
parser: skipApplicationGroups,
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
code: 5,
|
|
152
|
-
name: 'handle',
|
|
153
|
-
parser: Identity,
|
|
154
|
-
},
|
|
155
|
-
];
|
|
156
|
-
|
|
157
|
-
export function skipApplicationGroups(
|
|
158
|
-
curr: ScannerGroup,
|
|
159
|
-
scanner: DxfArrayScanner,
|
|
160
|
-
) {
|
|
161
|
-
curr = scanner.next();
|
|
162
|
-
while (!isMatched(curr, 102) && !isMatched(curr, 0, 'EOF')) {
|
|
163
|
-
curr = scanner.next();
|
|
164
|
-
}
|
|
165
|
-
// } 까지 소비
|
|
166
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type DxfArrayScanner from '../../DxfArrayScanner';
|
|
2
|
-
import type { ScannerGroup } from '../../DxfArrayScanner';
|
|
3
|
-
import { generateIntegers } from '../../../utils';
|
|
4
|
-
import { CommonEntitySnippets } from '../shared';
|
|
5
|
-
import {
|
|
6
|
-
createParser,
|
|
7
|
-
DXFParserSnippet,
|
|
8
|
-
Identity,
|
|
9
|
-
PointParser,
|
|
10
|
-
} from '../../shared/parserGenerator';
|
|
11
|
-
import type { SolidEntity } from './types';
|
|
12
|
-
|
|
13
|
-
const DefaultSolidEntity = {
|
|
14
|
-
points: [],
|
|
15
|
-
thickness: 0,
|
|
16
|
-
extrusionDirection: { x: 0, y: 0, z: 1 },
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const SolidEntityParserSnippets: DXFParserSnippet[] = [
|
|
20
|
-
{
|
|
21
|
-
code: 210,
|
|
22
|
-
name: 'extrusionDirection',
|
|
23
|
-
parser: PointParser,
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
code: 39,
|
|
27
|
-
name: 'thickness',
|
|
28
|
-
parser: Identity,
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
code: [...generateIntegers(10, 14)],
|
|
32
|
-
name: 'points',
|
|
33
|
-
isMultiple: true,
|
|
34
|
-
parser: PointParser,
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
code: 100,
|
|
38
|
-
name: 'subclassMarker',
|
|
39
|
-
parser: Identity,
|
|
40
|
-
},
|
|
41
|
-
...CommonEntitySnippets,
|
|
42
|
-
];
|
|
43
|
-
|
|
44
|
-
export class SolidEntityParser {
|
|
45
|
-
static ForEntityName = 'SOLID';
|
|
46
|
-
private parser = createParser(
|
|
47
|
-
SolidEntityParserSnippets,
|
|
48
|
-
DefaultSolidEntity,
|
|
49
|
-
);
|
|
50
|
-
|
|
51
|
-
parseEntity(scanner: DxfArrayScanner, curr: ScannerGroup) {
|
|
52
|
-
const entity = {} as any;
|
|
53
|
-
this.parser(curr, scanner, entity);
|
|
54
|
-
return entity as SolidEntity;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Point3D } from '../../../types';
|
|
2
|
-
import type { CommonDxfEntity } from '../shared';
|
|
3
|
-
|
|
4
|
-
export interface SolidEntity extends CommonDxfEntity {
|
|
5
|
-
type: 'SOLID';
|
|
6
|
-
subclassMarker: 'AcDbTrace';
|
|
7
|
-
points: Point3D[];
|
|
8
|
-
thickness: number;
|
|
9
|
-
extrusionDirection: Point3D;
|
|
10
|
-
}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import type DxfArrayScanner from '../../DxfArrayScanner';
|
|
2
|
-
import type { ScannerGroup } from '../../DxfArrayScanner';
|
|
3
|
-
import {
|
|
4
|
-
createParser,
|
|
5
|
-
DXFParserSnippet,
|
|
6
|
-
Identity,
|
|
7
|
-
PointParser,
|
|
8
|
-
} from '../../shared/parserGenerator';
|
|
9
|
-
import { CommonEntitySnippets } from '../shared';
|
|
10
|
-
import type { SplineEntity } from './types';
|
|
11
|
-
|
|
12
|
-
const DefaultSplineEntity = {
|
|
13
|
-
knotTolerance: 1e-6,
|
|
14
|
-
controlTolerance: 1e-6,
|
|
15
|
-
fitTolerance: 1e-9,
|
|
16
|
-
knotValues: [],
|
|
17
|
-
controlPoints: [],
|
|
18
|
-
fitPoints: [],
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const SplineEntityParserSnippets: DXFParserSnippet[] = [
|
|
22
|
-
{
|
|
23
|
-
code: 11,
|
|
24
|
-
name: 'fitPoints',
|
|
25
|
-
isMultiple: true,
|
|
26
|
-
parser: PointParser,
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
code: 10,
|
|
30
|
-
name: 'controlPoints',
|
|
31
|
-
isMultiple: true,
|
|
32
|
-
parser: PointParser,
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
code: 41,
|
|
36
|
-
name: 'weights',
|
|
37
|
-
isMultiple: true,
|
|
38
|
-
parser: Identity,
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
code: 40,
|
|
42
|
-
name: 'knots',
|
|
43
|
-
isMultiple: true,
|
|
44
|
-
parser: Identity,
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
code: 13,
|
|
48
|
-
name: 'endTangent',
|
|
49
|
-
parser: PointParser,
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
code: 12,
|
|
53
|
-
name: 'startTangent',
|
|
54
|
-
parser: PointParser,
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
code: 44,
|
|
58
|
-
name: 'fitTolerance',
|
|
59
|
-
parser: Identity,
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
code: 43,
|
|
63
|
-
name: 'controlTolerance',
|
|
64
|
-
parser: Identity,
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
code: 42,
|
|
68
|
-
name: 'knotTolerance',
|
|
69
|
-
parser: Identity,
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
code: 74,
|
|
73
|
-
name: 'numberOfFitPoints',
|
|
74
|
-
parser: Identity,
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
code: 73,
|
|
78
|
-
name: 'numberOfControlPoints',
|
|
79
|
-
parser: Identity,
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
code: 72,
|
|
83
|
-
name: 'numberOfKnots',
|
|
84
|
-
parser: Identity,
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
code: 71,
|
|
88
|
-
name: 'degree',
|
|
89
|
-
parser: Identity,
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
code: 70,
|
|
93
|
-
name: 'flag',
|
|
94
|
-
parser: Identity,
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
code: 210,
|
|
98
|
-
name: 'normal',
|
|
99
|
-
parser: PointParser,
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
code: 100,
|
|
103
|
-
name: 'subclassMarker',
|
|
104
|
-
parser: Identity,
|
|
105
|
-
},
|
|
106
|
-
...CommonEntitySnippets,
|
|
107
|
-
];
|
|
108
|
-
|
|
109
|
-
export class SplineEntityParser {
|
|
110
|
-
static ForEntityName = 'SPLINE';
|
|
111
|
-
private parser = createParser(
|
|
112
|
-
SplineEntityParserSnippets,
|
|
113
|
-
DefaultSplineEntity,
|
|
114
|
-
);
|
|
115
|
-
|
|
116
|
-
parseEntity(scanner: DxfArrayScanner, curr: ScannerGroup) {
|
|
117
|
-
const entity = {} as any;
|
|
118
|
-
this.parser(curr, scanner, entity);
|
|
119
|
-
return entity as SplineEntity;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { Point3D } from '../../../types';
|
|
2
|
-
import type { CommonDxfEntity } from '../shared';
|
|
3
|
-
|
|
4
|
-
export interface SplineEntity extends CommonDxfEntity {
|
|
5
|
-
type: 'SPLINE';
|
|
6
|
-
subclassMarker: 'AcDbSpline';
|
|
7
|
-
normal?: Point3D;
|
|
8
|
-
flag: number;
|
|
9
|
-
degree: number;
|
|
10
|
-
numberOfKnots: number;
|
|
11
|
-
numberOfControlPoints: number;
|
|
12
|
-
numberOfFitPoints: number;
|
|
13
|
-
knotTolerance: number;
|
|
14
|
-
controlTolerance: number;
|
|
15
|
-
fitTolerance: number;
|
|
16
|
-
startTangent?: Point3D;
|
|
17
|
-
endTangent?: Point3D;
|
|
18
|
-
knots: number[];
|
|
19
|
-
weights?: number[];
|
|
20
|
-
controlPoints: Point3D[];
|
|
21
|
-
fitPoints: number[];
|
|
22
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export enum TextGenerationFlag {
|
|
2
|
-
NONE = 0,
|
|
3
|
-
MIRRORED_X = 2,
|
|
4
|
-
MIRRORED_Y = 4,
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export enum TextHorizontalAlign {
|
|
8
|
-
LEFT = 0,
|
|
9
|
-
CENTER = 1,
|
|
10
|
-
RIGHT = 2,
|
|
11
|
-
ALIGNED = 3,
|
|
12
|
-
MIDDLE = 4,
|
|
13
|
-
FIT = 5,
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export enum TextVerticalAlign {
|
|
17
|
-
BASELINE = 0,
|
|
18
|
-
BOTTOM = 1,
|
|
19
|
-
MIDDLE = 2,
|
|
20
|
-
TOP = 3,
|
|
21
|
-
}
|