dxf-json 0.8.4 → 0.9.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.
Files changed (32) hide show
  1. package/Readme.md +1 -1
  2. package/dist/bundle.cjs +2 -2
  3. package/dist/bundle.mjs +3 -3
  4. package/dist/types/consts/dimension.d.ts +17 -2
  5. package/dist/types/consts/dimension.d.ts.map +1 -1
  6. package/dist/types/consts/viewport.d.ts +2 -0
  7. package/dist/types/consts/viewport.d.ts.map +1 -1
  8. package/dist/types/parser/entities/dimension/parser.d.ts +6 -0
  9. package/dist/types/parser/entities/dimension/parser.d.ts.map +1 -1
  10. package/dist/types/parser/entities/dimension/types.d.ts +163 -10
  11. package/dist/types/parser/entities/dimension/types.d.ts.map +1 -1
  12. package/dist/types/parser/entities/index.d.ts.map +1 -1
  13. package/dist/types/parser/entities/mline/consts.d.ts +12 -0
  14. package/dist/types/parser/entities/mline/consts.d.ts.map +1 -0
  15. package/dist/types/parser/entities/mline/index.d.ts +4 -0
  16. package/dist/types/parser/entities/mline/index.d.ts.map +1 -0
  17. package/dist/types/parser/entities/mline/parser.d.ts +12 -0
  18. package/dist/types/parser/entities/mline/parser.d.ts.map +1 -0
  19. package/dist/types/parser/entities/mline/types.d.ts +151 -0
  20. package/dist/types/parser/entities/mline/types.d.ts.map +1 -0
  21. package/dist/types/parser/entities/shared.d.ts +15 -0
  22. package/dist/types/parser/entities/shared.d.ts.map +1 -1
  23. package/dist/types/parser/entities/viewport/parser.d.ts +2 -1
  24. package/dist/types/parser/entities/viewport/parser.d.ts.map +1 -1
  25. package/dist/types/parser/entities/viewport/types.d.ts +140 -6
  26. package/dist/types/parser/entities/viewport/types.d.ts.map +1 -1
  27. package/dist/types/parser/tables/dimStyle/consts.d.ts.map +1 -1
  28. package/dist/types/parser/tables/dimStyle/types.d.ts +7 -5
  29. package/dist/types/parser/tables/dimStyle/types.d.ts.map +1 -1
  30. package/package.json +1 -1
  31. package/dist/types/parser/entities/dimension/common.d.ts +0 -7
  32. package/dist/types/parser/entities/dimension/common.d.ts.map +0 -1
@@ -1,49 +1,202 @@
1
- import type { AttachmentPoint, DimensionTextLineSpacing, DimensionType } from '../../../consts';
1
+ import type { AttachmentPoint, DimensionTextLineSpacing } from '../../../consts';
2
2
  import type { Point3D } from '../../../types';
3
+ import type { DimStyleVariables } from '../../tables/dimStyle/types';
3
4
  import type { CommonDxfEntity } from '../shared';
