ofs-dxf-ts 1.0.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.
Files changed (97) hide show
  1. package/API.md +411 -0
  2. package/CHANGELOG.md +26 -0
  3. package/LICENSE +21 -0
  4. package/README.md +119 -0
  5. package/dist/core/dxf-builder.d.ts +348 -0
  6. package/dist/core/dxf-builder.js +549 -0
  7. package/dist/core/dxf-document.d.ts +220 -0
  8. package/dist/core/dxf-document.js +529 -0
  9. package/dist/core/dxf-entities.d.ts +327 -0
  10. package/dist/core/dxf-entities.js +22 -0
  11. package/dist/core/dxf-serializer.d.ts +48 -0
  12. package/dist/core/dxf-serializer.js +595 -0
  13. package/dist/core/hatch-patterns.d.ts +15 -0
  14. package/dist/core/hatch-patterns.js +214 -0
  15. package/dist/core/modelspace.d.ts +106 -0
  16. package/dist/core/modelspace.js +351 -0
  17. package/dist/geometry/math.utils.d.ts +8 -0
  18. package/dist/geometry/math.utils.js +43 -0
  19. package/dist/geometry/offset.utils.d.ts +32 -0
  20. package/dist/geometry/offset.utils.js +87 -0
  21. package/dist/geometry/polyline.utils.d.ts +10 -0
  22. package/dist/geometry/polyline.utils.js +63 -0
  23. package/dist/geometry/text.utils.d.ts +15 -0
  24. package/dist/geometry/text.utils.js +28 -0
  25. package/dist/index.d.ts +23 -0
  26. package/dist/index.js +29 -0
  27. package/dist/parser/auto-cad-color-index.d.ts +8 -0
  28. package/dist/parser/auto-cad-color-index.js +265 -0
  29. package/dist/parser/dim-style-codes.d.ts +5 -0
  30. package/dist/parser/dim-style-codes.js +32 -0
  31. package/dist/parser/dxf-parser.d.ts +16 -0
  32. package/dist/parser/dxf-parser.js +824 -0
  33. package/dist/parser/entities/3dface.d.ts +5 -0
  34. package/dist/parser/entities/3dface.js +76 -0
  35. package/dist/parser/entities/arc.d.ts +5 -0
  36. package/dist/parser/entities/arc.js +34 -0
  37. package/dist/parser/entities/attdef.d.ts +5 -0
  38. package/dist/parser/entities/attdef.js +86 -0
  39. package/dist/parser/entities/attribute.d.ts +5 -0
  40. package/dist/parser/entities/attribute.js +106 -0
  41. package/dist/parser/entities/circle.d.ts +5 -0
  42. package/dist/parser/entities/circle.js +40 -0
  43. package/dist/parser/entities/dimension.d.ts +5 -0
  44. package/dist/parser/entities/dimension.js +65 -0
  45. package/dist/parser/entities/ellipse.d.ts +5 -0
  46. package/dist/parser/entities/ellipse.js +42 -0
  47. package/dist/parser/entities/hatch.d.ts +5 -0
  48. package/dist/parser/entities/hatch.js +321 -0
  49. package/dist/parser/entities/insert.d.ts +5 -0
  50. package/dist/parser/entities/insert.js +52 -0
  51. package/dist/parser/entities/line.d.ts +5 -0
  52. package/dist/parser/entities/line.js +30 -0
  53. package/dist/parser/entities/lwpolyline.d.ts +5 -0
  54. package/dist/parser/entities/lwpolyline.js +101 -0
  55. package/dist/parser/entities/mtext.d.ts +5 -0
  56. package/dist/parser/entities/mtext.js +54 -0
  57. package/dist/parser/entities/point.d.ts +5 -0
  58. package/dist/parser/entities/point.js +30 -0
  59. package/dist/parser/entities/polyline.d.ts +5 -0
  60. package/dist/parser/entities/polyline.js +85 -0
  61. package/dist/parser/entities/solid.d.ts +5 -0
  62. package/dist/parser/entities/solid.js +35 -0
  63. package/dist/parser/entities/spline.d.ts +5 -0
  64. package/dist/parser/entities/spline.js +69 -0
  65. package/dist/parser/entities/text.d.ts +5 -0
  66. package/dist/parser/entities/text.js +47 -0
  67. package/dist/parser/entities/vertex.d.ts +5 -0
  68. package/dist/parser/entities/vertex.js +59 -0
  69. package/dist/parser/extended-data-parser.d.ts +18 -0
  70. package/dist/parser/extended-data-parser.js +100 -0
  71. package/dist/parser/index.d.ts +10 -0
  72. package/dist/parser/index.js +9 -0
  73. package/dist/parser/log.d.ts +14 -0
  74. package/dist/parser/log.js +39 -0
  75. package/dist/parser/parse-helpers.d.ts +23 -0
  76. package/dist/parser/parse-helpers.js +128 -0
  77. package/dist/parser/scanner.d.ts +29 -0
  78. package/dist/parser/scanner.js +143 -0
  79. package/dist/parser/types.d.ts +78 -0
  80. package/dist/parser/types.js +5 -0
  81. package/dist/symbols/slope-symbol.d.ts +21 -0
  82. package/dist/symbols/slope-symbol.js +81 -0
  83. package/dist/symbols/structures.d.ts +9 -0
  84. package/dist/symbols/structures.js +120 -0
  85. package/dist/template/blank-document.d.ts +13 -0
  86. package/dist/template/blank-document.js +13 -0
  87. package/dist/template/block-registry.d.ts +16 -0
  88. package/dist/template/block-registry.js +135 -0
  89. package/dist/template/index.d.ts +17 -0
  90. package/dist/template/index.js +17 -0
  91. package/dist/template/template-injector.d.ts +45 -0
  92. package/dist/template/template-injector.js +487 -0
  93. package/dist/template/template-reader.d.ts +28 -0
  94. package/dist/template/template-reader.js +80 -0
  95. package/dist/types/index.d.ts +24 -0
  96. package/dist/types/index.js +8 -0
  97. package/package.json +59 -0
