dxf-json 0.0.14 → 0.0.17
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 +6 -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 +3 -1
- package/tsconfig.json +1 -0
- package/webpack.config.js +7 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export declare enum DimensionType {
|
|
2
|
+
Rotated = 0,
|
|
3
|
+
Aligned = 1,
|
|
4
|
+
Angular = 2,
|
|
5
|
+
Diameter = 3,
|
|
6
|
+
Radius = 4,
|
|
7
|
+
Angular3Point = 5,
|
|
8
|
+
Ordinate = 6,
|
|
9
|
+
ReferenceIsExclusive = 32,
|
|
10
|
+
IsOrdinateXTypeFlag = 64,
|
|
11
|
+
IsCustomTextPositionFlag = 128
|
|
12
|
+
}
|
|
13
|
+
export declare enum AttachmentPoint {
|
|
14
|
+
TopLeft = 1,
|
|
15
|
+
TopCenter = 2,
|
|
16
|
+
TopRight = 3,
|
|
17
|
+
MiddleLeft = 4,
|
|
18
|
+
MiddleCenter = 5,
|
|
19
|
+
MiddleRight = 6,
|
|
20
|
+
BottomLeft = 7,
|
|
21
|
+
BottomCenter = 8,
|
|
22
|
+
BottomRight = 9
|
|
23
|
+
}
|
|
24
|
+
export declare enum DimensionTextLineSpacing {
|
|
25
|
+
AtLeast = 1,
|
|
26
|
+
Exact = 2
|
|
27
|
+
}
|
|
28
|
+
export declare enum DimensionTextVertical {
|
|
29
|
+
Center = 0,
|
|
30
|
+
Above = 1,
|
|
31
|
+
Outside = 2,
|
|
32
|
+
JIS = 3,
|
|
33
|
+
Below = 4
|
|
34
|
+
}
|
|
35
|
+
export declare enum DimensionZeroSuppression {
|
|
36
|
+
Feet = 0,
|
|
37
|
+
None = 1,
|
|
38
|
+
Inch = 2,
|
|
39
|
+
FeetAndInch = 3,
|
|
40
|
+
Leading = 4,
|
|
41
|
+
Trailing = 8,
|
|
42
|
+
LeadingAndTrailing = 12
|
|
43
|
+
}
|
|
44
|
+
export declare enum DimensionZeroSuppressionAngular {
|
|
45
|
+
None = 0,
|
|
46
|
+
Leading = 1,
|
|
47
|
+
Trailing = 2,
|
|
48
|
+
LeadingAndTrailing = 3
|
|
49
|
+
}
|
|
50
|
+
export declare enum DimensionTextHorizontal {
|
|
51
|
+
Center = 0,
|
|
52
|
+
Left = 1,
|
|
53
|
+
Right = 2,
|
|
54
|
+
OverFirst = 3,
|
|
55
|
+
OverSecond = 4
|
|
56
|
+
}
|
|
57
|
+
export declare enum DimensionToleranceTextVertical {
|
|
58
|
+
Bottom = 0,
|
|
59
|
+
Center = 1,
|
|
60
|
+
Top = 2
|
|
61
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export declare enum HatchSolidFill {
|
|
2
|
+
PatternFill = 0,
|
|
3
|
+
SolidFill = 1
|
|
4
|
+
}
|
|
5
|
+
export declare enum HatchAssociativity {
|
|
6
|
+
NonAssociative = 0,// For MPolygon LacksSolidFill
|
|
7
|
+
Associative = 1
|
|
8
|
+
}
|
|
9
|
+
export declare enum HatchStyle {
|
|
10
|
+
Normal = 0,// Odd parity area
|
|
11
|
+
Outer = 1,// Outermost area
|
|
12
|
+
Ignore = 2
|
|
13
|
+
}
|
|
14
|
+
export declare enum HatchPatternType {
|
|
15
|
+
UserDefined = 0,
|
|
16
|
+
Predefined = 1,
|
|
17
|
+
Custom = 2
|
|
18
|
+
}
|
|
19
|
+
export declare enum HatchBoundaryAnnotation {
|
|
20
|
+
NotAnnotated = 0,
|
|
21
|
+
Annotated = 1
|
|
22
|
+
}
|
|
23
|
+
export declare enum HatchGradientFlag {
|
|
24
|
+
Solid = 0,
|
|
25
|
+
Gradient = 1
|
|
26
|
+
}
|
|
27
|
+
export declare enum HatchGradientColorFlag {
|
|
28
|
+
TwoColor = 0,
|
|
29
|
+
OneColor = 1
|
|
30
|
+
}
|
|
31
|
+
export declare enum BoundaryPathTypeFlag {
|
|
32
|
+
Default = 0,
|
|
33
|
+
External = 1,
|
|
34
|
+
Polyline = 2,
|
|
35
|
+
Derived = 4,
|
|
36
|
+
Textbox = 8,
|
|
37
|
+
Outermost = 16
|
|
38
|
+
}
|
|
39
|
+
export declare enum BoundaryPathEdgeType {
|
|
40
|
+
Line = 1,
|
|
41
|
+
Circular = 2,
|
|
42
|
+
Elliptic = 3,
|
|
43
|
+
Spline = 4
|
|
44
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './color';
|
|
2
|
+
export * from './config';
|
|
3
|
+
export * from './dimension';
|
|
4
|
+
export * from './hatch';
|
|
5
|
+
export * from './measurement';
|
|
6
|
+
export * from './obscuredLineTypes';
|
|
7
|
+
export * from './lineweight';
|
|
8
|
+
export * from './scene';
|
|
9
|
+
export * from './viewport';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Specifies the linetype of obscured lines.
|
|
3
|
+
* Obscured linetypes are independent of zoom level,
|
|
4
|
+
* unlike standard object linetypes.
|
|
5
|
+
*
|
|
6
|
+
* Value 0 turns off display of obscured lines and is the default
|
|
7
|
+
* */
|
|
8
|
+
export declare enum ObscuredLineTypes {
|
|
9
|
+
Off = 0,
|
|
10
|
+
Solid = 1,
|
|
11
|
+
Dashed = 2,
|
|
12
|
+
Dotted = 3,
|
|
13
|
+
ShotDash = 4,
|
|
14
|
+
MediumDash = 5,
|
|
15
|
+
LongDash = 6,
|
|
16
|
+
DoubleShortDash = 7,
|
|
17
|
+
DoubleMediumDash = 8,
|
|
18
|
+
DoubleLongDash = 9,
|
|
19
|
+
DoubleMediumLongDash = 10,
|
|
20
|
+
SparseDot = 11
|
|
21
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export declare enum ViewportStatusFlag {
|
|
2
|
+
PERSPECTIVE_MODE = 1,
|
|
3
|
+
FRONT_CLIPPING = 2,
|
|
4
|
+
BACK_CLIPPING = 4,
|
|
5
|
+
UCS_FOLLOW = 8,
|
|
6
|
+
FRONT_CLIP_NOT_AT_EYE = 16,
|
|
7
|
+
UCS_ICON_VISIBILITY = 32,
|
|
8
|
+
UCS_ICON_AT_ORIGIN = 64,
|
|
9
|
+
FAST_ZOOM = 128,
|
|
10
|
+
SNAP_MODE = 256,
|
|
11
|
+
GRID_MODE = 512,
|
|
12
|
+
ISOMETRIC_SNAP_STYLE = 1024,
|
|
13
|
+
HIDE_PLOT_MODE = 2048,
|
|
14
|
+
K_ISO_PAIR_TOP = 4096,
|
|
15
|
+
K_ISO_PAIR_RIGHT = 8192,
|
|
16
|
+
VIEWPORT_ZOOM_LOCKING = 16384,
|
|
17
|
+
UNUSED = 32768,
|
|
18
|
+
NON_RECTANGULAR_CLIPPING = 65536,
|
|
19
|
+
VIEWPORT_OFF = 131072,
|
|
20
|
+
GRID_BEYOND_DRAWING_LIMITS = 262144,
|
|
21
|
+
ADAPTIVE_GRID_DISPLAY = 524288,
|
|
22
|
+
SUBDIVISION_BELOW_SPACING = 1048576,
|
|
23
|
+
GRID_FOLLOWS_WORKPLANE = 2097152
|
|
24
|
+
}
|
|
25
|
+
export declare enum RenderMode {
|
|
26
|
+
OPTIMIZED_2D = 0,// classic 2D
|
|
27
|
+
WIREFRAME = 1,
|
|
28
|
+
HIDDEN_LINE = 2,
|
|
29
|
+
FLAT_SHADED = 3,
|
|
30
|
+
GOURAUD_SHADED = 4,
|
|
31
|
+
FLAT_SHADED_WITH_WIREFRAME = 5,
|
|
32
|
+
GOURAUD_SHADED_WITH_WIREFRAME = 6
|
|
33
|
+
}
|
|
34
|
+
export declare enum UCSPerViewport {
|
|
35
|
+
UCS_UNCHANGED = 0,
|
|
36
|
+
HAS_OWN_UCS = 1
|
|
37
|
+
}
|
|
38
|
+
export declare enum OrthographicType {
|
|
39
|
+
NON_ORTHOGRAPHIC = 0,
|
|
40
|
+
TOP = 1,
|
|
41
|
+
BOTTOM = 2,
|
|
42
|
+
FRONT = 3,
|
|
43
|
+
BACK = 4,
|
|
44
|
+
LEFT = 5,
|
|
45
|
+
RIGHT = 6
|
|
46
|
+
}
|
|
47
|
+
export declare enum ShadePlotMode {
|
|
48
|
+
AS_DISPLAYED = 0,
|
|
49
|
+
WIREFRAME = 1,
|
|
50
|
+
HIDDEN = 2,
|
|
51
|
+
RENDERED = 3
|
|
52
|
+
}
|
|
53
|
+
export declare enum DefaultLightingType {
|
|
54
|
+
ONE_DISTANT_LIGHT = 0,
|
|
55
|
+
TWO_DISTANT_LIGHTS = 1
|
|
56
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AutoCad files sometimes use an indexed color value between 1 and 255 inclusive.
|
|
3
|
+
* Each value corresponds to a color. index 1 is red, that is 16711680 or 0xFF0000.
|
|
4
|
+
* index 0 and 256, while included in this array, are actually reserved for inheritance
|
|
5
|
+
* values in AutoCad so they should not be used for index color lookups.
|
|
6
|
+
*/
|
|
7
|
+
declare const _default: number[];
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface ScannerGroup {
|
|
2
|
+
code: number;
|
|
3
|
+
value: any;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* DxfArrayScanner
|
|
7
|
+
*
|
|
8
|
+
* Based off the AutoCad 2012 DXF Reference
|
|
9
|
+
* http://images.autodesk.com/adsk/files/autocad_2012_pdf_dxf-reference_enu.pdf
|
|
10
|
+
*
|
|
11
|
+
* Reads through an array representing lines of a dxf file. Takes an array and
|
|
12
|
+
* provides an easy interface to extract group code and value pairs.
|
|
13
|
+
* @param data - an array where each element represents a line in the dxf file
|
|
14
|
+
* @constructor
|
|
15
|
+
*/
|
|
16
|
+
export default class DxfArrayScanner {
|
|
17
|
+
private _pointer;
|
|
18
|
+
private _data;
|
|
19
|
+
private _eof;
|
|
20
|
+
lastReadGroup: ScannerGroup;
|
|
21
|
+
constructor(data: string[]);
|
|
22
|
+
next(): {
|
|
23
|
+
code: number;
|
|
24
|
+
value: string | number | boolean;
|
|
25
|
+
};
|
|
26
|
+
peek(): ScannerGroup;
|
|
27
|
+
rewind(numberOfGroups?: number | undefined): void;
|
|
28
|
+
/**
|
|
29
|
+
* Returns true if there is another code/value pair (2 elements in the array).
|
|
30
|
+
* @returns {boolean}
|
|
31
|
+
*/
|
|
32
|
+
hasNext(): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Returns true if the scanner is at the end of the array
|
|
35
|
+
* @returns {boolean}
|
|
36
|
+
*/
|
|
37
|
+
isEOF(): boolean;
|
|
38
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import DxfArrayScanner from './DxfArrayScanner';
|
|
4
|
+
import type { ParsedDxf } from './types';
|
|
5
|
+
import { Readable } from 'readable-stream';
|
|
6
|
+
export default class DxfParser {
|
|
7
|
+
parseSync(dxfString: string): ParsedDxf;
|
|
8
|
+
parseStream(stream: Readable | fs.ReadStream): Promise<ParsedDxf>;
|
|
9
|
+
parseFromUrl(url: string, encoding?: string, init?: RequestInit | undefined): Promise<ParsedDxf | null>;
|
|
10
|
+
parseAll(scanner: DxfArrayScanner): ParsedDxf;
|
|
11
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import DxfArrayScanner, { ScannerGroup } from './DxfArrayScanner';
|
|
2
|
+
import { CommonDxfEntity } from './entities/shared';
|
|
3
|
+
/**
|
|
4
|
+
* Returns the truecolor value of the given AutoCad color index value
|
|
5
|
+
* @param {import('../types').ColorIndex} index
|
|
6
|
+
* @return {import('../types').ColorInstance} truecolor value as a number
|
|
7
|
+
*/
|
|
8
|
+
export declare function getAcadColor(index: number): number;
|
|
9
|
+
/** Some entities may contain embedded object which is started by group 101. All the rest data until
|
|
10
|
+
* end of entity should not be interpreted as entity attributes. There is no documentation for this
|
|
11
|
+
* feature.
|
|
12
|
+
* @param scanner
|
|
13
|
+
*/
|
|
14
|
+
export declare function skipEmbeddedObject(scanner: DxfArrayScanner): void;
|
|
15
|
+
/**
|
|
16
|
+
* Attempts to parse codes common to all entities. Returns true if the group
|
|
17
|
+
* was handled by this function.
|
|
18
|
+
* @param {*} entity - the entity currently being parsed
|
|
19
|
+
* @param {*} curr - the current group being parsed
|
|
20
|
+
*/
|
|
21
|
+
export declare function checkCommonEntityProperties(entity: CommonDxfEntity, curr: ScannerGroup, scanner: DxfArrayScanner): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type DxfArrayScanner from '../DxfArrayScanner';
|
|
2
|
+
import type { ScannerGroup } from '../DxfArrayScanner';
|
|
3
|
+
export declare function parseBlocks(curr: ScannerGroup, scanner: DxfArrayScanner): any;
|
|
4
|
+
export declare function parseBlock(curr: ScannerGroup, scanner: DxfArrayScanner): any;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Point3D } from '../../types';
|
|
2
|
+
import type { CommonDxfEntity } from '../entities/shared';
|
|
3
|
+
export interface DxfBlock {
|
|
4
|
+
type: number;
|
|
5
|
+
name: string;
|
|
6
|
+
name2: string;
|
|
7
|
+
handle: string;
|
|
8
|
+
ownerHandle: string;
|
|
9
|
+
layer: string;
|
|
10
|
+
position: Point3D;
|
|
11
|
+
paperSpace: boolean;
|
|
12
|
+
xrefPath: string;
|
|
13
|
+
entities?: CommonDxfEntity[];
|
|
14
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type DxfArrayScanner from '../../DxfArrayScanner';
|
|
2
|
+
import type { ScannerGroup } from '../../DxfArrayScanner';
|
|
3
|
+
export declare class ArcEntityParser {
|
|
4
|
+
static ForEntityName: string;
|
|
5
|
+
private parser;
|
|
6
|
+
parseEntity(scanner: DxfArrayScanner, curr: ScannerGroup): any;
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Point3D } from '../../../types';
|
|
2
|
+
import type { CommonDxfEntity } from '../shared';
|
|
3
|
+
export interface ArcEntity extends CommonDxfEntity {
|
|
4
|
+
type: 'ARC';
|
|
5
|
+
subclassMarker: 'AcDbArc';
|
|
6
|
+
thickness: number;
|
|
7
|
+
center: Point3D;
|
|
8
|
+
radius: number;
|
|
9
|
+
startAngle: number;
|
|
10
|
+
endAngle: number;
|
|
11
|
+
extrusionDirection: Point3D;
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type DxfArrayScanner from '../../DxfArrayScanner';
|
|
2
|
+
import type { ScannerGroup } from '../../DxfArrayScanner';
|
|
3
|
+
import type { AttdefEntity } from './types';
|
|
4
|
+
export declare class AttDefEntityParser {
|
|
5
|
+
static ForEntityName: string;
|
|
6
|
+
private parser;
|
|
7
|
+
parseEntity(scanner: DxfArrayScanner, curr: ScannerGroup): AttdefEntity;
|
|
8
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Point3D } from '../../../types';
|
|
2
|
+
import type { TextEntity } from '../text';
|
|
3
|
+
export interface AttdefEntity extends Omit<TextEntity, 'type' | 'subclassMarker'> {
|
|
4
|
+
type: 'ATTDEF';
|
|
5
|
+
subclassMarker: 'AcDbAttributeDefinition';
|
|
6
|
+
prompt: string;
|
|
7
|
+
tag: string;
|
|
8
|
+
attributeFlag: number;
|
|
9
|
+
isLocked: boolean;
|
|
10
|
+
isDuplicatedRecord: boolean;
|
|
11
|
+
mtextFlag: number;
|
|
12
|
+
isReallyLocked: boolean;
|
|
13
|
+
numberOfSecondaryAttributes: number;
|
|
14
|
+
secondaryAttributesHardIds: string[];
|
|
15
|
+
alignmentPoint: Point3D;
|
|
16
|
+
annotationScale: number;
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type DxfArrayScanner from '../../DxfArrayScanner';
|
|
2
|
+
import type { ScannerGroup } from '../../DxfArrayScanner';
|
|
3
|
+
import { AttributeEntity } from './types';
|
|
4
|
+
export declare class AttributeEntityParser {
|
|
5
|
+
static ForEntityName: string;
|
|
6
|
+
private parser;
|
|
7
|
+
parseEntity(scanner: DxfArrayScanner, curr: ScannerGroup): AttributeEntity;
|
|
8
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Point3D } from '../../../types';
|
|
2
|
+
import type { CommonDxfEntity } from '../shared';
|
|
3
|
+
export interface AttributeEntity extends CommonDxfEntity {
|
|
4
|
+
type: 'ATTRIB';
|
|
5
|
+
subclassMarker: 'AcDbAttribute';
|
|
6
|
+
thickness: number;
|
|
7
|
+
startPoint: Point3D;
|
|
8
|
+
textHeight: number;
|
|
9
|
+
text: string;
|
|
10
|
+
tag: string;
|
|
11
|
+
attributeFlag: number;
|
|
12
|
+
lineSpacing?: number;
|
|
13
|
+
rotation: number;
|
|
14
|
+
scale: number;
|
|
15
|
+
obliqueAngle: number;
|
|
16
|
+
textStyle: string;
|
|
17
|
+
textGenerationFlag: number;
|
|
18
|
+
horizontalJustification: number;
|
|
19
|
+
verticalJustification: number;
|
|
20
|
+
extrusionDirection: Point3D;
|
|
21
|
+
lockPositionFlag: boolean;
|
|
22
|
+
isDuplicatedEntriesKeep?: boolean;
|
|
23
|
+
mtextFlag: 2 | 4;
|
|
24
|
+
isReallyLocked?: boolean;
|
|
25
|
+
numberOfSecondaryAttributes?: number;
|
|
26
|
+
secondaryAttributesHardId?: string;
|
|
27
|
+
alignmentPoint: Point3D;
|
|
28
|
+
annotationScale?: number;
|
|
29
|
+
definitionTag?: string;
|
|
30
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type DxfArrayScanner from '../../DxfArrayScanner';
|
|
2
|
+
import type { ScannerGroup } from '../../DxfArrayScanner';
|
|
3
|
+
import type { CircleEntity } from './types';
|
|
4
|
+
export declare class CircleEntityParser {
|
|
5
|
+
static ForEntityName: string;
|
|
6
|
+
private parser;
|
|
7
|
+
parseEntity(scanner: DxfArrayScanner, curr: ScannerGroup): CircleEntity;
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Point3D } from '../../../types';
|
|
2
|
+
import type { CommonDxfEntity } from '../shared';
|
|
3
|
+
export interface CircleEntity extends CommonDxfEntity {
|
|
4
|
+
type: 'CIRCLE';
|
|
5
|
+
subclassMarker: 'AcDbCircle';
|
|
6
|
+
thickness: number;
|
|
7
|
+
center: Point3D;
|
|
8
|
+
radius: number;
|
|
9
|
+
extrusionDirection: Point3D;
|
|
10
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import DxfArrayScanner, { ScannerGroup } from 'parser/DxfArrayScanner';
|
|
2
|
+
import { DimensionEntity } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* @returns Return `false` if curr is not related to common dimension group
|
|
5
|
+
*/
|
|
6
|
+
export declare function parseDimension(entity: DimensionEntity, curr: ScannerGroup, scanner: DxfArrayScanner): void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import DxfArrayScanner, { ScannerGroup } from 'parser/DxfArrayScanner';
|
|
2
|
+
import { DimensionEntity } from './types';
|
|
3
|
+
export default class DimensionParser {
|
|
4
|
+
static ForEntityName: string;
|
|
5
|
+
parseEntity(scanner: DxfArrayScanner, curr: ScannerGroup): DimensionEntity;
|
|
6
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { AttachmentPoint, DimensionTextLineSpacing, DimensionType } from '../../../consts';
|
|
2
|
+
import type { Point3D } from '../../../types';
|
|
3
|
+
import type { CommonDxfEntity } from '../shared';
|
|
4
|
+
export interface DimensionEntityCommon extends CommonDxfEntity {
|
|
5
|
+
type: 'DIMENSION';
|
|
6
|
+
subclassMarker: string;
|
|
7
|
+
handle: string;
|
|
8
|
+
version: string;
|
|
9
|
+
name: string;
|
|
10
|
+
definitionPoint: Point3D;
|
|
11
|
+
textPoint: Point3D;
|
|
12
|
+
dimensionType: DimensionType;
|
|
13
|
+
attachmentPoint: AttachmentPoint;
|
|
14
|
+
textLineSpacingStyle?: DimensionTextLineSpacing;
|
|
15
|
+
textLineSpacingFactor?: number;
|
|
16
|
+
measurement?: number;
|
|
17
|
+
text?: string;
|
|
18
|
+
textRotation?: number;
|
|
19
|
+
ocsRotation?: number;
|
|
20
|
+
extrusionDirection?: Point3D;
|
|
21
|
+
styleName: string;
|
|
22
|
+
}
|
|
23
|
+
export interface AlignedDimensionEntity extends DimensionEntityCommon {
|
|
24
|
+
subclassMarker: 'AcDbAlignedDimension' | 'AcDbRotatedDimension';
|
|
25
|
+
insertionPoint?: Point3D;
|
|
26
|
+
subDefinitionPoint1: Point3D;
|
|
27
|
+
subDefinitionPoint2: Point3D;
|
|
28
|
+
rotationAngle: number;
|
|
29
|
+
obliqueAngle: number;
|
|
30
|
+
}
|
|
31
|
+
export interface AngularDimensionEntity extends DimensionEntityCommon {
|
|
32
|
+
subclassMarker: 'AcDb3PointAngularDimension';
|
|
33
|
+
subDefinitionPoint1: Point3D;
|
|
34
|
+
subDefinitionPoint2: Point3D;
|
|
35
|
+
centerPoint: Point3D;
|
|
36
|
+
arcPoint: Point3D;
|
|
37
|
+
}
|
|
38
|
+
export interface OrdinateDimensionEntity extends DimensionEntityCommon {
|
|
39
|
+
subclassMarker: 'AcDbOrdinateDimension';
|
|
40
|
+
subDefinitionPoint1: Point3D;
|
|
41
|
+
subDefinitionPoint2: Point3D;
|
|
42
|
+
}
|
|
43
|
+
export interface RadialDiameterDimensionEntity extends DimensionEntityCommon {
|
|
44
|
+
subclassMarker: 'AcDbRadialDimension' | 'AcDbDiametricDimension';
|
|
45
|
+
centerPoint: Point3D;
|
|
46
|
+
leaderLength: number;
|
|
47
|
+
}
|
|
48
|
+
export type DimensionEntity = DimensionEntityCommon & (Partial<AlignedDimensionEntity> | Partial<AngularDimensionEntity> | Partial<OrdinateDimensionEntity> | Partial<RadialDiameterDimensionEntity>);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import DxfArrayScanner, { ScannerGroup } from '../../DxfArrayScanner';
|
|
2
|
+
import { EllipseEntity } from './types';
|
|
3
|
+
export declare class EllipseEntityParser {
|
|
4
|
+
static ForEntityName: string;
|
|
5
|
+
private parser;
|
|
6
|
+
parseEntity(scanner: DxfArrayScanner, curr: ScannerGroup): EllipseEntity;
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Point3D } from '../../../types';
|
|
2
|
+
import type { CommonDxfEntity } from '../shared';
|
|
3
|
+
export interface EllipseEntity extends CommonDxfEntity {
|
|
4
|
+
type: 'ELLIPSE';
|
|
5
|
+
subclassMarker: 'AcDbEllipse';
|
|
6
|
+
center: Point3D;
|
|
7
|
+
majorAxisEndPoint: Point3D;
|
|
8
|
+
extrusionDirection: Point3D;
|
|
9
|
+
axisRatio: number;
|
|
10
|
+
startAngle: number;
|
|
11
|
+
endAngle: number;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DXFParserSnippet } from '../../../shared/parserGenerator';
|
|
2
|
+
export declare const LineEdgeSnippets: DXFParserSnippet[];
|
|
3
|
+
export declare const CircularEdgeSnippets: DXFParserSnippet[];
|
|
4
|
+
export declare const EllipseEdgeSnippets: DXFParserSnippet[];
|
|
5
|
+
export declare const SplineEdgeSnippets: DXFParserSnippet[];
|
|
6
|
+
export declare const EdgeBoundaryPathDataSnippets: DXFParserSnippet[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type DxfArrayScanner from '../../DxfArrayScanner';
|
|
2
|
+
import type { ScannerGroup } from '../../DxfArrayScanner';
|
|
3
|
+
import type { HatchEntity } from './types';
|
|
4
|
+
export declare class HatchEntityParser {
|
|
5
|
+
static ForEntityName: string;
|
|
6
|
+
private parser;
|
|
7
|
+
parseEntity(scanner: DxfArrayScanner, curr: ScannerGroup): HatchEntity;
|
|
8
|
+
}
|