dxf-json 0.3.0 → 0.5.0
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/bundle.cjs +2 -2
- package/dist/bundle.mjs +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/parser/DxfArrayScanner.d.ts +8 -7
- package/dist/parser/ParseHelpers.d.ts +3 -8
- package/dist/parser/entities/arc/index.d.ts +1 -1
- package/dist/parser/entities/attdef/index.d.ts +1 -1
- package/dist/parser/entities/attribute/index.d.ts +1 -1
- package/dist/parser/entities/attribute/parser.d.ts +1 -1
- package/dist/parser/entities/circle/index.d.ts +1 -1
- package/dist/parser/entities/dimension/common.d.ts +2 -1
- package/dist/parser/entities/dimension/index.d.ts +2 -6
- package/dist/parser/entities/dimension/parser.d.ts +7 -0
- package/dist/parser/entities/dimension/types.d.ts +1 -1
- package/dist/parser/entities/ellipse/index.d.ts +1 -1
- package/dist/parser/entities/ellipse/parser.d.ts +3 -2
- package/dist/parser/entities/hatch/boundaryPathData/polyline.d.ts +1 -1
- package/dist/parser/entities/hatch/index.d.ts +1 -1
- package/dist/parser/entities/hatch/types/boundaryPath.d.ts +1 -1
- package/dist/parser/entities/hatch/types/definitionLine.d.ts +1 -1
- package/dist/parser/entities/image/index.d.ts +1 -1
- package/dist/parser/entities/insert/index.d.ts +1 -1
- package/dist/parser/entities/leader/index.d.ts +1 -1
- package/dist/parser/entities/line/index.d.ts +1 -1
- package/dist/parser/entities/lwpolyline/index.d.ts +1 -1
- package/dist/parser/entities/mtext/index.d.ts +1 -1
- package/dist/parser/entities/multileader/index.d.ts +2 -0
- package/dist/parser/entities/multileader/parser.d.ts +8 -0
- package/dist/parser/entities/multileader/types.d.ts +34 -0
- package/dist/parser/entities/point/index.d.ts +1 -1
- package/dist/parser/entities/point/parser.d.ts +2 -1
- package/dist/parser/entities/point/types.d.ts +1 -1
- package/dist/parser/entities/polyline/index.d.ts +1 -1
- package/dist/parser/entities/polyline/types.d.ts +2 -2
- package/dist/parser/entities/ray/index.d.ts +2 -0
- package/dist/parser/entities/ray/parser.d.ts +8 -0
- package/dist/parser/entities/ray/types.d.ts +10 -0
- package/dist/parser/entities/section/index.d.ts +1 -1
- package/dist/parser/entities/shared.d.ts +8 -5
- package/dist/parser/entities/solid/index.d.ts +1 -1
- package/dist/parser/entities/solid/types.d.ts +1 -1
- package/dist/parser/entities/spline/index.d.ts +1 -1
- package/dist/parser/entities/text/index.d.ts +1 -1
- package/dist/parser/entities/text/parser.d.ts +1 -1
- package/dist/parser/entities/text/types.d.ts +1 -1
- package/dist/parser/entities/types.d.ts +20 -19
- package/dist/parser/entities/vertex/index.d.ts +1 -1
- package/dist/parser/entities/vertex/parser.d.ts +1 -1
- package/dist/parser/entities/vertex/types.d.ts +3 -3
- package/dist/parser/entities/viewport/index.d.ts +2 -5
- package/dist/parser/entities/viewport/parser.d.ts +5 -0
- package/dist/parser/getAcadColor.d.ts +7 -0
- package/dist/parser/index.d.ts +1 -0
- package/dist/parser/shared/extensions/parser.d.ts +3 -0
- package/dist/parser/shared/xdata/index.d.ts +1 -1
- package/dist/parser/tables/blockRecord/index.d.ts +1 -1
- package/dist/parser/tables/dimStyle/index.d.ts +1 -1
- package/dist/parser/tables/index.d.ts +1 -1
- package/dist/parser/tables/layer/index.d.ts +1 -1
- package/dist/parser/tables/ltype/index.d.ts +1 -1
- package/dist/parser/tables/parser.d.ts +2 -1
- package/dist/parser/tables/style/index.d.ts +1 -1
- package/dist/parser/tables/vport/index.d.ts +1 -1
- package/dist/parser/types.d.ts +7 -7
- package/dist/types/index.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Point3D } from '../../../types';
|
|
2
|
-
import { CommonDxfEntity } from '../shared';
|
|
3
|
-
import { VertexEntity } from '../vertex/types';
|
|
2
|
+
import type { CommonDxfEntity } from '../shared';
|
|
3
|
+
import type { VertexEntity } from '../vertex/types';
|
|
4
4
|
import type { SmoothType } from './consts';
|
|
5
5
|
export interface PolylineEntity extends CommonDxfEntity {
|
|
6
6
|
type: 'POLYLINE';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type DxfArrayScanner from '../../DxfArrayScanner';
|
|
2
|
+
import type { ScannerGroup } from '../../DxfArrayScanner';
|
|
3
|
+
import type { RayEntity } from './types';
|
|
4
|
+
export declare class RayParser {
|
|
5
|
+
static ForEntityName: string;
|
|
6
|
+
private parser;
|
|
7
|
+
parseEntity(scanner: DxfArrayScanner, curr: ScannerGroup): RayEntity;
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Point3D } from '../../../types';
|
|
2
|
+
import type { CommonDxfEntity } from '../shared';
|
|
3
|
+
export interface RayEntity extends CommonDxfEntity {
|
|
4
|
+
type: 'RAY';
|
|
5
|
+
subclassMarker: 'AcDbRay';
|
|
6
|
+
/** Start point (in WCS) */
|
|
7
|
+
position: Point3D;
|
|
8
|
+
/** Unit direction vector (in WCS) */
|
|
9
|
+
direction: Point3D;
|
|
10
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './types';
|
|
1
|
+
export type * from './types';
|
|
2
2
|
export * from './parser';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
1
|
+
import type { ScannerGroup } from '@src/parser/DxfArrayScanner';
|
|
2
|
+
import type { ColorIndex, ColorInstance } from '@src/types';
|
|
3
3
|
import { DXFParserSnippet } from '../shared/parserGenerator';
|
|
4
4
|
import { XData } from '../shared/xdata';
|
|
5
5
|
export interface CommonDxfEntity {
|
|
@@ -22,8 +22,12 @@ export interface CommonDxfEntity {
|
|
|
22
22
|
plotStyleHardId?: string;
|
|
23
23
|
shadowMode?: ShadowMode;
|
|
24
24
|
xdata?: XData;
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Application specific extension by their application-name.
|
|
27
|
+
* As it differs by application, you have to parse by your own.
|
|
28
|
+
* Note that group codes 102 for brackets are not included in the array.
|
|
29
|
+
* */
|
|
30
|
+
extensions?: Record<string, ScannerGroup[]>;
|
|
27
31
|
}
|
|
28
32
|
export declare enum ShadowMode {
|
|
29
33
|
CAST_AND_RECEIVE = 0,
|
|
@@ -32,4 +36,3 @@ export declare enum ShadowMode {
|
|
|
32
36
|
IGNORE = 3
|
|
33
37
|
}
|
|
34
38
|
export declare const CommonEntitySnippets: DXFParserSnippet[];
|
|
35
|
-
export declare function skipApplicationGroups(curr: ScannerGroup, scanner: DxfArrayScanner): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './types';
|
|
1
|
+
export type * from './types';
|
|
2
2
|
export * from './parser';
|
|
@@ -2,7 +2,7 @@ import type DxfArrayScanner from '../../DxfArrayScanner';
|
|
|
2
2
|
import type { ScannerGroup } from '../../DxfArrayScanner';
|
|
3
3
|
import { DXFParserSnippet } from '../../shared/parserGenerator';
|
|
4
4
|
import { TextHorizontalAlign, TextVerticalAlign } from './consts';
|
|
5
|
-
import { TextEntity } from './types';
|
|
5
|
+
import type { TextEntity } from './types';
|
|
6
6
|
export declare const DefaultTextEntity: {
|
|
7
7
|
thickness: number;
|
|
8
8
|
rotation: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Point3D } from '../../../types';
|
|
2
2
|
import type { CommonDxfEntity } from '../shared';
|
|
3
|
-
import { TextHorizontalAlign, TextVerticalAlign } from './consts';
|
|
3
|
+
import type { TextHorizontalAlign, TextVerticalAlign } from './consts';
|
|
4
4
|
export interface TextEntity extends CommonDxfEntity {
|
|
5
5
|
type: 'TEXT';
|
|
6
6
|
subclassMarker: 'AcDbText';
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
export * from "./arc";
|
|
2
|
-
export * from "./attdef";
|
|
3
|
-
export * from "./circle";
|
|
4
|
-
export * from "./dimension";
|
|
5
|
-
export * from "./ellipse";
|
|
6
|
-
export * from "./hatch";
|
|
1
|
+
export type * from "./arc";
|
|
2
|
+
export type * from "./attdef";
|
|
3
|
+
export type * from "./circle";
|
|
4
|
+
export type * from "./dimension";
|
|
5
|
+
export type * from "./ellipse";
|
|
6
|
+
export type * from "./hatch";
|
|
7
7
|
export type * from './image';
|
|
8
|
-
export * from "./insert";
|
|
9
|
-
export * from "./leader";
|
|
10
|
-
export * from "./line";
|
|
11
|
-
export * from "./lwpolyline";
|
|
12
|
-
export * from "./mtext";
|
|
13
|
-
export * from "./point";
|
|
14
|
-
export * from "./polyline";
|
|
15
|
-
export * from "./
|
|
16
|
-
export * from "./
|
|
17
|
-
export * from "./
|
|
18
|
-
export * from "./
|
|
19
|
-
export * from "./
|
|
20
|
-
export * from "./
|
|
8
|
+
export type * from "./insert";
|
|
9
|
+
export type * from "./leader";
|
|
10
|
+
export type * from "./line";
|
|
11
|
+
export type * from "./lwpolyline";
|
|
12
|
+
export type * from "./mtext";
|
|
13
|
+
export type * from "./point";
|
|
14
|
+
export type * from "./polyline";
|
|
15
|
+
export type * from "./ray";
|
|
16
|
+
export type * from "./section";
|
|
17
|
+
export type * from "./solid";
|
|
18
|
+
export type * from "./spline";
|
|
19
|
+
export type * from "./text";
|
|
20
|
+
export type * from "./vertex";
|
|
21
|
+
export type * from "./viewport";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type DxfArrayScanner from '../../DxfArrayScanner';
|
|
2
2
|
import type { ScannerGroup } from '../../DxfArrayScanner';
|
|
3
|
-
import { VertexEntity } from './types';
|
|
3
|
+
import type { VertexEntity } from './types';
|
|
4
4
|
export declare class VertexParser {
|
|
5
5
|
static ForEntityName: string;
|
|
6
6
|
private parser;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Point3D } from '../../../types';
|
|
2
|
-
import { CommonDxfEntity } from '../shared';
|
|
3
|
-
import { VertexFlag } from './consts';
|
|
1
|
+
import type { Point3D } from '../../../types';
|
|
2
|
+
import type { CommonDxfEntity } from '../shared';
|
|
3
|
+
import type { VertexFlag } from './consts';
|
|
4
4
|
export interface VertexEntity extends CommonDxfEntity, Point3D {
|
|
5
5
|
subclassMarker: 'AcDb2dVertex' | 'AcDb3dPolylineVertex';
|
|
6
6
|
startWidth: number;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ColorIndex, ColorInstance } from "../types/color";
|
|
2
|
+
/**
|
|
3
|
+
* Returns the truecolor value of the given AutoCad color index value
|
|
4
|
+
* @param index
|
|
5
|
+
* @return truecolor value as a number
|
|
6
|
+
*/
|
|
7
|
+
export declare function getAcadColor(index: ColorIndex): ColorInstance;
|
package/dist/parser/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './types';
|
|
1
|
+
export type * from './types';
|
|
2
2
|
export * from './parser';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './types';
|
|
1
|
+
export type * from './types';
|
|
2
2
|
export * from './parser';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './types';
|
|
1
|
+
export type * from './types';
|
|
2
2
|
export * from './parser';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './types';
|
|
1
|
+
export type * from './types';
|
|
2
2
|
export * from './parser';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './types';
|
|
1
|
+
export type * from './types';
|
|
2
2
|
export * from './parser';
|
package/dist/parser/types.d.ts
CHANGED
|
@@ -3,13 +3,13 @@ import type { DxfBlock } from './blocks/types';
|
|
|
3
3
|
import type { CommonDxfEntity } from './entities/shared';
|
|
4
4
|
import type { CommonDXFObject } from './objects/common';
|
|
5
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';
|
|
6
|
+
import type { BlockRecordTableEntry } from './tables/blockRecord';
|
|
7
|
+
import type { DimStylesTableEntry } from './tables/dimStyle';
|
|
8
|
+
import type { LayerTableEntry } from './tables/layer';
|
|
9
|
+
import type { LTypeTableEntry } from './tables/ltype';
|
|
10
|
+
import type { StyleTableEntry } from './tables/style';
|
|
11
|
+
import type { DxfTable } from './tables/types';
|
|
12
|
+
import type { VPortTableEntry } from './tables/vport';
|
|
13
13
|
export interface ParsedDxf {
|
|
14
14
|
header: DxfHeader;
|
|
15
15
|
blocks: Record<string, DxfBlock>;
|
package/dist/types/index.d.ts
CHANGED