@@ -0,0 +1,29 @@
1
+ /**
2
+ * DxfArrayScanner
3
+ *
4
+ * Based off the AutoCad 2012 DXF Reference
5
+ * http://images.autodesk.com/adsk/files/autocad_2012_pdf_dxf-reference_enu.pdf
6
+ *
7
+ * Reads through an array representing lines of a dxf file. Takes an array and
8
+ * provides an easy interface to extract group code and value pairs.
9
+ */
10
+ import { DxfGroup, IScanner } from './types.js';
11
+ export default class DxfArrayScanner implements IScanner {
12
+ private _pointer;
13
+ private _data;
14
+ private _eof;
15
+ lastReadGroup?: DxfGroup;
16
+ /** @param data - an array where each element represents a line in the dxf file */
17
+ constructor(data: string[]);
18
+ /**
19
+ * Gets the next group (code, value) from the array. A group is two consecutive elements
20
+ * in the array. The first is the code, the second is the value.
21
+ */
22
+ next(): DxfGroup;
23
+ peek(): DxfGroup;
24
+ rewind(numberOfGroups?: number): void;
25
+ /** Returns true if there is another code/value pair (2 elements in the array). */
26
+ hasNext(): boolean;
27
+ /** Returns true if the scanner is at the end of the array. */
28
+ isEOF(): boolean;
29
+ }
@@ -0,0 +1,143 @@
1
+ /**
2
+ * DxfArrayScanner
3
+ *
4
+ * Based off the AutoCad 2012 DXF Reference
5
+ * http://images.autodesk.com/adsk/files/autocad_2012_pdf_dxf-reference_enu.pdf
6
+ *
7
+ * Reads through an array representing lines of a dxf file. Takes an array and
8
+ * provides an easy interface to extract group code and value pairs.
9
+ */
10
+ import log from './log.js';
11
+ export default class DxfArrayScanner {
12
+ _pointer = 0;
13
+ _data;
14
+ _eof = false;
15
+ lastReadGroup;
16
+ /** @param data - an array where each element represents a line in the dxf file */
17
+ constructor(data) {
18
+ this._data = data;
19
+ }
20
+ /**
21
+ * Gets the next group (code, value) from the array. A group is two consecutive elements
22
+ * in the array. The first is the code, the second is the value.
23
+ */
24
+ next() {
25
+ if (!this.hasNext()) {
26
+ if (!this._eof)
27
+ throw new Error('Unexpected end of input: EOF group not read before end of file. Ended on code ' + this._data[this._pointer]);
28
+ else
29
+ throw new Error("Cannot call 'next' after EOF group has been read");
30
+ }
31
+ const code = parseInt(this._data[this._pointer], 10);
32
+ if (isNaN(code)) {
33
+ throw new Error('Cannot parse group code: ' + this._data[this._pointer]);
34
+ }
35
+ this._pointer++;
36
+ const group = {
37
+ code,
38
+ value: parseGroupValue(code, this._data[this._pointer]),
39
+ };
40
+ this._pointer++;
41
+ if (group.code === 0 && group.value === 'EOF')
42
+ this._eof = true;
43
+ this.lastReadGroup = group;
44
+ return group;
45
+ }
46
+ peek() {
47
+ if (!this.hasNext()) {
48
+ if (!this._eof)
49
+ throw new Error('Unexpected end of input: EOF group not read before end of file. Ended on code ' + this._data[this._pointer]);
50
+ else
51
+ throw new Error("Cannot call 'next' after EOF group has been read");
52
+ }
53
+ const code = parseInt(this._data[this._pointer], 10);
54
+ if (isNaN(code)) {
55
+ throw new Error('Cannot parse group code: ' + this._data[this._pointer]);
56
+ }
57
+ return {
58
+ code,
59
+ value: parseGroupValue(code, this._data[this._pointer + 1]),
60
+ };
61
+ }
62
+ rewind(numberOfGroups = 1) {
63
+ this._pointer = this._pointer - numberOfGroups * 2;
64
+ }
65
+ /** Returns true if there is another code/value pair (2 elements in the array). */
66
+ hasNext() {
67
+ // Check if we have read EOF group code
68
+ if (this._eof) {
69
+ return false;
70
+ }
71
+ // We need to be sure there are two lines available
72
+ if (this._pointer > this._data.length - 2) {
73
+ return false;
74
+ }
75
+ return true;
76
+ }
77
+ /** Returns true if the scanner is at the end of the array. */
78
+ isEOF() {
79
+ return this._eof;
80
+ }
81
+ }
82
+ /**
83
+ * Parse a value to its proper type.
84
+ * See pages 3 - 10 of the AutoCad DXF 2012 reference given at the top of this file
85
+ */
86
+ function parseGroupValue(code, value) {
87
+ if (code <= 9)
88
+ return value;
89
+ if (code >= 10 && code <= 59)
90
+ return parseFloat(value.trim());
91
+ if (code >= 60 && code <= 99)
92
+ return parseInt(value.trim(), 10);
93
+ if (code >= 100 && code <= 109)
94
+ return value;
95
+ if (code >= 110 && code <= 149)
96
+ return parseFloat(value.trim());
97
+ if (code >= 160 && code <= 179)
98
+ return parseInt(value.trim(), 10);
99
+ if (code >= 210 && code <= 239)
100
+ return parseFloat(value.trim());
101
+ if (code >= 270 && code <= 289)
102
+ return parseInt(value.trim(), 10);
103
+ if (code >= 290 && code <= 299)
104
+ return parseBoolean(value.trim());
105
+ if (code >= 300 && code <= 369)
106
+ return value;
107
+ if (code >= 370 && code <= 389)
108
+ return parseInt(value.trim(), 10);
109
+ if (code >= 390 && code <= 399)
110
+ return value;
111
+ if (code >= 400 && code <= 409)
112
+ return parseInt(value.trim(), 10);
113
+ if (code >= 410 && code <= 419)
114
+ return value;
115
+ if (code >= 420 && code <= 429)
116
+ return parseInt(value.trim(), 10);
117
+ if (code >= 430 && code <= 439)
118
+ return value;
119
+ if (code >= 440 && code <= 459)
120
+ return parseInt(value.trim(), 10);
121
+ if (code >= 460 && code <= 469)
122
+ return parseFloat(value.trim());
123
+ if (code >= 470 && code <= 481)
124
+ return value;
125
+ if (code === 999)
126
+ return value;
127
+ if (code >= 1000 && code <= 1009)
128
+ return value;
129
+ if (code >= 1010 && code <= 1059)
130
+ return parseFloat(value.trim());
131
+ if (code >= 1060 && code <= 1071)
132
+ return parseInt(value.trim(), 10);
133
+ log.warn('WARNING: Group code does not have a defined type: %j', { code, value });
134
+ return value;
135
+ }
136
+ /** Parse a boolean according to a 1 or 0 value. */
137
+ function parseBoolean(str) {
138
+ if (str === '0')
139
+ return false;
140
+ if (str === '1')
141
+ return true;
142
+ throw TypeError("String '" + str + "' cannot be cast to Boolean type");
143
+ }
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Shared types for the internal DXF parser (TypeScript port of the
3
+ * `dxf-parser` package, see parser-raw/ for the original JS source).
4
+ */
5
+ /** Value of a DXF group, typed according to its group code range. */
6
+ export type GroupValue = string | number | boolean;
7
+ /** A single DXF group: a (code, value) pair read from the file. */
8
+ export interface DxfGroup {
9
+ code: number;
10
+ value: GroupValue;
11
+ }
12
+ /** A 2D or 3D point. `z` is present only when the file specifies it. */
13
+ export interface DxfPoint {
14
+ x: number;
15
+ y: number;
16
+ z?: number;
17
+ }
18
+ /**
19
+ * A parsed entity. Common properties are typed; entity-specific properties
20
+ * (center, radius, vertices, …) are kept loose to match the original
21
+ * dxf-parser output shape exactly.
22
+ */
23
+ export interface DxfEntity {
24
+ type: string;
25
+ handle?: string | number;
26
+ lineType?: string;
27
+ layer?: string;
28
+ lineTypeScale?: number;
29
+ hidden?: boolean;
30
+ colorIndex?: number;
31
+ color?: number;
32
+ inPaperSpace?: boolean;
33
+ ownerHandle?: string;
34
+ materialObjectHandle?: string;
35
+ lineweight?: number;
36
+ extrusionDirection?: DxfPoint;
37
+ xdata?: Record<string, unknown>;
38
+ [key: string]: any;
39
+ }
40
+ /** A block definition from the BLOCKS section. */
41
+ export interface DxfBlock {
42
+ name?: string;
43
+ name2?: string;
44
+ handle?: string | number;
45
+ layer?: string;
46
+ xrefPath?: string;
47
+ position?: DxfPoint;
48
+ inPaperSpace?: boolean;
49
+ type?: number;
50
+ ownerHandle?: string;
51
+ entities?: DxfEntity[];
52
+ [key: string]: any;
53
+ }
54
+ /** The full parse result. Sections absent from the file are undefined. */
55
+ export interface ParsedDxf {
56
+ header?: Record<string, any>;
57
+ blocks?: Record<string, DxfBlock>;
58
+ entities?: DxfEntity[];
59
+ tables?: Record<string, any>;
60
+ }
61
+ /** Scanner interface consumed by entity parsers. */
62
+ export interface IScanner {
63
+ next(): DxfGroup;
64
+ peek(): DxfGroup;
65
+ rewind(numberOfGroups?: number): void;
66
+ hasNext(): boolean;
67
+ isEOF(): boolean;
68
+ lastReadGroup?: DxfGroup;
69
+ }
70
+ /** One entity parser (LINE, ARC, …). Registered on the main DxfParser. */
71
+ export interface IEntityParser {
72
+ parseEntity(scanner: IScanner, curr: DxfGroup): DxfEntity;
73
+ }
74
+ /** Constructor shape for entity parsers: a class with a static entity name. */
75
+ export interface IEntityParserType {
76
+ new (): IEntityParser;
77
+ ForEntityName: string;
78
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Shared types for the internal DXF parser (TypeScript port of the
3
+ * `dxf-parser` package, see parser-raw/ for the original JS source).
4
+ */
5
+ export {};
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Slope (terrace/ridge) symbol generator.
3
+ *
4
+ * Ported from the LDD `draw_slopesymbol.py`. Walks a polyline and, at every
5
+ * `interval` of accumulated length, emits the small tick/feather symbol used to
6
+ * annotate terraced-rice ridge lines and slope directions.
7
+ *
8
+ * Pure geometry: returns an array of line segments so it can be rendered onto
9
+ * any layer/color by the caller (it draws nothing itself).
10
+ */
11
+ import { Coordinate } from '../types/index.js';
12
+ export type SlopeSide = 'L' | 'R';
13
+ /**
14
+ * @param line Polyline to annotate ([x, y] points).
15
+ * @param interval Spacing between marks along the line.
16
+ * @param side Which side of the line the symbol points to.
17
+ * @param halfLen Half-length of the cross stroke (`x_one` in the original).
18
+ * @param size Overall feather size (`x_two` in the original).
19
+ * @returns Array of [start, end] line segments.
20
+ */
21
+ export declare function slopeSymbolSegments(line: Coordinate[], interval: number, side: SlopeSide, halfLen: number, size: number): [Coordinate, Coordinate][];
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Slope (terrace/ridge) symbol generator.
3
+ *
4
+ * Ported from the LDD `draw_slopesymbol.py`. Walks a polyline and, at every
5
+ * `interval` of accumulated length, emits the small tick/feather symbol used to
6
+ * annotate terraced-rice ridge lines and slope directions.
7
+ *
8
+ * Pure geometry: returns an array of line segments so it can be rendered onto
9
+ * any layer/color by the caller (it draws nothing itself).
10
+ */
11
+ /**
12
+ * @param line Polyline to annotate ([x, y] points).
13
+ * @param interval Spacing between marks along the line.
14
+ * @param side Which side of the line the symbol points to.
15
+ * @param halfLen Half-length of the cross stroke (`x_one` in the original).
16
+ * @param size Overall feather size (`x_two` in the original).
17
+ * @returns Array of [start, end] line segments.
18
+ */
19
+ export function slopeSymbolSegments(line, interval, side, halfLen, size) {
20
+ const segments = [];
21
+ if (line.length < 2 || interval <= 0)
22
+ return segments;
23
+ let totalDist = 0;
24
+ let nextMark = interval;
25
+ for (let i = 0; i < line.length - 1; i++) {
26
+ const [x1, y1] = line[i];
27
+ const [x2, y2] = line[i + 1];
28
+ const dx = x2 - x1;
29
+ const dy = y2 - y1;
30
+ const segLength = Math.hypot(dx, dy);
31
+ if (segLength === 0)
32
+ continue;
33
+ // Unit vector along the segment, and its perpendicular.
34
+ const ux = dx / segLength;
35
+ const uy = dy / segLength;
36
+ const px = -uy;
37
+ const py = ux;
38
+ while (nextMark <= totalDist + segLength) {
39
+ const localDist = nextMark - totalDist;
40
+ const cx = x1 + ux * localDist;
41
+ const cy = y1 + uy * localDist;
42
+ // Cross-stroke endpoints (flip side for 'R').
43
+ let sx1, sy1, sx2, sy2;
44
+ if (side === 'R') {
45
+ sx1 = cx + px * halfLen;
46
+ sy1 = cy + py * halfLen;
47
+ sx2 = cx - px * halfLen;
48
+ sy2 = cy - py * halfLen;
49
+ }
50
+ else {
51
+ sx1 = cx - px * halfLen;
52
+ sy1 = cy - py * halfLen;
53
+ sx2 = cx + px * halfLen;
54
+ sy2 = cy + py * halfLen;
55
+ }
56
+ const tailLength = size / 8;
57
+ const tx = sx1 + ux * tailLength;
58
+ const ty = sy1 + uy * tailLength;
59
+ const tx2 = sx1 - ux * tailLength;
60
+ const ty2 = sy1 - uy * tailLength;
61
+ // Direction along the cross-stroke.
62
+ const cdx = sx2 - sx1;
63
+ const cdy = sy2 - sy1;
64
+ const clen = Math.hypot(cdx, cdy) || 1;
65
+ const cux = cdx / clen;
66
+ const cuy = cdy / clen;
67
+ const startLength = size / 4;
68
+ const ex1 = sx1 - cux * startLength;
69
+ const ey1 = sy1 - cuy * startLength;
70
+ segments.push([[tx, ty], [ex1, ey1]]);
71
+ segments.push([[tx2, ty2], [ex1, ey1]]);
72
+ const extraStartLength = size / 2;
73
+ const ex12 = ex1 + (-cux) * extraStartLength;
74
+ const ey12 = ey1 + (-cuy) * extraStartLength;
75
+ segments.push([[ex1, ey1], [ex12, ey12]]);
76
+ nextMark += interval;
77
+ }
78
+ totalDist += segLength;
79
+ }
80
+ return segments;
81
+ }
@@ -0,0 +1,9 @@
1
+ import { Coordinate3D, Coordinate, OnfarmLine } from '../types/index.js';
2
+ export declare function objCheck(xyCord: Coordinate[], kmUS: number): Record<string, OnfarmLine>;
3
+ export declare function objCheckDrop(xyCord: Coordinate[], kmUS: number): Record<string, OnfarmLine>;
4
+ export declare function objChangeSlopeStructure(xyCord: Coordinate[], kmUS: number): Record<string, OnfarmLine>;
5
+ export declare function objFlume(xyCord: Coordinate[], kmUS: number, kmDS: number, cl: Coordinate3D[]): Record<string, OnfarmLine>;
6
+ export declare function objSiphon(xyCord: Coordinate[], kmUS: number, kmDS: number, cl: Coordinate3D[]): Record<string, OnfarmLine>;
7
+ export declare function objCulvert(xyCord: Coordinate[], kmUS: number, kmDS: number, roadLength: number): Record<string, OnfarmLine>;
8
+ export declare function objCheckCulvert(xyCord: Coordinate[], kmUS: number, kmDS: number, roadLength: number): Record<string, OnfarmLine>;
9
+ export declare function objCheckDropCulvert(xyCord: Coordinate[], kmUS: number, kmDS: number, roadLength: number): Record<string, OnfarmLine>;
@@ -0,0 +1,120 @@
1
+ import { rotatePointAzimuth } from '../geometry/math.utils.js';
2
+ import { kmPointPolyline } from '../geometry/polyline.utils.js';
3
+ import { getLineOffset } from '../geometry/offset.utils.js';
4
+ // Helper shapes
5
+ function checkShape(azimuthDeg, shiftX, shiftY) {
6
+ const pts = [
7
+ [-0.5, 1.25],
8
+ [0, 1.25],
9
+ [0, -1.25],
10
+ [-0.5, -1.25]
11
+ ];
12
+ return pts.map(([x, y]) => rotatePointAzimuth(x, y, azimuthDeg, shiftX, shiftY));
13
+ }
14
+ function checkDropShape(azimuthDeg, shiftX, shiftY) {
15
+ const pts = [
16
+ [-0.5, 1.25],
17
+ [0, 1.25],
18
+ [0, -1.25],
19
+ [-0.5, -1.25],
20
+ [0.25, -1.25]
21
+ ];
22
+ return pts.map(([x, y]) => rotatePointAzimuth(x, y, azimuthDeg, shiftX, shiftY));
23
+ }
24
+ function boxShape(azimuthDeg, shiftX, shiftY) {
25
+ const pts = [
26
+ [-1, 1],
27
+ [-0.5, 0.5],
28
+ [0.5, 0.5],
29
+ [0.5, -0.5],
30
+ [-0.5, -0.5],
31
+ [-1, -1],
32
+ [-0.5, -0.5],
33
+ [-0.5, 0.5]
34
+ ];
35
+ return pts.map(([x, y]) => rotatePointAzimuth(x, y, azimuthDeg, shiftX, shiftY));
36
+ }
37
+ function box2Shape(azimuthDeg, shiftX, shiftY) {
38
+ const pts = [
39
+ [-0.5, -0.5],
40
+ [0.5, -0.5],
41
+ [0.5, 0.5],
42
+ [-0.5, 0.5],
43
+ [-0.5, -0.5]
44
+ ];
45
+ return pts.map(([x, y]) => rotatePointAzimuth(x, y, azimuthDeg, shiftX, shiftY));
46
+ }
47
+ function roadOverCulvertShape(azimuthDeg, length, shiftX, shiftY) {
48
+ const pts = [
49
+ [0.5, -length],
50
+ [0.5, length]
51
+ ];
52
+ return pts.map(([x, y]) => rotatePointAzimuth(x, y, azimuthDeg, shiftX, shiftY));
53
+ }
54
+ // Structure Generators
55
+ export function objCheck(xyCord, kmUS) {
56
+ const { point, az } = kmPointPolyline(xyCord, kmUS);
57
+ return {
58
+ check: { coordinate: checkShape(az, point[0], point[1]), type: 'CONTINUOUS', width: 1, color: 4 }
59
+ };
60
+ }
61
+ export function objCheckDrop(xyCord, kmUS) {
62
+ const { point, az } = kmPointPolyline(xyCord, kmUS);
63
+ return {
64
+ check: { coordinate: checkDropShape(az, point[0], point[1]), type: 'CONTINUOUS', width: 1, color: 4 }
65
+ };
66
+ }
67
+ export function objChangeSlopeStructure(xyCord, kmUS) {
68
+ const { point, az } = kmPointPolyline(xyCord, kmUS);
69
+ return {
70
+ US: { coordinate: box2Shape(az, point[0], point[1]), type: 'CONTINUOUS', width: 1, color: 4 },
71
+ check: { coordinate: checkDropShape(az, point[0], point[1]), type: 'CONTINUOUS', width: 1, color: 4 }
72
+ };
73
+ }
74
+ export function objFlume(xyCord, kmUS, kmDS, cl) {
75
+ const p1 = kmPointPolyline(xyCord, kmUS);
76
+ const US = { coordinate: boxShape(p1.az, p1.point[0], p1.point[1]), type: 'CONTINUOUS', width: 1, color: 4 };
77
+ const offset = getLineOffset(cl, 0.5);
78
+ const lb = { coordinate: offset.left, type: 'DASHED', width: 1, color: 2 };
79
+ const rb = { coordinate: offset.right, type: 'DASHED', width: 1, color: 2 };
80
+ const p2 = kmPointPolyline(xyCord, kmDS);
81
+ const DS = { coordinate: boxShape(p2.az + 180, p2.point[0], p2.point[1]), type: 'CONTINUOUS', width: 1, color: 4 };
82
+ return { US, DS, lb, rb };
83
+ }
84
+ export function objSiphon(xyCord, kmUS, kmDS, cl) {
85
+ const p1 = kmPointPolyline(xyCord, kmUS);
86
+ const US = { coordinate: boxShape(p1.az, p1.point[0], p1.point[1]), type: 'CONTINUOUS', width: 1, color: 4 };
87
+ const clLine = { coordinate: cl, type: 'DASHED', width: 1, color: 2 };
88
+ const p2 = kmPointPolyline(xyCord, kmDS);
89
+ const DS = { coordinate: boxShape(p2.az + 180, p2.point[0], p2.point[1]), type: 'CONTINUOUS', width: 1, color: 4 };
90
+ return { US, DS, cl: clLine };
91
+ }
92
+ export function objCulvert(xyCord, kmUS, kmDS, roadLength) {
93
+ const p1 = kmPointPolyline(xyCord, kmUS);
94
+ const US = { coordinate: boxShape(p1.az, p1.point[0], p1.point[1]), type: 'CONTINUOUS', width: 1, color: 4 };
95
+ const roadUS = { coordinate: roadOverCulvertShape(p1.az, roadLength, p1.point[0], p1.point[1]), type: 'DASHED', width: 1, color: 4 };
96
+ const p2 = kmPointPolyline(xyCord, kmDS);
97
+ const DS = { coordinate: boxShape(p2.az + 180, p2.point[0], p2.point[1]), type: 'CONTINUOUS', width: 1, color: 4 };
98
+ const roadDS = { coordinate: roadOverCulvertShape(p2.az + 180, roadLength, p2.point[0], p2.point[1]), type: 'DASHED', width: 1, color: 4 };
99
+ return { US, DS, roadUS, roadDS };
100
+ }
101
+ export function objCheckCulvert(xyCord, kmUS, kmDS, roadLength) {
102
+ const p1 = kmPointPolyline(xyCord, kmUS);
103
+ const US = { coordinate: boxShape(p1.az, p1.point[0], p1.point[1]), type: 'CONTINUOUS', width: 1, color: 4 };
104
+ const check = { coordinate: checkShape(p1.az, p1.point[0], p1.point[1]), type: 'CONTINUOUS', width: 1, color: 4 };
105
+ const roadUS = { coordinate: roadOverCulvertShape(p1.az, roadLength, p1.point[0], p1.point[1]), type: 'DASHED', width: 1, color: 4 };
106
+ const p2 = kmPointPolyline(xyCord, kmDS);
107
+ const DS = { coordinate: boxShape(p2.az + 180, p2.point[0], p2.point[1]), type: 'CONTINUOUS', width: 1, color: 4 };
108
+ const roadDS = { coordinate: roadOverCulvertShape(p2.az + 180, roadLength, p2.point[0], p2.point[1]), type: 'DASHED', width: 1, color: 4 };
109
+ return { US, DS, roadUS, roadDS, check };
110
+ }
111
+ export function objCheckDropCulvert(xyCord, kmUS, kmDS, roadLength) {
112
+ const p1 = kmPointPolyline(xyCord, kmUS);
113
+ const US = { coordinate: boxShape(p1.az, p1.point[0], p1.point[1]), type: 'CONTINUOUS', width: 1, color: 4 };
114
+ const checkDrop = { coordinate: checkDropShape(p1.az, p1.point[0], p1.point[1]), type: 'CONTINUOUS', width: 1, color: 4 };
115
+ const roadUS = { coordinate: roadOverCulvertShape(p1.az, roadLength, p1.point[0], p1.point[1]), type: 'DASHED', width: 1, color: 4 };
116
+ const p2 = kmPointPolyline(xyCord, kmDS);
117
+ const DS = { coordinate: boxShape(p2.az + 180, p2.point[0], p2.point[1]), type: 'CONTINUOUS', width: 1, color: 4 };
118
+ const roadDS = { coordinate: roadOverCulvertShape(p2.az + 180, roadLength, p2.point[0], p2.point[1]), type: 'DASHED', width: 1, color: 4 };
119
+ return { US, DS, roadUS, roadDS, check: checkDrop };
120
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Blank DXF R2018 (AC1032) document used as the base for documents created
3
+ * from scratch (`DxfDocument.create()`).
4
+ *
5
+ * It carries the structure AutoCAD expects from a DXF R2000+ file — CLASSES,
6
+ * the BLOCK_RECORD table, *Model_Space / *Paper_Space blocks, and the OBJECTS
7
+ * section with the root dictionary and layouts — so that blocks, images and
8
+ * layouts written by the injector are valid in both modes.
9
+ *
10
+ * GENERATED by tools/gen_blank_document.py (ezdxf.new("R2018", setup=False, units=6))
11
+ * — do not edit by hand. Drawing units: meters.
12
+ */
13
+ export declare const BLANK_DXF_R2018: string;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Blank DXF R2018 (AC1032) document used as the base for documents created
3
+ * from scratch (`DxfDocument.create()`).
4
+ *
5
+ * It carries the structure AutoCAD expects from a DXF R2000+ file — CLASSES,
6
+ * the BLOCK_RECORD table, *Model_Space / *Paper_Space blocks, and the OBJECTS
7
+ * section with the root dictionary and layouts — so that blocks, images and
8
+ * layouts written by the injector are valid in both modes.
9
+ *
10
+ * GENERATED by tools/gen_blank_document.py (ezdxf.new("R2018", setup=False, units=6))
11
+ * — do not edit by hand. Drawing units: meters.
12
+ */
13
+ export const BLANK_DXF_R2018 = "0\nSECTION\n2\nHEADER\n9\n$ACADVER\n1\nAC1032\n9\n$ACADMAINTVER\n90\n4\n9\n$DWGCODEPAGE\n3\nANSI_1252\n9\n$LASTSAVEDBY\n1\nezdxf\n9\n$REQUIREDVERSIONS\n160\n0\n9\n$INSBASE\n10\n0.0\n20\n0.0\n30\n0.0\n9\n$EXTMIN\n10\n1e+20\n20\n1e+20\n30\n1e+20\n9\n$EXTMAX\n10\n-1e+20\n20\n-1e+20\n30\n-1e+20\n9\n$LIMMIN\n10\n0.0\n20\n0.0\n9\n$LIMMAX\n10\n420.0\n20\n297.0\n9\n$ORTHOMODE\n70\n0\n9\n$REGENMODE\n70\n1\n9\n$FILLMODE\n70\n1\n9\n$QTEXTMODE\n70\n0\n9\n$MIRRTEXT\n70\n1\n9\n$LTSCALE\n40\n1.0\n9\n$ATTMODE\n70\n1\n9\n$TEXTSIZE\n40\n2.5\n9\n$TRACEWID\n40\n1.0\n9\n$TEXTSTYLE\n7\nStandard\n9\n$CLAYER\n8\n0\n9\n$CELTYPE\n6\nByLayer\n9\n$CECOLOR\n62\n256\n9\n$CELTSCALE\n40\n1.0\n9\n$DISPSILH\n70\n0\n9\n$DIMSCALE\n40\n1.0\n9\n$DIMASZ\n40\n2.5\n9\n$DIMEXO\n40\n0.625\n9\n$DIMDLI\n40\n3.75\n9\n$DIMRND\n40\n0.0\n9\n$DIMDLE\n40\n0.0\n9\n$DIMEXE\n40\n1.25\n9\n$DIMTP\n40\n0.0\n9\n$DIMTM\n40\n0.0\n9\n$DIMTXT\n40\n2.5\n9\n$DIMCEN\n40\n2.5\n9\n$DIMTSZ\n40\n0.0\n9\n$DIMTOL\n70\n0\n9\n$DIMLIM\n70\n0\n9\n$DIMTIH\n70\n0\n9\n$DIMTOH\n70\n0\n9\n$DIMSE1\n70\n0\n9\n$DIMSE2\n70\n0\n9\n$DIMTAD\n70\n1\n9\n$DIMZIN\n70\n8\n9\n$DIMBLK\n1\n\n9\n$DIMASO\n70\n1\n9\n$DIMSHO\n70\n1\n9\n$DIMPOST\n1\n\n9\n$DIMAPOST\n1\n\n9\n$DIMALT\n70\n0\n9\n$DIMALTD\n70\n3\n9\n$DIMALTF\n40\n0.03937007874\n9\n$DIMLFAC\n40\n1.0\n9\n$DIMTOFL\n70\n1\n9\n$DIMTVP\n40\n0.0\n9\n$DIMTIX\n70\n0\n9\n$DIMSOXD\n70\n0\n9\n$DIMSAH\n70\n0\n9\n$DIMBLK1\n1\n\n9\n$DIMBLK2\n1\n\n9\n$DIMSTYLE\n2\nISO-25\n9\n$DIMCLRD\n70\n0\n9\n$DIMCLRE\n70\n0\n9\n$DIMCLRT\n70\n0\n9\n$DIMTFAC\n40\n1.0\n9\n$DIMGAP\n40\n0.625\n9\n$DIMJUST\n70\n0\n9\n$DIMSD1\n70\n0\n9\n$DIMSD2\n70\n0\n9\n$DIMTOLJ\n70\n0\n9\n$DIMTZIN\n70\n8\n9\n$DIMALTZ\n70\n0\n9\n$DIMALTTZ\n70\n0\n9\n$DIMUPT\n70\n0\n9\n$DIMDEC\n70\n2\n9\n$DIMTDEC\n70\n2\n9\n$DIMALTU\n70\n2\n9\n$DIMALTTD\n70\n3\n9\n$DIMTXSTY\n7\nStandard\n9\n$DIMAUNIT\n70\n0\n9\n$DIMADEC\n70\n0\n9\n$DIMALTRND\n40\n0.0\n9\n$DIMAZIN\n70\n0\n9\n$DIMDSEP\n70\n44\n9\n$DIMATFIT\n70\n3\n9\n$DIMFRAC\n70\n0\n9\n$DIMLDRBLK\n1\n\n9\n$DIMLUNIT\n70\n2\n9\n$DIMLWD\n70\n-2\n9\n$DIMLWE\n70\n-2\n9\n$DIMTMOVE\n70\n0\n9\n$DIMFXL\n40\n1.0\n9\n$DIMFXLON\n70\n0\n9\n$DIMJOGANG\n40\n0.785398163397\n9\n$DIMTFILL\n70\n0\n9\n$DIMTFILLCLR\n70\n0\n9\n$DIMARCSYM\n70\n0\n9\n$DIMLTYPE\n6\n\n9\n$DIMLTEX1\n6\n\n9\n$DIMLTEX2\n6\n\n9\n$DIMTXTDIRECTION\n70\n0\n9\n$LUNITS\n70\n2\n9\n$LUPREC\n70\n4\n9\n$SKETCHINC\n40\n1.0\n9\n$FILLETRAD\n40\n10.0\n9\n$AUNITS\n70\n0\n9\n$AUPREC\n70\n2\n9\n$MENU\n1\n.\n9\n$ELEVATION\n40\n0.0\n9\n$PELEVATION\n40\n0.0\n9\n$THICKNESS\n40\n0.0\n9\n$LIMCHECK\n70\n0\n9\n$CHAMFERA\n40\n0.0\n9\n$CHAMFERB\n40\n0.0\n9\n$CHAMFERC\n40\n0.0\n9\n$CHAMFERD\n40\n0.0\n9\n$SKPOLY\n70\n0\n9\n$TDCREATE\n40\n2461299.774039352\n9\n$TDUCREATE\n40\n2458532.153996898\n9\n$TDUPDATE\n40\n2461299.774039352\n9\n$TDUUPDATE\n40\n2458532.1544311\n9\n$TDINDWG\n40\n0.0\n9\n$TDUSRTIMER\n40\n0.0\n9\n$USRTIMER\n70\n1\n9\n$ANGBASE\n50\n0.0\n9\n$ANGDIR\n70\n0\n9\n$PDMODE\n70\n0\n9\n$PDSIZE\n40\n0.0\n9\n$PLINEWID\n40\n0.0\n9\n$SPLFRAME\n70\n0\n9\n$SPLINETYPE\n70\n6\n9\n$SPLINESEGS\n70\n8\n9\n$HANDSEED\n5\n32\n9\n$SURFTAB1\n70\n6\n9\n$SURFTAB2\n70\n6\n9\n$SURFTYPE\n70\n6\n9\n$SURFU\n70\n6\n9\n$SURFV\n70\n6\n9\n$UCSBASE\n2\n\n9\n$UCSNAME\n2\n\n9\n$UCSORG\n10\n0.0\n20\n0.0\n30\n0.0\n9\n$UCSXDIR\n10\n1.0\n20\n0.0\n30\n0.0\n9\n$UCSYDIR\n10\n0.0\n20\n1.0\n30\n0.0\n9\n$UCSORTHOREF\n2\n\n9\n$UCSORTHOVIEW\n70\n0\n9\n$UCSORGTOP\n10\n0.0\n20\n0.0\n30\n0.0\n9\n$UCSORGBOTTOM\n10\n0.0\n20\n0.0\n30\n0.0\n9\n$UCSORGLEFT\n10\n0.0\n20\n0.0\n30\n0.0\n9\n$UCSORGRIGHT\n10\n0.0\n20\n0.0\n30\n0.0\n9\n$UCSORGFRONT\n10\n0.0\n20\n0.0\n30\n0.0\n9\n$UCSORGBACK\n10\n0.0\n20\n0.0\n30\n0.0\n9\n$PUCSBASE\n2\n\n9\n$PUCSNAME\n2\n\n9\n$PUCSORG\n10\n0.0\n20\n0.0\n30\n0.0\n9\n$PUCSXDIR\n10\n1.0\n20\n0.0\n30\n0.0\n9\n$PUCSYDIR\n10\n0.0\n20\n1.0\n30\n0.0\n9\n$PUCSORTHOREF\n2\n\n9\n$PUCSORTHOVIEW\n70\n0\n9\n$PUCSORGTOP\n10\n0.0\n20\n0.0\n30\n0.0\n9\n$PUCSORGBOTTOM\n10\n0.0\n20\n0.0\n30\n0.0\n9\n$PUCSORGLEFT\n10\n0.0\n20\n0.0\n30\n0.0\n9\n$PUCSORGRIGHT\n10\n0.0\n20\n0.0\n30\n0.0\n9\n$PUCSORGFRONT\n10\n0.0\n20\n0.0\n30\n0.0\n9\n$PUCSORGBACK\n10\n0.0\n20\n0.0\n30\n0.0\n9\n$USERI1\n70\n0\n9\n$USERI2\n70\n0\n9\n$USERI3\n70\n0\n9\n$USERI4\n70\n0\n9\n$USERI5\n70\n0\n9\n$USERR1\n40\n0.0\n9\n$USERR2\n40\n0.0\n9\n$USERR3\n40\n0.0\n9\n$USERR4\n40\n0.0\n9\n$USERR5\n40\n0.0\n9\n$WORLDVIEW\n70\n1\n9\n$SHADEDGE\n70\n3\n9\n$SHADEDIF\n70\n70\n9\n$TILEMODE\n70\n1\n9\n$MAXACTVP\n70\n64\n9\n$PINSBASE\n10\n0.0\n20\n0.0\n30\n0.0\n9\n$PLIMCHECK\n70\n0\n9\n$PEXTMIN\n10\n1e+20\n20\n1e+20\n30\n1e+20\n9\n$PEXTMAX\n10\n-1e+20\n20\n-1e+20\n30\n-1e+20\n9\n$PLIMMIN\n10\n0.0\n20\n0.0\n9\n$PLIMMAX\n10\n420.0\n20\n297.0\n9\n$UNITMODE\n70\n0\n9\n$VISRETAIN\n70\n1\n9\n$PLINEGEN\n70\n0\n9\n$PSLTSCALE\n70\n1\n9\n$TREEDEPTH\n70\n3020\n9\n$CMLSTYLE\n2\nStandard\n9\n$CMLJUST\n70\n0\n9\n$CMLSCALE\n40\n20.0\n9\n$PROXYGRAPHICS\n70\n1\n9\n$MEASUREMENT\n70\n1\n9\n$CELWEIGHT\n370\n-1\n9\n$ENDCAPS\n280\n0\n9\n$JOINSTYLE\n280\n0\n9\n$LWDISPLAY\n290\n0\n9\n$INSUNITS\n70\n6\n9\n$HYPERLINKBASE\n1\n\n9\n$STYLESHEET\n1\n\n9\n$XEDIT\n290\n1\n9\n$CEPSNTYPE\n380\n0\n9\n$PSTYLEMODE\n290\n1\n9\n$FINGERPRINTGUID\n2\n{3FAACDB8-5D11-46E9-A9E3-970AAAEB0665}\n9\n$VERSIONGUID\n2\n{AA826CFE-6FD3-4C88-A68A-CDFF72FF55A3}\n9\n$EXTNAMES\n290\n1\n9\n$PSVPSCALE\n40\n0.0\n9\n$OLESTARTUP\n290\n0\n9\n$SORTENTS\n280\n127\n9\n$INDEXCTL\n280\n0\n9\n$HIDETEXT\n280\n1\n9\n$XCLIPFRAME\n280\n1\n9\n$HALOGAP\n280\n0\n9\n$OBSCOLOR\n70\n257\n9\n$OBSLTYPE\n280\n0\n9\n$INTERSECTIONDISPLAY\n280\n0\n9\n$INTERSECTIONCOLOR\n70\n257\n9\n$DIMASSOC\n280\n2\n9\n$PROJECTNAME\n1\n\n9\n$CAMERADISPLAY\n290\n0\n9\n$LENSLENGTH\n40\n50.0\n9\n$CAMERAHEIGHT\n40\n0.0\n9\n$STEPSPERSEC\n40\n24.0\n9\n$STEPSIZE\n40\n100.0\n9\n$3DDWFPREC\n40\n2.0\n9\n$PSOLWIDTH\n40\n0.005\n9\n$PSOLHEIGHT\n40\n0.08\n9\n$LOFTANG1\n40\n1.570796326795\n9\n$LOFTANG2\n40\n1.570796326795\n9\n$LOFTMAG1\n40\n0.0\n9\n$LOFTMAG2\n40\n0.0\n9\n$LOFTPARAM\n70\n7\n9\n$LOFTNORMALS\n280\n1\n9\n$LATITUDE\n40\n37.795\n9\n$LONGITUDE\n40\n-122.394\n9\n$NORTHDIRECTION\n40\n0.0\n9\n$TIMEZONE\n70\n-8000\n9\n$LIGHTGLYPHDISPLAY\n280\n1\n9\n$TILEMODELIGHTSYNCH\n280\n1\n9\n$CMATERIAL\n347\n20\n9\n$SOLIDHIST\n280\n0\n9\n$SHOWHIST\n280\n1\n9\n$DWFFRAME\n280\n2\n9\n$DGNFRAME\n280\n2\n9\n$REALWORLDSCALE\n290\n1\n9\n$INTERFERECOLOR\n62\n256\n9\n$CSHADOW\n280\n0\n9\n$SHADOWPLANELOCATION\n40\n0.0\n0\nENDSEC\n0\nSECTION\n2\nCLASSES\n0\nCLASS\n1\nACDBDICTIONARYWDFLT\n2\nAcDbDictionaryWithDefault\n3\nObjectDBX Classes\n90\n0\n91\n0\n280\n0\n281\n0\n0\nCLASS\n1\nSUN\n2\nAcDbSun\n3\nSCENEOE\n90\n1153\n91\n0\n280\n0\n281\n0\n0\nCLASS\n1\nVISUALSTYLE\n2\nAcDbVisualStyle\n3\nObjectDBX Classes\n90\n4095\n91\n0\n280\n0\n281\n0\n0\nCLASS\n1\nMATERIAL\n2\nAcDbMaterial\n3\nObjectDBX Classes\n90\n1153\n91\n0\n280\n0\n281\n0\n0\nCLASS\n1\nSCALE\n2\nAcDbScale\n3\nObjectDBX Classes\n90\n1153\n91\n0\n280\n0\n281\n0\n0\nCLASS\n1\nTABLESTYLE\n2\nAcDbTableStyle\n3\nObjectDBX Classes\n90\n4095\n91\n0\n280\n0\n281\n0\n0\nCLASS\n1\nMLEADERSTYLE\n2\nAcDbMLeaderStyle\n3\nACDB_MLEADERSTYLE_CLASS\n90\n4095\n91\n0\n280\n0\n281\n0\n0\nCLASS\n1\nDICTIONARYVAR\n2\nAcDbDictionaryVar\n3\nObjectDBX Classes\n90\n0\n91\n0\n280\n0\n281\n0\n0\nCLASS\n1\nCELLSTYLEMAP\n2\nAcDbCellStyleMap\n3\nObjectDBX Classes\n90\n1152\n91\n0\n280\n0\n281\n0\n0\nCLASS\n1\nMENTALRAYRENDERSETTINGS\n2\nAcDbMentalRayRenderSettings\n3\nSCENEOE\n90\n1024\n91\n0\n280\n0\n281\n0\n0\nCLASS\n1\nACDBDETAILVIEWSTYLE\n2\nAcDbDetailViewStyle\n3\nObjectDBX Classes\n90\n1025\n91\n0\n280\n0\n281\n0\n0\nCLASS\n1\nACDBSECTIONVIEWSTYLE\n2\nAcDbSectionViewStyle\n3\nObjectDBX Classes\n90\n1025\n91\n0\n280\n0\n281\n0\n0\nCLASS\n1\nRASTERVARIABLES\n2\nAcDbRasterVariables\n3\nISM\n90\n0\n91\n0\n280\n0\n281\n0\n0\nCLASS\n1\nACDBPLACEHOLDER\n2\nAcDbPlaceHolder\n3\nObjectDBX Classes\n90\n0\n91\n0\n280\n0\n281\n0\n0\nCLASS\n1\nLAYOUT\n2\nAcDbLayout\n3\nObjectDBX Classes\n90\n0\n91\n0\n280\n0\n281\n0\n0\nENDSEC\n0\nSECTION\n2\nTABLES\n0\nTABLE\n2\nVPORT\n5\n8\n330\n0\n100\nAcDbSymbolTable\n70\n1\n0\nVPORT\n5\n23\n330\n8\n100\nAcDbSymbolTableRecord\n100\nAcDbViewportTableRecord\n2\n*Active\n70\n0\n10\n0.0\n20\n0.0\n11\n1.0\n21\n1.0\n12\n0.0\n22\n0.0\n13\n0.0\n23\n0.0\n14\n0.5\n24\n0.5\n15\n0.5\n25\n0.5\n16\n0.0\n26\n0.0\n36\n1.0\n17\n0.0\n27\n0.0\n37\n0.0\n40\n1000.0\n41\n1.34\n42\n50.0\n43\n0.0\n44\n0.0\n50\n0.0\n51\n0.0\n71\n0\n72\n1000\n73\n1\n74\n3\n75\n0\n76\n0\n77\n0\n78\n0\n281\n0\n65\n0\n146\n0.0\n0\nENDTAB\n0\nTABLE\n2\nLTYPE\n5\n2\n330\n0\n100\nAcDbSymbolTable\n70\n3\n0\nLTYPE\n5\n24\n330\n2\n100\nAcDbSymbolTableRecord\n100\nAcDbLinetypeTableRecord\n2\nByBlock\n70\n0\n3\n\n72\n65\n73\n0\n40\n0.0\n0\nLTYPE\n5\n25\n330\n2\n100\nAcDbSymbolTableRecord\n100\nAcDbLinetypeTableRecord\n2\nByLayer\n70\n0\n3\n\n72\n65\n73\n0\n40\n0.0\n0\nLTYPE\n5\n26\n330\n2\n100\nAcDbSymbolTableRecord\n100\nAcDbLinetypeTableRecord\n2\nContinuous\n70\n0\n3\n\n72\n65\n73\n0\n40\n0.0\n0\nENDTAB\n0\nTABLE\n2\nLAYER\n5\n1\n330\n0\n100\nAcDbSymbolTable\n70\n2\n0\nLAYER\n5\n27\n330\n1\n100\nAcDbSymbolTableRecord\n100\nAcDbLayerTableRecord\n2\n0\n70\n0\n62\n7\n6\nContinuous\n370\n-3\n390\n13\n347\n21\n0\nLAYER\n5\n28\n330\n1\n100\nAcDbSymbolTableRecord\n100\nAcDbLayerTableRecord\n2\nDefpoints\n70\n0\n62\n7\n6\nContinuous\n290\n0\n370\n-3\n390\n13\n347\n21\n0\nENDTAB\n0\nTABLE\n2\nSTYLE\n5\n5\n330\n0\n100\nAcDbSymbolTable\n70\n1\n0\nSTYLE\n5\n29\n330\n5\n100\nAcDbSymbolTableRecord\n100\nAcDbTextStyleTableRecord\n2\nStandard\n70\n0\n40\n0.0\n41\n1.0\n50\n0.0\n71\n0\n42\n2.5\n3\ntxt\n4\n\n0\nENDTAB\n0\nTABLE\n2\nVIEW\n5\n7\n330\n0\n100\nAcDbSymbolTable\n70\n0\n0\nENDTAB\n0\nTABLE\n2\nUCS\n5\n6\n330\n0\n100\nAcDbSymbolTable\n70\n0\n0\nENDTAB\n0\nTABLE\n2\nAPPID\n5\n3\n330\n0\n100\nAcDbSymbolTable\n70\n3\n0\nAPPID\n5\n2A\n330\n3\n100\nAcDbSymbolTableRecord\n100\nAcDbRegAppTableRecord\n2\nACAD\n70\n0\n0\nAPPID\n5\n2F\n330\n3\n100\nAcDbSymbolTableRecord\n100\nAcDbRegAppTableRecord\n2\nHATCHBACKGROUNDCOLOR\n70\n0\n0\nAPPID\n5\n30\n330\n3\n100\nAcDbSymbolTableRecord\n100\nAcDbRegAppTableRecord\n2\nEZDXF\n70\n0\n0\nENDTAB\n0\nTABLE\n2\nDIMSTYLE\n5\n4\n330\n0\n100\nAcDbSymbolTable\n70\n1\n100\nAcDbDimStyleTable\n0\nDIMSTYLE\n105\n2B\n330\n4\n100\nAcDbSymbolTableRecord\n100\nAcDbDimStyleTableRecord\n2\nStandard\n70\n0\n40\n1.0\n41\n2.5\n42\n0.625\n43\n3.75\n44\n1.25\n45\n0.0\n46\n0.0\n47\n0.0\n48\n0.0\n49\n2.5\n140\n2.5\n141\n2.5\n142\n0.0\n143\n0.03937007874\n144\n1.0\n145\n0.0\n146\n1.0\n147\n0.625\n148\n0.0\n69\n0\n70\n0\n71\n0\n72\n0\n73\n0\n74\n0\n75\n0\n76\n0\n77\n1\n78\n8\n79\n3\n170\n0\n171\n3\n172\n1\n173\n0\n174\n0\n175\n0\n176\n0\n177\n0\n178\n0\n179\n2\n271\n2\n272\n2\n273\n2\n274\n3\n275\n0\n276\n0\n277\n2\n278\n44\n279\n0\n280\n0\n281\n0\n282\n0\n283\n0\n284\n8\n285\n0\n286\n0\n288\n0\n289\n3\n290\n0\n371\n-2\n372\n-2\n0\nENDTAB\n0\nTABLE\n2\nBLOCK_RECORD\n5\n9\n330\n0\n100\nAcDbSymbolTable\n70\n2\n0\nBLOCK_RECORD\n5\n17\n330\n9\n100\nAcDbSymbolTableRecord\n100\nAcDbBlockTableRecord\n2\n*Model_Space\n340\n1A\n70\n0\n280\n1\n281\n0\n0\nBLOCK_RECORD\n5\n1B\n330\n9\n100\nAcDbSymbolTableRecord\n100\nAcDbBlockTableRecord\n2\n*Paper_Space\n340\n1E\n70\n0\n280\n1\n281\n0\n0\nENDTAB\n0\nENDSEC\n0\nSECTION\n2\nBLOCKS\n0\nBLOCK\n5\n18\n330\n17\n100\nAcDbEntity\n8\n0\n100\nAcDbBlockBegin\n2\n*Model_Space\n70\n0\n10\n0.0\n20\n0.0\n30\n0.0\n3\n*Model_Space\n1\n\n0\nENDBLK\n5\n19\n330\n17\n100\nAcDbEntity\n8\n0\n100\nAcDbBlockEnd\n0\nBLOCK\n5\n1C\n330\n1B\n100\nAcDbEntity\n8\n0\n100\nAcDbBlockBegin\n2\n*Paper_Space\n70\n0\n10\n0.0\n20\n0.0\n30\n0.0\n3\n*Paper_Space\n1\n\n0\nENDBLK\n5\n1D\n330\n1B\n100\nAcDbEntity\n8\n0\n100\nAcDbBlockEnd\n0\nENDSEC\n0\nSECTION\n2\nENTITIES\n0\nENDSEC\n0\nSECTION\n2\nOBJECTS\n0\nDICTIONARY\n5\nA\n330\n0\n100\nAcDbDictionary\n280\n0\n281\n1\n3\nACAD_COLOR\n350\nB\n3\nACAD_GROUP\n350\nC\n3\nACAD_LAYOUT\n350\nD\n3\nACAD_MATERIAL\n350\nE\n3\nACAD_MLEADERSTYLE\n350\nF\n3\nACAD_MLINESTYLE\n350\n10\n3\nACAD_PLOTSETTINGS\n350\n11\n3\nACAD_PLOTSTYLENAME\n350\n12\n3\nACAD_SCALELIST\n350\n14\n3\nACAD_TABLESTYLE\n350\n15\n3\nACAD_VISUALSTYLE\n350\n16\n3\nEZDXF_META\n350\n2D\n0\nDICTIONARY\n5\nB\n330\nA\n100\nAcDbDictionary\n280\n0\n281\n1\n0\nDICTIONARY\n5\nC\n330\nA\n100\nAcDbDictionary\n280\n0\n281\n1\n0\nDICTIONARY\n5\nD\n330\nA\n100\nAcDbDictionary\n280\n0\n281\n1\n3\nModel\n350\n1A\n3\nLayout1\n350\n1E\n0\nDICTIONARY\n5\nE\n330\nA\n100\nAcDbDictionary\n280\n0\n281\n1\n3\nByBlock\n350\n1F\n3\nByLayer\n350\n20\n3\nGlobal\n350\n21\n0\nDICTIONARY\n5\nF\n330\nA\n100\nAcDbDictionary\n280\n0\n281\n1\n3\nStandard\n350\n2C\n0\nDICTIONARY\n5\n10\n330\nA\n100\nAcDbDictionary\n280\n0\n281\n1\n3\nStandard\n350\n22\n0\nDICTIONARY\n5\n11\n330\nA\n100\nAcDbDictionary\n280\n0\n281\n1\n0\nACDBDICTIONARYWDFLT\n5\n12\n330\nA\n100\nAcDbDictionary\n280\n0\n281\n1\n3\nNormal\n350\n13\n100\nAcDbDictionaryWithDefault\n340\n13\n0\nACDBPLACEHOLDER\n5\n13\n330\n12\n0\nDICTIONARY\n5\n14\n330\nA\n100\nAcDbDictionary\n280\n0\n281\n1\n0\nDICTIONARY\n5\n15\n330\nA\n100\nAcDbDictionary\n280\n0\n281\n1\n0\nDICTIONARY\n5\n16\n330\nA\n100\nAcDbDictionary\n280\n0\n281\n1\n0\nLAYOUT\n5\n1A\n330\nD\n100\nAcDbPlotSettings\n1\n\n4\nA3\n6\n\n40\n7.5\n41\n20.0\n42\n7.5\n43\n20.0\n44\n420.0\n45\n297.0\n46\n0.0\n47\n0.0\n48\n0.0\n49\n0.0\n140\n0.0\n141\n0.0\n142\n1.0\n143\n1.0\n70\n1024\n72\n1\n73\n0\n74\n5\n7\n\n75\n16\n76\n0\n77\n2\n78\n300\n147\n1.0\n148\n0.0\n149\n0.0\n100\nAcDbLayout\n1\nModel\n70\n1\n71\n0\n10\n0.0\n20\n0.0\n11\n420.0\n21\n297.0\n12\n0.0\n22\n0.0\n32\n0.0\n14\n1e+20\n24\n1e+20\n34\n1e+20\n15\n-1e+20\n25\n-1e+20\n35\n-1e+20\n146\n0.0\n13\n0.0\n23\n0.0\n33\n0.0\n16\n1.0\n26\n0.0\n36\n0.0\n17\n0.0\n27\n1.0\n37\n0.0\n76\n1\n330\n17\n0\nLAYOUT\n5\n1E\n330\nD\n100\nAcDbPlotSettings\n1\n\n4\nA3\n6\n\n40\n7.5\n41\n20.0\n42\n7.5\n43\n20.0\n44\n420.0\n45\n297.0\n46\n0.0\n47\n0.0\n48\n0.0\n49\n0.0\n140\n0.0\n141\n0.0\n142\n1.0\n143\n1.0\n70\n0\n72\n1\n73\n0\n74\n5\n7\n\n75\n16\n76\n0\n77\n2\n78\n300\n147\n1.0\n148\n0.0\n149\n0.0\n100\nAcDbLayout\n1\nLayout1\n70\n1\n71\n1\n10\n0.0\n20\n0.0\n11\n420.0\n21\n297.0\n12\n0.0\n22\n0.0\n32\n0.0\n14\n1e+20\n24\n1e+20\n34\n1e+20\n15\n-1e+20\n25\n-1e+20\n35\n-1e+20\n146\n0.0\n13\n0.0\n23\n0.0\n33\n0.0\n16\n1.0\n26\n0.0\n36\n0.0\n17\n0.0\n27\n1.0\n37\n0.0\n76\n1\n330\n1B\n0\nMATERIAL\n5\n1F\n102\n{ACAD_REACTORS\n330\nE\n102\n}\n330\nE\n100\nAcDbMaterial\n1\nByBlock\n2\n\n70\n0\n40\n1.0\n71\n1\n41\n1.0\n91\n-1023410177\n42\n1.0\n72\n1\n3\n\n73\n1\n74\n1\n75\n1\n44\n0.5\n73\n0\n45\n1.0\n46\n1.0\n77\n1\n4\n\n78\n1\n79\n1\n170\n1\n48\n1.0\n171\n1\n6\n\n172\n1\n173\n1\n174\n1\n140\n1.0\n141\n1.0\n175\n1\n7\n\n176\n1\n177\n1\n178\n1\n143\n1.0\n179\n1\n8\n\n270\n1\n271\n1\n272\n1\n145\n1.0\n146\n1.0\n273\n1\n9\n\n274\n1\n275\n1\n276\n1\n42\n1.0\n72\n1\n3\n\n73\n1\n74\n1\n75\n1\n94\n63\n0\nMATERIAL\n5\n20\n102\n{ACAD_REACTORS\n330\nE\n102\n}\n330\nE\n100\nAcDbMaterial\n1\nByLayer\n2\n\n70\n0\n40\n1.0\n71\n1\n41\n1.0\n91\n-1023410177\n42\n1.0\n72\n1\n3\n\n73\n1\n74\n1\n75\n1\n44\n0.5\n73\n0\n45\n1.0\n46\n1.0\n77\n1\n4\n\n78\n1\n79\n1\n170\n1\n48\n1.0\n171\n1\n6\n\n172\n1\n173\n1\n174\n1\n140\n1.0\n141\n1.0\n175\n1\n7\n\n176\n1\n177\n1\n178\n1\n143\n1.0\n179\n1\n8\n\n270\n1\n271\n1\n272\n1\n145\n1.0\n146\n1.0\n273\n1\n9\n\n274\n1\n275\n1\n276\n1\n42\n1.0\n72\n1\n3\n\n73\n1\n74\n1\n75\n1\n94\n63\n0\nMATERIAL\n5\n21\n102\n{ACAD_REACTORS\n330\nE\n102\n}\n330\nE\n100\nAcDbMaterial\n1\nGlobal\n2\n\n70\n0\n40\n1.0\n71\n1\n41\n1.0\n91\n-1023410177\n42\n1.0\n72\n1\n3\n\n73\n1\n74\n1\n75\n1\n44\n0.5\n73\n0\n45\n1.0\n46\n1.0\n77\n1\n4\n\n78\n1\n79\n1\n170\n1\n48\n1.0\n171\n1\n6\n\n172\n1\n173\n1\n174\n1\n140\n1.0\n141\n1.0\n175\n1\n7\n\n176\n1\n177\n1\n178\n1\n143\n1.0\n179\n1\n8\n\n270\n1\n271\n1\n272\n1\n145\n1.0\n146\n1.0\n273\n1\n9\n\n274\n1\n275\n1\n276\n1\n42\n1.0\n72\n1\n3\n\n73\n1\n74\n1\n75\n1\n94\n63\n0\nMLINESTYLE\n5\n22\n102\n{ACAD_REACTORS\n330\n10\n102\n}\n330\n10\n100\nAcDbMlineStyle\n2\nStandard\n70\n0\n3\n\n62\n256\n51\n90.0\n52\n90.0\n71\n2\n49\n0.5\n62\n256\n6\nBYLAYER\n49\n-0.5\n62\n256\n6\nBYLAYER\n0\nMLEADERSTYLE\n5\n2C\n102\n{ACAD_REACTORS\n330\nF\n102\n}\n330\nF\n100\nAcDbMLeaderStyle\n179\n2\n170\n2\n171\n1\n172\n0\n90\n2\n40\n0.0\n41\n0.0\n173\n1\n91\n-1056964608\n92\n-2\n290\n1\n42\n2.0\n291\n1\n43\n8.0\n3\nStandard\n44\n4.0\n300\n\n342\n29\n174\n1\n175\n1\n176\n0\n178\n1\n93\n-1056964608\n45\n4.0\n292\n0\n297\n0\n46\n4.0\n94\n-1056964608\n47\n1.0\n49\n1.0\n140\n1.0\n294\n1\n141\n0.0\n177\n0\n142\n1.0\n295\n0\n296\n0\n143\n3.75\n271\n0\n272\n9\n273\n9\n0\nDICTIONARY\n5\n2D\n330\nA\n100\nAcDbDictionary\n281\n1\n3\nCREATED_BY_EZDXF\n350\n2E\n3\nWRITTEN_BY_EZDXF\n350\n31\n0\nDICTIONARYVAR\n5\n2E\n330\n2D\n100\nDictionaryVariables\n280\n0\n1\n1.4.1 @ 2026-09-15T11:34:37.733153+00:00\n0\nDICTIONARYVAR\n5\n31\n330\n2D\n100\nDictionaryVariables\n280\n0\n1\n1.4.1 @ 2026-09-15T11:34:37.733645+00:00\n0\nENDSEC\n0\nEOF\n";
@@ -0,0 +1,16 @@
1
+ import { Coordinate } from '../types/index.js';
2
+ export interface BlockEntity {
3
+ type: 'LINE' | 'CIRCLE' | 'LWPOLYLINE' | 'SOLID' | 'ARC';
4
+ points?: Coordinate[];
5
+ center?: Coordinate;
6
+ radius?: number;
7
+ startAngle?: number;
8
+ endAngle?: number;
9
+ color?: number;
10
+ layer?: string;
11
+ }
12
+ export interface BlockDefinition {
13
+ name: string;
14
+ entities: BlockEntity[];
15
+ }
16
+ export declare const BLOCK_REGISTRY: Record<string, BlockDefinition>;