4
- export interface DimensionEntityCommon extends CommonDxfEntity {
5
+ /**
6
+ * Base type of *DIMENSION* entities.
7
+ *
8
+ * @note In AutoCAD 2025, *DIMENSION* can have DIMSTYLE override not only in `xdata`
9
+ * but directly at the object itself. In this case, object may have DimStyle fields.
10
+ * @see DimStyleVariables
11
+ */
12
+ export interface DimensionEntityCommon extends CommonDxfEntity, Partial<DimStyleVariables> {
5
13
  type: 'DIMENSION';
14
+ /**
15
+ * Actually there are more than one subclass in one entity
16
+ * but because of historical reasons, very last subclass marker will be set
17
+ * */
6
18
  subclassMarker: string;
7
- handle: string;
8
- version: string;
19
+ /** Version number. Actually there is only one valid value `0` which means 2010 */
20
+ version: number;
21
+ /** Name of the block that contains the entities that make up the dimension picture */
9
22
  name: string;
23
+ /** Point defined by group code `(10, 20, 30)`. */
10
24
  definitionPoint: Point3D;
25
+ /** Middle point of dimension text (in OCS) */
11
26
  textPoint: Point3D;
12
- dimensionType: DimensionType;
27
+ /**
28
+ * Dimension type:
29
+ *
30
+ * Values `0` ~ `6` are integer values that represent the dimension type.
31
+ *
32
+ * Values `32`, `64`, and `128` are bit values, which are added to the integer values
33
+ * (value `32` is always set in R13 and later releases)
34
+ *
35
+ * @see DimensionType
36
+ * */
37
+ dimensionType: number;
13
38
  attachmentPoint: AttachmentPoint;
14
39
  textLineSpacingStyle?: DimensionTextLineSpacing;
15
40
  textLineSpacingFactor?: number;
41
+ /**
42
+ * Actual measurement
43
+ *
44
+ * @note This value is often missing or set to `0` in actual files,
45
+ * so don't believe this too much.
46
+ * */
16
47
  measurement?: number;
48
+ /**
49
+ * Dimension text explicitly entered by the user.
50
+ *
51
+ * - If `null` or `"<>"`, the dimension measurement is drawn as the text.
52
+ * - If `""`, the text is suppressed.
53
+ * - Anything else is drawn as the text.
54
+ * */
17
55
  text?: string;
56
+ /**
57
+ * The rotation angle of the dimension text away from
58
+ * its default orientation (the direction of the dimension line)
59
+ * */
18
60
  textRotation?: number;
61
+ /**
62
+ * Indicates the horizontal direction for the dimension entity.
63
+ *
64
+ * The dimension entity determines the orientation of dimension text
65
+ * and lines for horizontal, vertical, and rotated linear dimensions.
66
+ *
67
+ * This group value is the negative of the angle between the OCS X axis
68
+ * and the UCS X axis.
69
+ *
70
+ * It is always in the XY plane of the OCS.
71
+ */
19
72
  ocsRotation?: number;
20
73
  extrusionDirection?: Point3D;
74
+ /** Dimension style name */
21
75
  styleName: string;
22
76
  }
77
+ /**
78
+ * Type for linear and aligned dimension.
79
+ *
80
+ * @note In AutoCAD 2025, *DIMENSION* can have DIMSTYLE override not only in `xdata`
81
+ * but directly at the object itself. In this case, object may have DimStyle fields.
82
+ */
23
83
  export interface AlignedDimensionEntity extends DimensionEntityCommon {
84
+ /**
85
+ * Be aware of the naming: `AcDbAlignedDimension` is represented as "linear dimension"
86
+ * in AutoCAD, while `AcDbRotatedDimension` is represented as "aligned dimension".
87
+ *
88
+ * This is so confusing, but as we're following DXF spec, we used the one in data as is.
89
+ */
24
90
  subclassMarker: 'AcDbAlignedDimension' | 'AcDbRotatedDimension';
91
+ /** Insertion point for clones of a dimension—Baseline and Continue (in OCS) */
25
92
  insertionPoint?: Point3D;
93
+ /**
94
+ * Point defined by group code `(13, 23, 33)`. This specifies the start point of
95
+ * the **first extension line**.
96
+ * */
26
97
  subDefinitionPoint1: Point3D;
98
+ /**
99
+ * Point defined by group code `(14, 24, 34)`. This specifies the start point of
100
+ * the **second extension line**.
101
+ */
27
102
  subDefinitionPoint2: Point3D;
28
- rotationAngle: number;
29
- obliqueAngle: number;
103
+ /** Angle of rotated, horizontal, or vertical dimensions */
104
+ rotationAngle?: number;
105
+ /**
106
+ * Linear dimension types with an oblique angle have an optional group code `52`.
107
+ * When added to the rotation angle of the linear dimension (group code `50`),
108
+ * it gives the angle of the extension lines */
109
+ obliqueAngle?: number;
30
110
  }
111
+ /**
112
+ * `AngularDimension` is used to describe arc length or degree of angle.
113
+ *
114
+ * This is the most confusing part of *DIMENSION* entity, so read carefuly
115
+ * every comment of each properties before you use it.
116
+ *
117
+ * @note In AutoCAD 2025, *DIMENSION* can have DIMSTYLE override not only in `xdata`
118
+ * but directly at the object itself. In this case, object may have DimStyle fields.
119
+ */
31
120
  export interface AngularDimensionEntity extends DimensionEntityCommon {
32
- subclassMarker: 'AcDb3PointAngularDimension';
121
+ /**
122
+ * @note subclass marker doesn't related to 3-point or 4-point mode.
123
+ */
124
+ subclassMarker: 'AcDb3PointAngularDimension' | 'AcDb2LineAngularDimension';
125
+ /**
126
+ * Point defined by group code `(13, 23, 33)`.
127
+ * This is used to determine the first extension line.
128
+ * */
33
129
  subDefinitionPoint1: Point3D;
130
+ /**
131
+ * Point defined by group code `(14, 24, 34)`.
132
+ *
133
+ * In 3-point mode, this specifies the start of the second extension line.
134
+ *
135
+ * In 4-point mode, this specifies the start of the first extension line.
136
+ * */
34
137
  subDefinitionPoint2: Point3D;
138
+ /**
139
+ * Point defined by group code `(15,25,35)`.
140
+ *
141
+ * In 3-point mode, this specifies the vertex of the angle in three point mode.
142
+ *
143
+ * In 4-point mode, this specifies the start of the second extension line.
144
+ */
35
145
  centerPoint: Point3D;
36
- arcPoint: Point3D;
146
+ /**
147
+ * Point defined by group code `(16, 26, 36)`.
148
+ *
149
+ * This specifies the location of the dimension line arc.
150
+ *
151
+ * @note this only exist on 4-point mode.
152
+ * */
153
+ arcPoint?: Point3D;
37
154
  }
155
+ /**
156
+ * Z shaped dimension.
157
+ *
158
+ * Note that `definitionPoint` of `OrdinateDimension` doesn't matter at all,
159
+ * as the actual points are defined in `subDefinitionPoint1` and `subDefinitionPoint2`.
160
+ *
161
+ * @note In AutoCAD 2025, *DIMENSION* can have DIMSTYLE override not only in `xdata`
162
+ * but directly at the object itself. In this case, object may have DimStyle fields.
163
+ */
38
164
  export interface OrdinateDimensionEntity extends DimensionEntityCommon {
39
165
  subclassMarker: 'AcDbOrdinateDimension';
166
+ /**
167
+ * Point defined by group code `(13, 23, 33)`.
168
+ *
169
+ * It specifies the start position of dimension line.
170
+ * */
40
171
  subDefinitionPoint1: Point3D;
172
+ /**
173
+ * Point defined by group code `(14, 24, 34)`.
174
+ *
175
+ * It specifies the end position of ordinate dimension.
176
+ * */
41
177
  subDefinitionPoint2: Point3D;
42
178
  }
179
+ /**
180
+ * In `AcDbRadialDimension`, `definitionPoint` specifies the center of circle.
181
+ *
182
+ * In `AcDbDiametricDimension`, `definitionPoint` specifies the one end of diameter line.
183
+ *
184
+ * @note In AutoCAD 2025, *DIMENSION* can have DIMSTYLE override not only in `xdata`
185
+ * but directly at the object itself. In this case, object may have DimStyle fields.
186
+ */
43
187
  export interface RadialDiameterDimensionEntity extends DimensionEntityCommon {
44
188
  subclassMarker: 'AcDbRadialDimension' | 'AcDbDiametricDimension';
45
- centerPoint: Point3D;
189
+ /**
190
+ * Point defined by group code `(15, 25, 35)`.
191
+ *
192
+ * It specifies the other end of radial/diameter line.
193
+ * */
194
+ subDefinitionPoint: Point3D;
195
+ /** Leader length for radius and diameter dimensions */
46
196
  leaderLength: number;
47
197
  }
198
+ /**
199
+ * Combined type of *DIMENSION* entity.
200
+ */
48
201
  export type DimensionEntity = DimensionEntityCommon & (Partial<AlignedDimensionEntity> | Partial<AngularDimensionEntity> | Partial<OrdinateDimensionEntity> | Partial<RadialDiameterDimensionEntity>);
49
202
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/parser/entities/dimension/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,eAAe,EACf,wBAAwB,EACxB,aAA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AAW,uBAAwB,SAAQ,qBAAqB;IAClE,cAAc,EAAE,uBAAuB,CAAC;IACxC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,mBAAmB,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,6BAA8B,SAAQ,qBAAqB;IACxE,cAAc,EAAE,qBAAqB,GAAG,wBAAwB,CAAC;IACjE,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,eAAe,GAAG,qBAAqB,GAC/C,CACM,OAAO,CAAC,sBAAsB,CAAC,GAC/B,OAAO,CAAC,sBAAsB,CAAC,GAC/B,OAAO,CAAC,uBAAuB,CAAC,GAChC,OAAO,CAAC,6BAA6B,CAAC,CAC3C,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/parser/entities/dimension/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,eAAe,EACf,wBAAwB,EAC3B,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,WAAW,qBAAsB,SAAQ,eAAe,EAAE,OAAO,CAAC,iBAAiB,CAAC;IACtF,IAAI,EAAE,WAAW,CAAC;IAClB;;;SAGK;IACL,cAAc,EAAE,MAAM,CAAC;IACvB,kFAAkF;IAClF,OAAO,EAAE,MAAM,CAAC;IAChB,sFAAsF;IACtF,IAAI,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,eAAe,EAAE,OAAO,CAAC;IACzB,8CAA8C;IAC9C,SAAS,EAAE,OAAO,CAAC;IACnB;;;;;;;;;SASK;IACL,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,eAAe,CAAC;IACjC,oBA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,EAAE,MAAM,UAAU,CAAC;AAyC3C;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,eAAe,GACvB,eAAe,EAAE,CA8BnB"}
@@ -0,0 +1,12 @@
1
+ export declare enum MLineJustification {
2
+ Top = 0,
3
+ Zero = 1,
4
+ Bottom = 2
5
+ }
6
+ export declare enum MLineFlags {
7
+ HasVertex = 1,
8
+ Closed = 2,
9
+ SuppressStartCaps = 4,
10
+ SuppressEndCaps = 8
11
+ }
12
+ //# sourceMappingURL=consts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../../../src/parser/entities/mline/consts.ts"],"names":[],"mappings":"AAAA,oBAAY,kBAAkB;IAC5B,GAAG,IAAI;IACP,IAAI,IAAI;IACR,MAAM,IAAI;CACX;AAED,oBAAY,UAAU;IACpB,SAAS,IAAI;IACb,MAAM,IAAI;IACV,iBAAiB,IAAI;IACrB,eAAe,IAAI;CACpB"}
@@ -0,0 +1,4 @@
1
+ export type * from './types';
2
+ export * from './consts';
3
+ export * from './parser';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/parser/entities/mline/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,SAAS,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA"}
@@ -0,0 +1,12 @@
1
+ import type { DxfArrayScanner, ScannerGroup } from '../../DxfArrayScanner';
2
+ import { type DXFParserSnippet } from '../../shared/parserGenerator';
3
+ import type { MLineEntity } from './types';
4
+ export declare const MLineElementParser: DXFParserSnippet[];
5
+ export declare const MLineSegmentParser: DXFParserSnippet[];
6
+ export declare const MLineDXFEntitySnippet: DXFParserSnippet[];
7
+ export declare class MLineEntityParser {
8
+ static ForEntityName: string;
9
+ private parser;
10
+ parseEntity(scanner: DxfArrayScanner, curr: ScannerGroup): MLineEntity;
11
+ }
12
+ //# sourceMappingURL=parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../../../src/parser/entities/mline/parser.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAE,KAAK,gBAAgB,EAAuC,MAAM,8BAA8B,CAAC;AAC1G,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,eAAO,MAAM,kBAAkB,EAAE,gBAAgB,EAuBhD,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,gBAAgB,EA2BhD,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,gBAAgB,EAgEnD,CAAA;AAED,qBAAa,iBAAiB;IAC5B,MAAM,CAAC,aAAa,SAAU;IAC9B,OAAO,CAAC,MAAM,CAAsC;IAEpD,WAAW,CAAC,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,YAAY,GAAG,WAAW;CAKvE"}
@@ -0,0 +1,151 @@
1
+ import type { Point3D } from "../../../types";
2
+ import type { CommonDxfEntity } from "../shared";
3
+ import type { MLineJustification } from "./consts";
4
+ /**
5
+ * MLINE describes parallel lines along defined segments.
6
+ * It can define line pattern similar to LINETYPE, but it's independent to that.
7
+ *
8
+ * `MLineEntity` is composed of `MLineSegment` which defines position and direction.
9
+ * `MLineSegment` contains multiple `MLineElement` which defines actual visible lines.
10
+ *
11
+ * MLINE seems to be removed from AutoCAD 2025 GUI, but it's still supported.
12
+ */
13
+ export interface MLineEntity extends CommonDxfEntity {
14
+ type: 'MLINE';
15
+ /** Parsed by group code `100` */
16
+ subclassMarker: 'AcDbMline';
17
+ /**
18
+ * String of up to 32 characters. The name of the style used for this mline.
19
+ *
20
+ * An entry for this style must exist in the `MLINESTYLE` dictionary.
21
+ *
22
+ * Do not modify this field without also updating the associated entry
23
+ * in the `MLINESTYLE` dictionary.
24
+ *
25
+ * @note These groups should not be modified under any circumstances,
26
+ * although it is safe to read them and use their values.
27
+ * The correct fields to modify are as follows:
28
+ *
29
+ * - MLINE: The `340` group(=`styleObjectHandle`) in the same object,
30
+ * which indicates the proper `MLINESTYLE` object.
31
+ * - MLINESTYLE: The `3` group value in the `MLINESTYLE` dictionary,
32
+ * which precedes the `350` group that has the handle or
33
+ * entity name of the current `MLINESTYLE`.
34
+ *
35
+ * Parsed by group code `2`
36
+ */
37
+ name: string;
38
+ /**
39
+ * Pointer-handle/ID of `MLINESTYLE` object
40
+ *
41
+ * Parsed by group code `340`
42
+ * */
43
+ styleObjectHandle: string;
44
+ /** Parsed by group code `40` */
45
+ scale: number;
46
+ /** Parsed by group code `70` */
47
+ justification: MLineJustification;
48
+ /**
49
+ * Bitwise combination of `MLineFlags`
50
+ *
51
+ * Parsed by group code `71`
52
+ *
53
+ * @see MLineFlags
54
+ */
55
+ flags: number;
56
+ /** Parsed by group code `72` */
57
+ vertexCount: number;
58
+ /**
59
+ * Number of elements in `MLINESTYLE` definition
60
+ *
61
+ * Parsed by group code `73`
62
+ */
63
+ styleCount: number;
64
+ /**
65
+ * Start point (in WCS)
66
+ *
67
+ * Parsed by group code `10`
68
+ */
69
+ startPosition: Point3D;
70
+ /**
71
+ * Parsed by group code `210`
72
+ */
73
+ extrusionDirection: Point3D;
74
+ segments?: MLineSegment[];
75
+ }
76
+ export interface MLineSegment {
77
+ /**
78
+ * Vertex coordinate (in WCS)
79
+ *
80
+ * Parsed by group code `11`
81
+ * */
82
+ position: Point3D;
83
+ /**
84
+ * Direction vector of segment starting at this vertex.
85
+ *
86
+ * Parsed by group code `12`
87
+ * */
88
+ direction: Point3D;
89
+ /**
90
+ * Direction vector of miter (joint) at this vertex.
91
+ *
92
+ * This defines the direction between `position` and the definition point
93
+ * of actual visible line element (which described in `elements`).
94
+ *
95
+ * Typically it's normalized from AutoCAD but it's not guaranteed in spec.
96
+ *
97
+ * Parsed by group code `13`
98
+ * */
99
+ miterDirection: Point3D;
100
+ /**
101
+ * @see MLineElement
102
+ * */
103
+ elements?: MLineElement[];
104
+ }
105
+ export interface MLineElement {
106
+ /**
107
+ * Number of parameters for this segment. Typical value is `2`
108
+ * but it can be more than `2` if this segment is dashed one.
109
+ *
110
+ * Parsed by group code `74`
111
+ */
112
+ parameterCount: number;
113
+ /**
114
+ * First parameter defines the distance between `position`
115
+ * and the start position of actual line element along `miterDirection`.
116
+ *
117
+ * The remains describe dash pattern of this element.
118
+ *
119
+ * The second one of this is the distance from the start of the line element
120
+ * to the first break in the line element, along `direction`.
121
+ *
122
+ * The successive group code 41 values continue to list the
123
+ * start and stop points of the line element in this segment.
124
+ *
125
+ * Typical value is `[distance, 0]` which means a solid line.
126
+ *
127
+ * Parsed by group code `41`
128
+ *
129
+ * @note Linetypes do not affect to this
130
+ */
131
+ parameters?: number[];
132
+ /**
133
+ * Typical value is `0`.
134
+ *
135
+ * Parsed by group code `75`
136
+ */
137
+ fillCount: number;
138
+ /**
139
+ * The group code 42 parameterization is also a list of real values.
140
+ * Similar to the `parameters`, it describes the parameterization of
141
+ * the fill area for this MLINE segment.
142
+ *
143
+ * The values are interpreted identically to the 41 parameters and
144
+ * when taken as a whole for all line elements in the MLINE segment,
145
+ * they define the boundary of the fill area for the MLINE segment.
146
+ *
147
+ * Parsed by group code `42`
148
+ */
149
+ fillParameters?: number[];
150
+ }
151
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/parser/entities/mline/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAElD;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAY,SAAQ,eAAe;IAClD,IAAI,EAAE,OAAO,CAAA;IACb,iCAAiC;IACjC,cAAc,EAAE,WAAW,CAAA;IAC3B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;;;SAIK;IACL,iBAAiB,EAAE,MAAM,CAAA;IACzB,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,gCAAgC;IAChC,aAAa,EAAE,kBAAkB,CAAA;IACjC;;;;;;OAMG;IACH,KAAK,EAAE,MAAM,CAAA;IACb,gCAAgC;IAChC,WAAW,EAAE,MAAM,CAAA;IACnB;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,aAAa,EAAE,OAAO,CAAA;IACtB;;OAEG;IACH,kBAAkB,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAA;CAC1B;AAED,MAAM,WAAW,YAAY;IAC3B;;;;SAIK;IACL,QAAQ,EAAE,OAAO,CAAA;IACjB;;;;SAIK;IACL,SAAS,EAAE,OAAO,CAAA;IAClB;;;;;;;;;SASK;IACL,cAAc,EAAE,OAAO,CAAA;IACvB;;SAEK;IACL,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAA;CAC1B;AAED,MAAM,WAAW,YAAY;IAC3B;;;;;OAKG;IACH,cAAc,EAAE,MAAM,CAAA;IACtB;;;;;;;;;;;;;;;;;OAiBG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB;;;;;;;;;;OAUG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;CAC1B"}
@@ -13,11 +13,26 @@ export interface CommonDxfEntity {
13
13
  materialObjectHardId?: string;
14
14
  colorIndex?: ColorIndex;
15
15
  lineweight?: number;
16
+ /** @default 1 If not presented */
16
17
  lineTypeScale?: number;
17
18
  isVisible?: boolean;
18
19
  proxyByte?: number;
19
20
  proxyEntity?: string;
21
+ /**
22
+ * A 24-bit color value that should be dealt with in terms of bytes with values of 0 to 255.
23
+ *
24
+ * The lowest byte is the blue value, the middle byte is the green value, and the third byte is the red value. The top byte is always 0.
25
+ *
26
+ * The group code cannot be used by custom entities for their own data because
27
+ * the group code is reserved for AcDbEntity, class-level color data and AcDbEntity, class-level transparency data
28
+ *
29
+ * @note From v0.9.0, if there is no explicit 420 group code, no fallback will be given.
30
+ */
20
31
  color?: ColorInstance;
32
+ /**
33
+ * The group code cannot be used by custom entities for their own data because
34
+ * the group code is reserved for AcDbEntity, class-level color data and AcDbEntity, class-level transparency data
35
+ */
21
36
  colorName?: string;
22
37
  transparency?: number;
23
38
  plotStyleType?: PlotStyleType;
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/parser/entities/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE5D,OAAO,EACH,KAAK,gBAAgB,EAGxB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,KAAK,KAAK,EAAuB,MAAM,iBAAiB,CAAC;AAElE,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CA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EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd;;;;SAIK;IACL,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC,CAAA;CAC9C;AAED,oBAAY,UAAU;IAClB,gBAAgB,IAAI;IACpB,IAAI,IAAI;IACR,OAAO,IAAI;IACX,MAAM,IAAI;CACb;AAGD,eAAO,MAAM,oBAAoB,EAAE,gBAAgB,EAgHlD,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAqB7E"}
@@ -1,6 +1,7 @@
1
+ import type { DxfArrayScanner, ScannerGroup } from '../../DxfArrayScanner';
1
2
  import type { ViewportEntity } from './types';
2
3
  export declare class ViewportParser {
3
4
  static ForEntityName: string;
4
- parseEntity(scanner: any, curr: any): ViewportEntity;
5
+ parseEntity(scanner: DxfArrayScanner, curr: ScannerGroup): ViewportEntity;
5
6
  }
6
7
  //# sourceMappingURL=parser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../../../src/parser/entities/viewport/parser.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,qBAAa,cAAc;IACvB,MAAM,CAAC,aAAa,SAAc;IAElC,WAAW,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG;CAiBtC"}
1
+ {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../../../src/parser/entities/viewport/parser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAS3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAoP9C,qBAAa,cAAc;IACvB,MAAM,CAAC,aAAa,SAAc;IAElC,WAAW,CAAC,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,YAAY,GAAG,cAAc;CAM5E"}