dxf-json 0.0.16 → 0.0.18
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/dist/consts/block.d.ts +10 -0
- package/dist/consts/color.d.ts +5 -0
- package/dist/consts/config.d.ts +2 -0
- package/dist/consts/dimension.d.ts +61 -0
- package/dist/consts/hatch.d.ts +44 -0
- package/dist/consts/header.d.ts +9 -0
- package/dist/consts/index.d.ts +9 -0
- package/dist/consts/lineweight.d.ts +5 -0
- package/dist/consts/measurement.d.ts +4 -0
- package/dist/consts/obscuredLineTypes.d.ts +21 -0
- package/dist/consts/scene.d.ts +2 -0
- package/dist/consts/viewport.d.ts +56 -0
- package/dist/index.d.ts +2 -0
- package/dist/parser/AutoCadColorIndex.d.ts +8 -0
- package/dist/parser/DxfArrayScanner.d.ts +38 -0
- package/dist/parser/DxfParser.d.ts +11 -0
- package/dist/parser/ParseHelpers.d.ts +21 -0
- package/dist/parser/blocks/blocks.test.d.ts +1 -0
- package/dist/parser/blocks/index.d.ts +4 -0
- package/dist/parser/blocks/types.d.ts +14 -0
- package/dist/parser/entities/arc/index.d.ts +2 -0
- package/dist/parser/entities/arc/parser.d.ts +7 -0
- package/dist/parser/entities/arc/types.d.ts +12 -0
- package/dist/parser/entities/attdef/consts.d.ts +11 -0
- package/dist/parser/entities/attdef/index.d.ts +3 -0
- package/dist/parser/entities/attdef/parser.d.ts +8 -0
- package/dist/parser/entities/attdef/types.d.ts +17 -0
- package/dist/parser/entities/attribute/consts.d.ts +6 -0
- package/dist/parser/entities/attribute/index.d.ts +3 -0
- package/dist/parser/entities/attribute/parser.d.ts +8 -0
- package/dist/parser/entities/attribute/types.d.ts +30 -0
- package/dist/parser/entities/circle/index.d.ts +2 -0
- package/dist/parser/entities/circle/parser.d.ts +8 -0
- package/dist/parser/entities/circle/types.d.ts +10 -0
- package/dist/parser/entities/dimension/common.d.ts +6 -0
- package/dist/parser/entities/dimension/index.d.ts +6 -0
- package/dist/parser/entities/dimension/types.d.ts +48 -0
- package/dist/parser/entities/ellipse/index.d.ts +2 -0
- package/dist/parser/entities/ellipse/parser.d.ts +7 -0
- package/dist/parser/entities/ellipse/types.d.ts +12 -0
- package/dist/parser/entities/entities.test.d.ts +1 -0
- package/dist/parser/entities/hatch/boundaryPathData/edge.d.ts +6 -0
- package/dist/parser/entities/hatch/boundaryPathData/index.d.ts +5 -0
- package/dist/parser/entities/hatch/boundaryPathData/polyline.d.ts +2 -0
- package/dist/parser/entities/hatch/boundaryPathData/shared.d.ts +2 -0
- package/dist/parser/entities/hatch/index.d.ts +8 -0
- package/dist/parser/entities/hatch/patternData.d.ts +3 -0
- package/dist/parser/entities/hatch/types/boundaryPath.d.ts +59 -0
- package/dist/parser/entities/hatch/types/definitionLine.d.ts +8 -0
- package/dist/parser/entities/hatch/types/hatch.d.ts +38 -0
- package/dist/parser/entities/hatch/types/index.d.ts +3 -0
- package/dist/parser/entities/index.d.ts +8 -0
- package/dist/parser/entities/insert/index.d.ts +2 -0
- package/dist/parser/entities/insert/parser.d.ts +8 -0
- package/dist/parser/entities/insert/types.d.ts +18 -0
- package/dist/parser/entities/leader/consts.d.ts +6 -0
- package/dist/parser/entities/leader/index.d.ts +3 -0
- package/dist/parser/entities/leader/parser.d.ts +8 -0
- package/dist/parser/entities/leader/types.d.ts +23 -0
- package/dist/parser/entities/line/index.d.ts +2 -0
- package/dist/parser/entities/line/parser.d.ts +8 -0
- package/dist/parser/entities/line/types.d.ts +10 -0
- package/dist/parser/entities/lwpolyline/consts.d.ts +4 -0
- package/dist/parser/entities/lwpolyline/index.d.ts +3 -0
- package/dist/parser/entities/lwpolyline/parser.d.ts +7 -0
- package/dist/parser/entities/lwpolyline/types.d.ts +19 -0
- package/dist/parser/entities/mtext/consts.d.ts +5 -0
- package/dist/parser/entities/mtext/index.d.ts +3 -0
- package/dist/parser/entities/mtext/parser.d.ts +10 -0
- package/dist/parser/entities/mtext/types.d.ts +33 -0
- package/dist/parser/entities/point/index.d.ts +2 -0
- package/dist/parser/entities/point/parser.d.ts +6 -0
- package/dist/parser/entities/point/types.d.ts +9 -0
- package/dist/parser/entities/polyline/consts.d.ts +16 -0
- package/dist/parser/entities/polyline/index.d.ts +3 -0
- package/dist/parser/entities/polyline/parser.d.ts +7 -0
- package/dist/parser/entities/polyline/types.d.ts +19 -0
- package/dist/parser/entities/section/index.d.ts +2 -0
- package/dist/parser/entities/section/parser.d.ts +7 -0
- package/dist/parser/entities/section/types.d.ts +19 -0
- package/dist/parser/entities/shared.d.ts +35 -0
- package/dist/parser/entities/solid/index.d.ts +2 -0
- package/dist/parser/entities/solid/parser.d.ts +8 -0
- package/dist/parser/entities/solid/types.d.ts +9 -0
- package/dist/parser/entities/spline/consts.d.ts +8 -0
- package/dist/parser/entities/spline/index.d.ts +3 -0
- package/dist/parser/entities/spline/parser.d.ts +8 -0
- package/dist/parser/entities/spline/types.d.ts +21 -0
- package/dist/parser/entities/text/consts.d.ts +19 -0
- package/dist/parser/entities/text/index.d.ts +3 -0
- package/dist/parser/entities/text/parser.d.ts +26 -0
- package/dist/parser/entities/text/types.d.ts +20 -0
- package/dist/parser/entities/vertex/consts.d.ts +10 -0
- package/dist/parser/entities/vertex/index.d.ts +3 -0
- package/dist/parser/entities/vertex/parser.d.ts +8 -0
- package/dist/parser/entities/vertex/types.d.ts +16 -0
- package/dist/parser/entities/viewport/index.d.ts +5 -0
- package/dist/parser/entities/viewport/types.d.ts +51 -0
- package/dist/parser/filterDummyBlocks.d.ts +2 -0
- package/dist/parser/header/index.d.ts +3 -0
- package/dist/parser/objects/common.d.ts +8 -0
- package/dist/parser/objects/dictionary.d.ts +20 -0
- package/dist/parser/objects/index.d.ts +6 -0
- package/dist/parser/objects/layout.d.ts +30 -0
- package/dist/parser/objects/plotSettings.d.ts +64 -0
- package/dist/parser/objects/treefy.d.ts +2 -0
- package/dist/parser/objects/types.d.ts +15 -0
- package/dist/parser/shared/index.d.ts +7 -0
- package/dist/parser/shared/parsePoint.d.ts +7 -0
- package/dist/parser/shared/parserGenerator.d.ts +15 -0
- package/dist/parser/shared/parserGenerator.test.d.ts +1 -0
- package/dist/parser/shared/xdata/index.d.ts +3 -0
- package/dist/parser/shared/xdata/interpreter.d.ts +20 -0
- package/dist/parser/shared/xdata/interpreter.test.d.ts +1 -0
- package/dist/parser/shared/xdata/parser.d.ts +6 -0
- package/dist/parser/shared/xdata/parser.test.d.ts +1 -0
- package/dist/parser/shared/xdata/types.d.ts +9 -0
- package/dist/parser/tables/blockRecord/index.d.ts +2 -0
- package/dist/parser/tables/blockRecord/parser.d.ts +1 -0
- package/dist/parser/tables/blockRecord/types.d.ts +10 -0
- package/dist/parser/tables/dimStyle/consts.d.ts +2 -0
- package/dist/parser/tables/dimStyle/index.d.ts +3 -0
- package/dist/parser/tables/dimStyle/parser.d.ts +1 -0
- package/dist/parser/tables/dimStyle/types.d.ts +83 -0
- package/dist/parser/tables/index.d.ts +2 -0
- package/dist/parser/tables/layer/index.d.ts +2 -0
- package/dist/parser/tables/layer/parser.d.ts +1 -0
- package/dist/parser/tables/layer/types.d.ts +13 -0
- package/dist/parser/tables/ltype/consts.d.ts +6 -0
- package/dist/parser/tables/ltype/index.d.ts +3 -0
- package/dist/parser/tables/ltype/parser.d.ts +1 -0
- package/dist/parser/tables/ltype/types.d.ts +21 -0
- package/dist/parser/tables/parser.d.ts +2 -0
- package/dist/parser/tables/shared.d.ts +2 -0
- package/dist/parser/tables/style/index.d.ts +2 -0
- package/dist/parser/tables/style/parser.d.ts +1 -0
- package/dist/parser/tables/style/types.d.ts +14 -0
- package/dist/parser/tables/types.d.ts +14 -0
- package/dist/parser/tables/vport/index.d.ts +2 -0
- package/dist/parser/tables/vport/parser.d.ts +1 -0
- package/dist/parser/tables/vport/types.d.ts +43 -0
- package/dist/parser/types.d.ts +29 -0
- package/dist/types/color.d.ts +3 -0
- package/dist/types/dxfHeader.d.ts +16 -0
- package/dist/types/entity.d.ts +6 -0
- package/dist/types/index.d.ts +24 -0
- package/dist/utils/binarySearch.d.ts +1 -0
- package/dist/utils/disjointSet.d.ts +6 -0
- package/dist/utils/flooding.d.ts +8 -0
- package/dist/utils/functional.d.ts +17 -0
- package/dist/utils/graph.d.ts +19 -0
- package/dist/utils/index.d.ts +30 -0
- package/dist/utils/queue.d.ts +19 -0
- package/dist/utils/triangle.d.ts +2 -0
- package/package.json +2 -2
- package/src/index.ts +1 -6
- package/tsconfig.json +1 -0
- package/webpack.config.js +7 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Point3D } from '../../../types';
|
|
2
|
+
import { CommonDxfEntity } from '../shared';
|
|
3
|
+
import { VertexFlag } from './consts';
|
|
4
|
+
export interface VertexEntity extends CommonDxfEntity, Point3D {
|
|
5
|
+
subclassMarker: 'AcDb2dVertex' | 'AcDb3dPolylineVertex';
|
|
6
|
+
startWidth: number;
|
|
7
|
+
endWidth: number;
|
|
8
|
+
bulge: number;
|
|
9
|
+
flag: VertexFlag;
|
|
10
|
+
tangentDirection: number;
|
|
11
|
+
polyfaceIndex0?: number;
|
|
12
|
+
polyfaceIndex1?: number;
|
|
13
|
+
polyfaceIndex2?: number;
|
|
14
|
+
polyfaceIndex3?: number;
|
|
15
|
+
id: number;
|
|
16
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { DefaultLightingType, OrthographicType, RenderMode, ShadePlotMode, UCSPerViewport } from '../../../consts';
|
|
2
|
+
import type { Vector2, Vector3 } from 'three';
|
|
3
|
+
export interface ViewportEntity {
|
|
4
|
+
type: 'VIEWPORT';
|
|
5
|
+
subclassMarker: string;
|
|
6
|
+
handle?: string;
|
|
7
|
+
layer?: string;
|
|
8
|
+
viewportCenter: Vector3;
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
status: number;
|
|
12
|
+
viewportId: string;
|
|
13
|
+
displayCenter: Vector2;
|
|
14
|
+
snapBase: Vector2;
|
|
15
|
+
snapSpacing: Vector2;
|
|
16
|
+
gridSpacing: Vector2;
|
|
17
|
+
viewDirection: Vector3;
|
|
18
|
+
targetPoint: Vector3;
|
|
19
|
+
perspectiveLensLength: number;
|
|
20
|
+
frontClipZ: number;
|
|
21
|
+
backClipZ: number;
|
|
22
|
+
viewHeight: number;
|
|
23
|
+
snapAngle: number;
|
|
24
|
+
viewTwistAngle: number;
|
|
25
|
+
circleZoomPercent: number;
|
|
26
|
+
frozenLayerIds?: string[];
|
|
27
|
+
statusBitFlags: number;
|
|
28
|
+
clippingBoundaryId?: string;
|
|
29
|
+
sheetName: string;
|
|
30
|
+
renderMode: RenderMode;
|
|
31
|
+
ucsPerViewport: UCSPerViewport;
|
|
32
|
+
ucsOrigin?: Vector3;
|
|
33
|
+
ucsXAxis?: Vector3;
|
|
34
|
+
ucsYAxis?: Vector3;
|
|
35
|
+
ucsId?: string;
|
|
36
|
+
ucsBaseId?: string;
|
|
37
|
+
orthographicType?: OrthographicType;
|
|
38
|
+
elevation: number;
|
|
39
|
+
shadePlotMode: ShadePlotMode;
|
|
40
|
+
majorGridFrequency: number;
|
|
41
|
+
backgroundId?: string;
|
|
42
|
+
shadePlotId?: string;
|
|
43
|
+
visualStyleId?: string;
|
|
44
|
+
isDefaultLighting: boolean;
|
|
45
|
+
defaultLightingType?: DefaultLightingType;
|
|
46
|
+
brightness: number;
|
|
47
|
+
contrast: number;
|
|
48
|
+
ambientLightColor?: string;
|
|
49
|
+
sunId?: string;
|
|
50
|
+
softPointer?: string;
|
|
51
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DXFParserSnippet } from '../shared/parserGenerator';
|
|
2
|
+
export declare const CommonObjectSnippets: DXFParserSnippet[];
|
|
3
|
+
export interface CommonDXFObject {
|
|
4
|
+
ownerObjectId: string;
|
|
5
|
+
ownerDictionaryIdHard: string;
|
|
6
|
+
ownerDictionaryIdSoft: string;
|
|
7
|
+
handle: string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DXFParserSnippet } from '../shared/parserGenerator';
|
|
2
|
+
import type { CommonDXFObject } from './common';
|
|
3
|
+
export declare const DictionarySnippets: DXFParserSnippet[];
|
|
4
|
+
export declare enum RecordCloneFlag {
|
|
5
|
+
NOT_APPLICABLE = 0,
|
|
6
|
+
KEEP_EXISTING = 1,
|
|
7
|
+
USE_CLONE = 2,
|
|
8
|
+
XREF_VALUE_NAME = 3,
|
|
9
|
+
VALUE_NAME = 4,
|
|
10
|
+
UNMANGLE_NAME = 5
|
|
11
|
+
}
|
|
12
|
+
export interface DictionaryDXFObject extends CommonDXFObject {
|
|
13
|
+
subclassMarker: 'AcDbDictionary';
|
|
14
|
+
isHardOwned?: boolean;
|
|
15
|
+
recordCloneFlag: RecordCloneFlag;
|
|
16
|
+
entries: {
|
|
17
|
+
name: string;
|
|
18
|
+
objectId?: string;
|
|
19
|
+
}[];
|
|
20
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type DxfArrayScanner from '../DxfArrayScanner';
|
|
2
|
+
import { ScannerGroup } from '../DxfArrayScanner';
|
|
3
|
+
export declare function parseObjects(curr: ScannerGroup, scanner: DxfArrayScanner): {
|
|
4
|
+
byName: Record<string, any[]>;
|
|
5
|
+
byTree: import("./types").DxfObject;
|
|
6
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { OrthographicType } from '../../consts';
|
|
2
|
+
import type { Point2D, Point3D } from '../../types';
|
|
3
|
+
import { DXFParserSnippet } from '../shared/parserGenerator';
|
|
4
|
+
import { PlotSettingDXFObject } from './plotSettings';
|
|
5
|
+
export declare const LayoutSnippets: DXFParserSnippet[];
|
|
6
|
+
export declare enum LayoutControlFlag {
|
|
7
|
+
PSLTSCALE = 1,
|
|
8
|
+
LIMCHECK = 2
|
|
9
|
+
}
|
|
10
|
+
export interface LayoutDXFObject extends Omit<PlotSettingDXFObject, 'subclassMarker'> {
|
|
11
|
+
subclassMarker: 'AcDbLayout';
|
|
12
|
+
layoutName: string;
|
|
13
|
+
controlFlag: LayoutControlFlag;
|
|
14
|
+
tabOrder: number;
|
|
15
|
+
minLimit: Point2D;
|
|
16
|
+
maxLimit: Point2D;
|
|
17
|
+
insertionPoint: Point3D;
|
|
18
|
+
minExtent: Point3D;
|
|
19
|
+
maxExtent: Point3D;
|
|
20
|
+
elevation: number;
|
|
21
|
+
ucsOrigin: Point3D;
|
|
22
|
+
ucsXAxis: Point3D;
|
|
23
|
+
ucsYAxis: Point3D;
|
|
24
|
+
orthographicType: OrthographicType;
|
|
25
|
+
paperSpaceTableId: string;
|
|
26
|
+
viewportId: string;
|
|
27
|
+
namedUcsId?: string;
|
|
28
|
+
orthographicUcsId?: string;
|
|
29
|
+
shadePlotId: string;
|
|
30
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { DXFParserSnippet } from '../shared/parserGenerator';
|
|
2
|
+
import type { CommonDXFObject } from './common';
|
|
3
|
+
export declare const PlotSettingsSnippets: DXFParserSnippet[];
|
|
4
|
+
export declare enum PlotPaperUnit {
|
|
5
|
+
INCHES = 0,
|
|
6
|
+
MILLIMETERS = 1,
|
|
7
|
+
PIXELS = 2
|
|
8
|
+
}
|
|
9
|
+
export declare enum PlotType {
|
|
10
|
+
LAST_SCREEN_DISPLAY = 0,
|
|
11
|
+
DRAWING_EXTENTS = 1,
|
|
12
|
+
DRAWING_LIMITS = 2,
|
|
13
|
+
VIEW_SPECIFIED = 3,// specified in plotViewName
|
|
14
|
+
WINDOW_SPECIFIED = 4,// specified in plotViewName
|
|
15
|
+
LAYOUT_INFORMATION = 5
|
|
16
|
+
}
|
|
17
|
+
export declare enum ShadePlotMode {
|
|
18
|
+
AS_DISPLAYED = 0,
|
|
19
|
+
WIREFRAME = 1,
|
|
20
|
+
HIDDEN = 2,
|
|
21
|
+
RENDERED = 3
|
|
22
|
+
}
|
|
23
|
+
export declare enum ShadePlotResolution {
|
|
24
|
+
DRAFT = 0,
|
|
25
|
+
PREVIEW = 1,
|
|
26
|
+
NORMAL = 2,
|
|
27
|
+
PRESENTATION = 3,
|
|
28
|
+
MAXIMUM = 4,
|
|
29
|
+
CUSTOM = 5
|
|
30
|
+
}
|
|
31
|
+
export interface PlotSettingDXFObject extends CommonDXFObject {
|
|
32
|
+
subclassMarker: 'AcDbPlotSettings7';
|
|
33
|
+
pageSetupName: string;
|
|
34
|
+
configName: string;
|
|
35
|
+
paperSize: string;
|
|
36
|
+
plotViewName: string;
|
|
37
|
+
marginLeft: number;
|
|
38
|
+
marginBottom: number;
|
|
39
|
+
marginRight: number;
|
|
40
|
+
marginTop: number;
|
|
41
|
+
paperWidth: number;
|
|
42
|
+
paperHeight: number;
|
|
43
|
+
plotOriginX: number;
|
|
44
|
+
plotOriginY: number;
|
|
45
|
+
windowAreaXMin: number;
|
|
46
|
+
windowAreaYMin: number;
|
|
47
|
+
windowAreaXMax: number;
|
|
48
|
+
windowAreaYMax: number;
|
|
49
|
+
printScaleNominator: number;
|
|
50
|
+
printScaleDenominator: number;
|
|
51
|
+
layoutFlag: number;
|
|
52
|
+
plotPaperUnit: PlotPaperUnit;
|
|
53
|
+
plotRotation: 0 | 1 | 2 | 3;
|
|
54
|
+
plotType: PlotType;
|
|
55
|
+
currentStyleSheet: string;
|
|
56
|
+
standardScaleType: number;
|
|
57
|
+
shadePlotMode: ShadePlotMode;
|
|
58
|
+
shadePlotResolution: ShadePlotResolution;
|
|
59
|
+
shadePlotCustomDPI?: number;
|
|
60
|
+
scaleFactor: number;
|
|
61
|
+
imageOriginX: number;
|
|
62
|
+
imageOriginY: number;
|
|
63
|
+
shadePlotId: string;
|
|
64
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface DxfObject {
|
|
2
|
+
name: string;
|
|
3
|
+
handle: string;
|
|
4
|
+
ownerDictionaryIdSoft: string;
|
|
5
|
+
ownerDictionaryIdHard?: string;
|
|
6
|
+
ownerObjectId?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface HydratedDxfObject extends DxfObject {
|
|
9
|
+
ownerDictionarySoft?: HydratedDxfObject;
|
|
10
|
+
ownerDictionaryHard?: HydratedDxfObject;
|
|
11
|
+
ownerObject?: HydratedDxfObject;
|
|
12
|
+
}
|
|
13
|
+
export interface DxfDictionary extends HydratedDxfObject {
|
|
14
|
+
entries?: Record<string, HydratedDxfObject>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ScannerGroup } from '../DxfArrayScanner';
|
|
2
|
+
export declare function ensureHandle(entity: any): void;
|
|
3
|
+
/**
|
|
4
|
+
* group이 `code`와 `value`를 갖는지 확인
|
|
5
|
+
* `value`가 `null`이나 `undefined`인 경우 아무거나 다 매칭한다고 가정한다.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isMatched(group: ScannerGroup, code: number, value?: any): boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Point2D, Point3D } from '../../types';
|
|
2
|
+
import type DxfArrayScanner from '../DxfArrayScanner';
|
|
3
|
+
/**
|
|
4
|
+
* Parses the 2D or 3D coordinate, vector, or point. When complete,
|
|
5
|
+
* the scanner remains on the last group of the coordinate.
|
|
6
|
+
*/
|
|
7
|
+
export declare function parsePoint(scanner: DxfArrayScanner): Point3D | Point2D;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type DxfArrayScanner from '../DxfArrayScanner';
|
|
2
|
+
import { ScannerGroup } from '../DxfArrayScanner';
|
|
3
|
+
export declare const Abort: unique symbol;
|
|
4
|
+
export interface DXFParserSnippet {
|
|
5
|
+
code: number | number[];
|
|
6
|
+
name?: string;
|
|
7
|
+
parser?(curr: ScannerGroup, scanner: DxfArrayScanner, entity: any): any;
|
|
8
|
+
isMultiple?: boolean;
|
|
9
|
+
pushContext?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export type DXFParser = (curr: ScannerGroup, scanner: DxfArrayScanner, target: any) => boolean;
|
|
12
|
+
export declare function createParser(snippets: DXFParserSnippet[], defaultObject?: any): DXFParser;
|
|
13
|
+
export declare function Identity({ value }: ScannerGroup): any;
|
|
14
|
+
export declare function PointParser(_: any, scanner: DxfArrayScanner): import("../../types").Point2D | import("../../types").Point3D;
|
|
15
|
+
export declare function ToBoolean({ value }: ScannerGroup): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { XData, XDataEntry } from './types';
|
|
2
|
+
export type XDataInterpreterSnippet<Name extends string> = {
|
|
3
|
+
code: number;
|
|
4
|
+
name: Name;
|
|
5
|
+
};
|
|
6
|
+
type PackPairType<Snippets> = Snippets extends readonly [infer X, ...infer R] ? X extends XDataInterpreterSnippet<infer N> ? {
|
|
7
|
+
[key in N]?: any;
|
|
8
|
+
} & PackPairType<R> : PackPairType<R> : {};
|
|
9
|
+
/**
|
|
10
|
+
* xdata가 code-value의 연속인 경우에 사용 가능
|
|
11
|
+
* ex) DSTYLE
|
|
12
|
+
*/
|
|
13
|
+
export declare function createXDataControlInterpreter<T extends readonly XDataInterpreterSnippet<string>[]>(snippets: T): (entries: XDataEntry[]) => PackPairType<T>;
|
|
14
|
+
interface CreateXDataCatcherParams {
|
|
15
|
+
appName?: string;
|
|
16
|
+
catcher(entry: XDataEntry): boolean;
|
|
17
|
+
escaper?(entry: XDataEntry, count: number): boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function createXDataCatcher({ appName, catcher, escaper, }: CreateXDataCatcherParams): (xdata?: XData) => Generator<XDataEntry, void, unknown>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ScannerGroup } from '../../DxfArrayScanner';
|
|
2
|
+
import type DxfArrayScanner from '../../DxfArrayScanner';
|
|
3
|
+
import { DXFParserSnippet } from '../parserGenerator';
|
|
4
|
+
import type { XData } from './types';
|
|
5
|
+
export declare const XDataParserSnippets: DXFParserSnippet[];
|
|
6
|
+
export declare function parseXData(curr: ScannerGroup, scanner: DxfArrayScanner): XData;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const parseBlockRecordTable: import("../../shared/parserGenerator").DXFParser;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CommonDxfTableEntry } from '../types';
|
|
2
|
+
export interface BlockRecordTableEntry extends CommonDxfTableEntry {
|
|
3
|
+
subclassMarker: 'AcDbBlockTableRecord';
|
|
4
|
+
name: string;
|
|
5
|
+
layoutObjects: string;
|
|
6
|
+
insertionUnits: number;
|
|
7
|
+
explodability: number;
|
|
8
|
+
scalability: number;
|
|
9
|
+
bmpPreview: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const parseDimStyle: import("../../shared/parserGenerator").DXFParser;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { DimensionTextHorizontal, DimensionTextVertical, DimensionZeroSuppression, DimensionZeroSuppressionAngular } from '../../../consts';
|
|
2
|
+
import type { CommonDxfTableEntry } from '../types';
|
|
3
|
+
export type DimStyleVariable = 'DIMPOST' | 'DIMAPOST' | 'DIMBLK_OBSOLETE' | 'DIMBLK1_OBSOLETE' | 'DIMBLK2_OBSOLETE' | 'DIMSCALE' | 'DIMASZ' | 'DIMEXO' | 'DIMDLI' | 'DIMEXE' | 'DIMRND' | 'DIMDLE' | 'DIMTP' | 'DIMTM' | 'DIMTXT' | 'DIMCEN' | 'DIMTSZ' | 'DIMALTF' | 'DIMLFAC' | 'DIMTVP' | 'DIMTFAC' | 'DIMGAP' | 'DIMALTRND' | 'DIMTOL' | 'DIMLIM' | 'DIMTIH' | 'DIMTOH' | 'DIMSE1' | 'DIMSE2' | 'DIMTAD' | 'DIMZIN' | 'DIMAZIN' | 'DIMALT' | 'DIMALTD' | 'DIMTOFL' | 'DIMSAH' | 'DIMTIX' | 'DIMSOXD' | 'DIMCLRD' | 'DIMCLRE' | 'DIMCLRT' | 'DIMADEC' | 'DIMUNIT' | 'DIMDEC' | 'DIMTDEC' | 'DIMALTU' | 'DIMALTTD' | 'DIMAUNIT' | 'DIMFRAC' | 'DIMLUNIT' | 'DIMDSEP' | 'DIMTMOVE' | 'DIMJUST' | 'DIMSD1' | 'DIMSD2' | 'DIMTOLJ' | 'DIMTZIN' | 'DIMALTZ' | 'DIMALTTZ' | 'DIMFIT' | 'DIMUPT' | 'DIMATFIT' | 'DIMTXSTY' | 'DIMLDRBLK' | 'DIMBLK' | 'DIMBLK1' | 'DIMBLK2' | 'DIMLWD' | 'DIMLWE';
|
|
4
|
+
export interface DimStyleVariableSchema {
|
|
5
|
+
name: string;
|
|
6
|
+
code: number;
|
|
7
|
+
defaultValue?: string | number;
|
|
8
|
+
defaultValueImperial?: string | number;
|
|
9
|
+
}
|
|
10
|
+
export type DimStylesTableEntry = {
|
|
11
|
+
subclassMarker: 'AcDbDimStyleTableRecord';
|
|
12
|
+
styleName: string;
|
|
13
|
+
DIMPOST?: string;
|
|
14
|
+
DIMAPOST?: string;
|
|
15
|
+
DIMBLK_OBSOLETE?: string;
|
|
16
|
+
DIMBLK1_OBSOLETE?: string;
|
|
17
|
+
DIMBLK2_OBSOLETE?: string;
|
|
18
|
+
DIMSCALE: number;
|
|
19
|
+
DIMASZ: number;
|
|
20
|
+
DIMEXO: number;
|
|
21
|
+
DIMDLI: number;
|
|
22
|
+
DIMEXE: number;
|
|
23
|
+
DIMRND: number;
|
|
24
|
+
DIMDLE: number;
|
|
25
|
+
DIMTP: number;
|
|
26
|
+
DIMTM: number;
|
|
27
|
+
DIMTXT: number;
|
|
28
|
+
DIMCEN: number;
|
|
29
|
+
DIMTSZ: number;
|
|
30
|
+
DIMALTF: number;
|
|
31
|
+
DIMLFAC: number;
|
|
32
|
+
DIMTVP: number;
|
|
33
|
+
DIMTFAC: number;
|
|
34
|
+
DIMGAP: number;
|
|
35
|
+
DIMALTRND: number;
|
|
36
|
+
DIMTOL: number;
|
|
37
|
+
DIMLIM: number;
|
|
38
|
+
DIMTIH: number;
|
|
39
|
+
DIMTOH: number;
|
|
40
|
+
DIMSE1: 0 | 1;
|
|
41
|
+
DIMSE2: 0 | 1;
|
|
42
|
+
DIMTAD: DimensionTextVertical;
|
|
43
|
+
DIMZIN: DimensionZeroSuppression;
|
|
44
|
+
DIMAZIN: DimensionZeroSuppressionAngular;
|
|
45
|
+
DIMALT: 0 | 1;
|
|
46
|
+
DIMALTD: number;
|
|
47
|
+
DIMTOFL: 0 | 1;
|
|
48
|
+
DIMSAH: 0 | 1;
|
|
49
|
+
DIMTIX: 0 | 1;
|
|
50
|
+
DIMSOXD: 0 | 1;
|
|
51
|
+
DIMCLRD: number;
|
|
52
|
+
DIMCLRE: number;
|
|
53
|
+
DIMCLRT: number;
|
|
54
|
+
DIMADEC?: number;
|
|
55
|
+
DIMUNIT?: number;
|
|
56
|
+
DIMDEC: number;
|
|
57
|
+
DIMTDEC: number;
|
|
58
|
+
DIMALTU: number;
|
|
59
|
+
DIMALTTD: number;
|
|
60
|
+
DIMAUNIT: number;
|
|
61
|
+
DIMFRAC: number;
|
|
62
|
+
DIMLUNIT: number;
|
|
63
|
+
DIMDSEP: string;
|
|
64
|
+
DIMTMOVE: undefined;
|
|
65
|
+
DIMJUST: DimensionTextHorizontal;
|
|
66
|
+
DIMSD1: 0 | 1;
|
|
67
|
+
DIMSD2: 0 | 1;
|
|
68
|
+
DIMTOLJ: DimensionTextVertical;
|
|
69
|
+
DIMTZIN: DimensionZeroSuppression;
|
|
70
|
+
DIMALTZ: DimensionZeroSuppression;
|
|
71
|
+
DIMALTTZ: DimensionZeroSuppression;
|
|
72
|
+
DIMFIT?: number;
|
|
73
|
+
DIMUPT: number;
|
|
74
|
+
DIMATFIT: number;
|
|
75
|
+
DIMTXSTY?: string;
|
|
76
|
+
DIMLDRBLK?: string;
|
|
77
|
+
DIMBLK?: string;
|
|
78
|
+
DIMBLK1?: string;
|
|
79
|
+
DIMBLK2?: string;
|
|
80
|
+
DIMLWD: number;
|
|
81
|
+
DIMLWE: number;
|
|
82
|
+
} & CommonDxfTableEntry;
|
|
83
|
+
export type StyleResolver = <Name extends DimStyleVariable>(variableName: Name) => DimStylesTableEntry[Name];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const parseLayerTable: import("../../shared/parserGenerator").DXFParser;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ColorIndex } from '../../../types';
|
|
2
|
+
import type { CommonDxfTableEntry } from '../types';
|
|
3
|
+
export interface LayerTableEntry extends CommonDxfTableEntry {
|
|
4
|
+
subclassMarker: 'AcDbLayerTableRecord';
|
|
5
|
+
name: string;
|
|
6
|
+
standardFlag: number;
|
|
7
|
+
colorIndex: ColorIndex;
|
|
8
|
+
lineType: string;
|
|
9
|
+
isPlotting: boolean;
|
|
10
|
+
lineweight: number;
|
|
11
|
+
plotStyleNameObjectId?: string;
|
|
12
|
+
materialObjectId?: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const parseLTypeTable: import("../../shared/parserGenerator").DXFParser;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { CommonDxfTableEntry } from '../types';
|
|
2
|
+
export interface LTypeTableEntry extends CommonDxfTableEntry {
|
|
3
|
+
subclassMarker: 'AcDbLinetypeTableRecord';
|
|
4
|
+
name: string;
|
|
5
|
+
standardFlag: number;
|
|
6
|
+
description: string;
|
|
7
|
+
numberOfLineTypes: number;
|
|
8
|
+
totalPatternLength: number;
|
|
9
|
+
pattern?: LineTypeElement[];
|
|
10
|
+
}
|
|
11
|
+
export interface LineTypeElement {
|
|
12
|
+
elementLength: number;
|
|
13
|
+
elementTypeFlag: number;
|
|
14
|
+
shapeNumber?: number;
|
|
15
|
+
styleObjectId?: string;
|
|
16
|
+
scale?: number;
|
|
17
|
+
rotation?: number;
|
|
18
|
+
offsetX?: number;
|
|
19
|
+
offsetY?: number;
|
|
20
|
+
text?: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const parseStyleTable: import("../../shared/parserGenerator").DXFParser;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CommonDxfTableEntry } from '../types';
|
|
2
|
+
export interface StyleTableEntry extends CommonDxfTableEntry {
|
|
3
|
+
subclassMarker: 'AcDbTextStyleTableRecord';
|
|
4
|
+
name: string;
|
|
5
|
+
standardFlag: number;
|
|
6
|
+
fixedTextHeight: number;
|
|
7
|
+
widthFactor: number;
|
|
8
|
+
obliqueAngle: number;
|
|
9
|
+
textGenerationFlag: number;
|
|
10
|
+
lastHeight: number;
|
|
11
|
+
font: string;
|
|
12
|
+
bigFont: string;
|
|
13
|
+
extendedFont?: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface DxfTable<T extends CommonDxfTableEntry> {
|
|
2
|
+
subclassMarker: 'AcDbSymbolTable';
|
|
3
|
+
name: string;
|
|
4
|
+
handle: string;
|
|
5
|
+
ownerDictionaryIds?: string[];
|
|
6
|
+
ownerObjectId: string;
|
|
7
|
+
maxNumberOfEntries: number;
|
|
8
|
+
entries: T[];
|
|
9
|
+
}
|
|
10
|
+
export interface CommonDxfTableEntry {
|
|
11
|
+
name: string;
|
|
12
|
+
handle: string;
|
|
13
|
+
ownerObjectId: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const parseVPortTable: import("../../shared/parserGenerator").DXFParser;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { RenderMode, OrthographicType, DefaultLightingType } from '../../../consts';
|
|
2
|
+
import type { Point2D, Point3D } from '../../../types';
|
|
3
|
+
import type { CommonDxfTableEntry } from '../types';
|
|
4
|
+
export interface VPortTableEntry extends CommonDxfTableEntry {
|
|
5
|
+
subclassMarker: 'AcDbViewportTableRecord';
|
|
6
|
+
name: string;
|
|
7
|
+
standardFlag: number;
|
|
8
|
+
lowerLeftCorner: Point2D;
|
|
9
|
+
upperRightCorner: Point2D;
|
|
10
|
+
center: Point2D;
|
|
11
|
+
snapBasePoint: Point2D;
|
|
12
|
+
snapSpacing: Point2D;
|
|
13
|
+
gridSpacing: Point2D;
|
|
14
|
+
viewDirectionFromTarget: Point3D;
|
|
15
|
+
viewTarget: Point3D;
|
|
16
|
+
lensLength: number;
|
|
17
|
+
frontClippingPlane: number;
|
|
18
|
+
backClippingPlane: number;
|
|
19
|
+
viewHeight: number;
|
|
20
|
+
snapRotationAngle: number;
|
|
21
|
+
viewTwistAngle: number;
|
|
22
|
+
circleSides: number;
|
|
23
|
+
frozenLayers: string[];
|
|
24
|
+
styleSheet: string;
|
|
25
|
+
renderMode: RenderMode;
|
|
26
|
+
viewMode: number;
|
|
27
|
+
ucsIconSetting: number;
|
|
28
|
+
ucsOrigin: Point3D;
|
|
29
|
+
ucsXAxis: Point3D;
|
|
30
|
+
ucsYAxis: Point3D;
|
|
31
|
+
orthographicType: OrthographicType;
|
|
32
|
+
elevation: number;
|
|
33
|
+
shadePlotSetting: number;
|
|
34
|
+
majorGridLines: number;
|
|
35
|
+
backgroundObjectId?: string;
|
|
36
|
+
shadePlotObjectId?: string;
|
|
37
|
+
visualStyleObjectId?: string;
|
|
38
|
+
isDefaultLightingOn: boolean;
|
|
39
|
+
defaultLightingType: DefaultLightingType;
|
|
40
|
+
brightness: number;
|
|
41
|
+
contrast: number;
|
|
42
|
+
ambientColor?: number;
|
|
43
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { DxfHeader } from '../types/dxfHeader';
|
|
2
|
+
import type { DxfBlock } from './blocks/types';
|
|
3
|
+
import type { CommonDxfEntity } from './entities/shared';
|
|
4
|
+
import type { CommonDXFObject } from './objects/common';
|
|
5
|
+
import type { DxfObject } from './objects/types';
|
|
6
|
+
import { BlockRecordTableEntry } from './tables/blockRecord';
|
|
7
|
+
import { DimStylesTableEntry } from './tables/dimStyle';
|
|
8
|
+
import { LayerTableEntry } from './tables/layer';
|
|
9
|
+
import { LTypeTableEntry } from './tables/ltype';
|
|
10
|
+
import { StyleTableEntry } from './tables/style';
|
|
11
|
+
import { DxfTable } from './tables/types';
|
|
12
|
+
import { VPortTableEntry } from './tables/vport';
|
|
13
|
+
export interface ParsedDxf {
|
|
14
|
+
header: DxfHeader;
|
|
15
|
+
blocks: Record<string, DxfBlock>;
|
|
16
|
+
entities: CommonDxfEntity[];
|
|
17
|
+
tables: {
|
|
18
|
+
BLOCK_RECORD?: DxfTable<BlockRecordTableEntry>;
|
|
19
|
+
DIMSTYLE?: DxfTable<DimStylesTableEntry>;
|
|
20
|
+
STYLE?: DxfTable<StyleTableEntry>;
|
|
21
|
+
LAYER?: DxfTable<LayerTableEntry>;
|
|
22
|
+
LTYPE?: DxfTable<LTypeTableEntry>;
|
|
23
|
+
VPORT?: DxfTable<VPortTableEntry>;
|
|
24
|
+
};
|
|
25
|
+
objects: {
|
|
26
|
+
byName: Record<string, CommonDXFObject[]>;
|
|
27
|
+
byTree?: DxfObject;
|
|
28
|
+
};
|
|
29
|
+
}
|