@bitbybit-dev/base 1.6.2 → 1.8.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 (204) hide show
  1. package/NOTICE +24 -0
  2. package/README.md +3 -1
  3. package/lib/api/GlobalCDNProvider.js +1 -1
  4. package/lib/api/inputs/base-inputs.d.ts +40 -7
  5. package/lib/api/inputs/base-inputs.js +32 -0
  6. package/lib/api/inputs/io-inputs.d.ts +927 -59
  7. package/lib/api/inputs/io-inputs.js +769 -40
  8. package/lib/api/inputs/line-inputs.d.ts +17 -0
  9. package/lib/api/inputs/line-inputs.js +15 -0
  10. package/lib/api/inputs/mesh-inputs.d.ts +20 -1
  11. package/lib/api/inputs/mesh-inputs.js +23 -0
  12. package/lib/api/inputs/recipes-inputs.d.ts +13 -5
  13. package/lib/api/inputs/recipes-inputs.js +10 -5
  14. package/lib/api/kernel-calls/index.d.ts +2 -0
  15. package/lib/api/kernel-calls/index.js +2 -0
  16. package/lib/api/kernel-calls/resolve-dto.d.ts +3 -1
  17. package/lib/api/kernel-calls/resolve-dto.js +7 -2
  18. package/lib/api/kernel-calls/settings.d.ts +101 -0
  19. package/lib/api/kernel-calls/settings.js +123 -0
  20. package/lib/api/kernel-calls/up-axis-aliases.d.ts +25 -0
  21. package/lib/api/kernel-calls/up-axis-aliases.js +70 -0
  22. package/lib/api/models/simplex.d.ts +2 -0
  23. package/lib/api/models/simplex.js +10 -1
  24. package/lib/api/recipes/surface-mesh.d.ts +2 -1
  25. package/lib/api/recipes/surface-mesh.js +5 -3
  26. package/lib/api/resolved-inputs/index.d.ts +32 -3
  27. package/lib/api/services/base-bitbybit.d.ts +12 -0
  28. package/lib/api/services/base-bitbybit.js +19 -3
  29. package/lib/api/services/color.js +2 -3
  30. package/lib/api/services/helpers/color/color-forms.constants.d.ts +3 -0
  31. package/lib/api/services/helpers/color/color-forms.constants.js +3 -0
  32. package/lib/api/services/helpers/color/color-forms.d.ts +1 -0
  33. package/lib/api/services/helpers/color/color-forms.js +4 -1
  34. package/lib/api/services/helpers/color/css-colors.constants.d.ts +9 -0
  35. package/lib/api/services/helpers/color/css-colors.constants.js +158 -0
  36. package/lib/api/services/helpers/color/css-colors.d.ts +1 -0
  37. package/lib/api/services/helpers/color/css-colors.js +61 -0
  38. package/lib/api/services/helpers/curves/bezier-pieces.constants.d.ts +5 -0
  39. package/lib/api/services/helpers/curves/bezier-pieces.constants.js +5 -0
  40. package/lib/api/services/helpers/curves/bezier-pieces.d.ts +24 -0
  41. package/lib/api/services/helpers/curves/bezier-pieces.js +149 -0
  42. package/lib/api/services/helpers/curves/conic-arcs.constants.d.ts +5 -0
  43. package/lib/api/services/helpers/curves/conic-arcs.constants.js +5 -0
  44. package/lib/api/services/helpers/curves/conic-arcs.d.ts +26 -0
  45. package/lib/api/services/helpers/curves/conic-arcs.js +87 -0
  46. package/lib/api/services/helpers/curves/nurbs-forms.d.ts +20 -0
  47. package/lib/api/services/helpers/curves/nurbs-forms.js +112 -0
  48. package/lib/api/services/helpers/curves/nurbs.d.ts +4 -0
  49. package/lib/api/services/helpers/curves/nurbs.js +10 -9
  50. package/lib/api/services/helpers/files/drawing/drawing-budget.d.ts +3 -0
  51. package/lib/api/services/helpers/files/drawing/drawing-budget.js +34 -0
  52. package/lib/api/services/helpers/files/drawing/drawing-dimension.constants.d.ts +14 -0
  53. package/lib/api/services/helpers/files/drawing/drawing-dimension.constants.js +14 -0
  54. package/lib/api/services/helpers/files/drawing/drawing-dimension.d.ts +4 -0
  55. package/lib/api/services/helpers/files/drawing/drawing-dimension.js +271 -0
  56. package/lib/api/services/helpers/files/drawing/drawing-geometry.d.ts +21 -0
  57. package/lib/api/services/helpers/files/drawing/drawing-geometry.js +101 -0
  58. package/lib/api/services/helpers/files/drawing/drawing-hatch.d.ts +10 -0
  59. package/lib/api/services/helpers/files/drawing/drawing-hatch.js +123 -0
  60. package/lib/api/services/helpers/files/drawing/drawing-loops.d.ts +3 -0
  61. package/lib/api/services/helpers/files/drawing/drawing-loops.js +91 -0
  62. package/lib/api/services/helpers/files/drawing/drawing-model.d.ts +10 -0
  63. package/lib/api/services/helpers/files/drawing/drawing-model.js +336 -0
  64. package/lib/api/services/helpers/files/drawing/drawing-scale.d.ts +2 -0
  65. package/lib/api/services/helpers/files/drawing/drawing-scale.js +47 -0
  66. package/lib/api/services/helpers/files/drawing/drawing-text.d.ts +9 -0
  67. package/lib/api/services/helpers/files/drawing/drawing-text.js +25 -0
  68. package/lib/api/services/helpers/files/drawing/drawing-types.d.ts +117 -0
  69. package/lib/api/services/helpers/files/drawing/drawing-types.js +1 -0
  70. package/lib/api/services/helpers/files/drawing/drawing.constants.d.ts +41 -0
  71. package/lib/api/services/helpers/files/drawing/drawing.constants.js +46 -0
  72. package/lib/api/services/helpers/files/dxf/dxf-annotations.d.ts +5 -0
  73. package/lib/api/services/helpers/files/dxf/dxf-annotations.js +96 -0
  74. package/lib/api/services/helpers/files/dxf/dxf-colors.d.ts +5 -0
  75. package/lib/api/services/helpers/files/dxf/dxf-colors.js +45 -0
  76. package/lib/api/services/helpers/files/dxf/dxf-entities.d.ts +21 -0
  77. package/lib/api/services/helpers/files/dxf/dxf-entities.js +196 -0
  78. package/lib/api/services/helpers/files/dxf/dxf-file-text.d.ts +1 -0
  79. package/lib/api/services/helpers/files/dxf/dxf-file-text.js +50 -0
  80. package/lib/api/services/helpers/files/dxf/dxf-generator.d.ts +2 -36
  81. package/lib/api/services/helpers/files/dxf/dxf-generator.js +97 -523
  82. package/lib/api/services/helpers/files/dxf/dxf-reader-annotations.d.ts +9 -0
  83. package/lib/api/services/helpers/files/dxf/dxf-reader-annotations.js +312 -0
  84. package/lib/api/services/helpers/files/dxf/dxf-reader-dtos.d.ts +6 -0
  85. package/lib/api/services/helpers/files/dxf/dxf-reader-dtos.js +115 -0
  86. package/lib/api/services/helpers/files/dxf/dxf-reader-geometry.d.ts +21 -0
  87. package/lib/api/services/helpers/files/dxf/dxf-reader-geometry.js +67 -0
  88. package/lib/api/services/helpers/files/dxf/dxf-reader-segments.d.ts +9 -0
  89. package/lib/api/services/helpers/files/dxf/dxf-reader-segments.js +151 -0
  90. package/lib/api/services/helpers/files/dxf/dxf-reader-types.d.ts +96 -0
  91. package/lib/api/services/helpers/files/dxf/dxf-reader-types.js +1 -0
  92. package/lib/api/services/helpers/files/dxf/dxf-reader.constants.d.ts +134 -0
  93. package/lib/api/services/helpers/files/dxf/dxf-reader.constants.js +95 -0
  94. package/lib/api/services/helpers/files/dxf/dxf-reader.d.ts +2 -0
  95. package/lib/api/services/helpers/files/dxf/dxf-reader.js +446 -0
  96. package/lib/api/services/helpers/files/dxf/dxf-tables.d.ts +29 -0
  97. package/lib/api/services/helpers/files/dxf/dxf-tables.js +248 -0
  98. package/lib/api/services/helpers/files/dxf/dxf-text.d.ts +26 -0
  99. package/lib/api/services/helpers/files/dxf/dxf-text.js +97 -0
  100. package/lib/api/services/helpers/files/dxf/dxf-tokens.d.ts +11 -0
  101. package/lib/api/services/helpers/files/dxf/dxf-tokens.js +89 -0
  102. package/lib/api/services/helpers/files/dxf/dxf.constants.d.ts +43 -1
  103. package/lib/api/services/helpers/files/dxf/dxf.constants.js +47 -1
  104. package/lib/api/services/helpers/files/file-bytes.d.ts +1 -0
  105. package/lib/api/services/helpers/files/file-bytes.js +15 -0
  106. package/lib/api/services/helpers/files/ground-axes.d.ts +2 -0
  107. package/lib/api/services/helpers/files/ground-axes.js +4 -0
  108. package/lib/api/services/helpers/files/mesh-file-axes.d.ts +7 -0
  109. package/lib/api/services/helpers/files/mesh-file-axes.js +17 -0
  110. package/lib/api/services/helpers/files/stl-axes.d.ts +4 -0
  111. package/lib/api/services/helpers/files/stl-axes.js +22 -0
  112. package/lib/api/services/helpers/files/stl-types.d.ts +7 -0
  113. package/lib/api/services/helpers/files/stl-types.js +1 -0
  114. package/lib/api/services/helpers/files/stl.constants.d.ts +11 -0
  115. package/lib/api/services/helpers/files/stl.constants.js +11 -0
  116. package/lib/api/services/helpers/files/stl.d.ts +3 -0
  117. package/lib/api/services/helpers/files/stl.js +93 -0
  118. package/lib/api/services/helpers/files/svg/svg-css.d.ts +48 -0
  119. package/lib/api/services/helpers/files/svg/svg-css.js +444 -0
  120. package/lib/api/services/helpers/files/svg/svg-dash-patterns.d.ts +2 -0
  121. package/lib/api/services/helpers/files/svg/svg-dash-patterns.js +35 -0
  122. package/lib/api/services/helpers/files/svg/svg-document.d.ts +26 -0
  123. package/lib/api/services/helpers/files/svg/svg-document.js +89 -0
  124. package/lib/api/services/helpers/files/svg/svg-memo.d.ts +1 -0
  125. package/lib/api/services/helpers/files/svg/svg-memo.js +8 -0
  126. package/lib/api/services/helpers/files/svg/svg-normalizer.d.ts +6 -0
  127. package/lib/api/services/helpers/files/svg/svg-normalizer.js +433 -0
  128. package/lib/api/services/helpers/files/svg/svg-numbers.d.ts +15 -0
  129. package/lib/api/services/helpers/files/svg/svg-numbers.js +61 -0
  130. package/lib/api/services/helpers/files/svg/svg-path-data.constants.d.ts +8 -0
  131. package/lib/api/services/helpers/files/svg/svg-path-data.constants.js +10 -0
  132. package/lib/api/services/helpers/files/svg/svg-path-data.d.ts +9 -0
  133. package/lib/api/services/helpers/files/svg/svg-path-data.js +203 -0
  134. package/lib/api/services/helpers/files/svg/svg-path-types.d.ts +33 -0
  135. package/lib/api/services/helpers/files/svg/svg-path-types.js +1 -0
  136. package/lib/api/services/helpers/files/svg/svg-reader.constants.d.ts +35 -0
  137. package/lib/api/services/helpers/files/svg/svg-reader.constants.js +35 -0
  138. package/lib/api/services/helpers/files/svg/svg-reading.constants.d.ts +9 -0
  139. package/lib/api/services/helpers/files/svg/svg-reading.constants.js +9 -0
  140. package/lib/api/services/helpers/files/svg/svg-reading.d.ts +6 -0
  141. package/lib/api/services/helpers/files/svg/svg-reading.js +233 -0
  142. package/lib/api/services/helpers/files/svg/svg-scene-types.d.ts +54 -0
  143. package/lib/api/services/helpers/files/svg/svg-scene-types.js +1 -0
  144. package/lib/api/services/helpers/files/svg/svg-shapes.d.ts +6 -0
  145. package/lib/api/services/helpers/files/svg/svg-shapes.js +102 -0
  146. package/lib/api/services/helpers/files/svg/svg-strokes.d.ts +38 -0
  147. package/lib/api/services/helpers/files/svg/svg-strokes.js +132 -0
  148. package/lib/api/services/helpers/files/svg/svg-style.d.ts +26 -0
  149. package/lib/api/services/helpers/files/svg/svg-style.js +211 -0
  150. package/lib/api/services/helpers/files/svg/svg-transform.d.ts +10 -0
  151. package/lib/api/services/helpers/files/svg/svg-transform.js +76 -0
  152. package/lib/api/services/helpers/files/svg/svg-writer.d.ts +18 -0
  153. package/lib/api/services/helpers/files/svg/svg-writer.js +230 -0
  154. package/lib/api/services/helpers/files/svg/svg-xml.d.ts +11 -0
  155. package/lib/api/services/helpers/files/svg/svg-xml.js +322 -0
  156. package/lib/api/services/helpers/files/svg/svg.constants.d.ts +14 -0
  157. package/lib/api/services/helpers/files/svg/svg.constants.js +14 -0
  158. package/lib/api/services/helpers/files/work-budget.d.ts +11 -0
  159. package/lib/api/services/helpers/files/work-budget.js +26 -0
  160. package/lib/api/services/helpers/geometry/affine2.d.ts +8 -0
  161. package/lib/api/services/helpers/geometry/affine2.js +18 -0
  162. package/lib/api/services/helpers/geometry/ellipse-arcs.d.ts +14 -0
  163. package/lib/api/services/helpers/geometry/ellipse-arcs.js +96 -0
  164. package/lib/api/services/helpers/geometry/frame-axes.d.ts +3 -1
  165. package/lib/api/services/helpers/geometry/loop-fill.d.ts +2 -0
  166. package/lib/api/services/helpers/geometry/loop-fill.js +37 -0
  167. package/lib/api/services/helpers/geometry/polygon-nesting.constants.d.ts +6 -0
  168. package/lib/api/services/helpers/geometry/polygon-nesting.constants.js +6 -0
  169. package/lib/api/services/helpers/geometry/polygon-nesting.d.ts +31 -0
  170. package/lib/api/services/helpers/geometry/polygon-nesting.js +251 -0
  171. package/lib/api/services/helpers/geometry/vectors.d.ts +1 -0
  172. package/lib/api/services/helpers/geometry/vectors.js +6 -0
  173. package/lib/api/services/helpers/helper-types.d.ts +33 -0
  174. package/lib/api/services/helpers/text/stroke-font.d.ts +6 -0
  175. package/lib/api/services/helpers/text/stroke-font.js +177 -0
  176. package/lib/api/services/helpers/text/stroke-letters.constants.d.ts +2 -0
  177. package/lib/api/services/helpers/text/stroke-letters.constants.js +18 -0
  178. package/lib/api/services/helpers/text/stroke-marks.constants.d.ts +14 -0
  179. package/lib/api/services/helpers/text/stroke-marks.constants.js +34 -0
  180. package/lib/api/services/io/drawing.d.ts +368 -0
  181. package/lib/api/services/io/drawing.js +454 -0
  182. package/lib/api/services/io/dxf.d.ts +134 -0
  183. package/lib/api/services/io/dxf.js +167 -0
  184. package/lib/api/services/io/index.d.ts +4 -0
  185. package/lib/api/services/io/index.js +4 -0
  186. package/lib/api/services/io/io.d.ts +14 -0
  187. package/lib/api/services/io/io.js +15 -0
  188. package/lib/api/services/io/svg.d.ts +66 -0
  189. package/lib/api/services/io/svg.js +105 -0
  190. package/lib/api/services/line.d.ts +17 -0
  191. package/lib/api/services/line.js +20 -1
  192. package/lib/api/services/mesh.d.ts +19 -0
  193. package/lib/api/services/mesh.js +40 -0
  194. package/lib/api/services/point.d.ts +4 -1
  195. package/lib/api/services/point.js +9 -4
  196. package/lib/api/services/recipes.d.ts +3 -0
  197. package/lib/api/services/recipes.js +6 -2
  198. package/lib/api/services/text.d.ts +7 -4
  199. package/lib/api/services/text.js +14 -27
  200. package/package.json +1 -1
  201. package/lib/api/services/helpers/files/dxf/dxf.d.ts +0 -87
  202. package/lib/api/services/helpers/files/dxf/dxf.js +0 -111
  203. package/lib/api/services/io.d.ts +0 -9
  204. package/lib/api/services/io.js +0 -10
@@ -6,9 +6,50 @@
6
6
  export var IO;
7
7
  (function (IO) {
8
8
  /**
9
- * Line segment defined by start and end points
9
+ * How the lines of a drawing part are drawn: whole, or broken into dashes, the dashes scaled to
10
+ * the drawing's size. DXF writes the matching line type, SVG a dash pattern.
10
11
  */
11
- class DxfLineSegmentDto {
12
+ let lineTypeEnum;
13
+ (function (lineTypeEnum) {
14
+ lineTypeEnum["continuous"] = "continuous";
15
+ lineTypeEnum["dashed"] = "dashed";
16
+ lineTypeEnum["hidden"] = "hidden";
17
+ lineTypeEnum["center"] = "center";
18
+ lineTypeEnum["dotted"] = "dotted";
19
+ })(lineTypeEnum = IO.lineTypeEnum || (IO.lineTypeEnum = {}));
20
+ /**
21
+ * What a hatch fills its region with: `solid` ink, or lines `spacing` apart - `ansi31` one run
22
+ * of lines, `ansi32` lines in pairs a third of the spacing apart, `ansi37` two runs crossing at
23
+ * right angles.
24
+ *
25
+ * The second line of each `ansi32` pair is drawn whole, where the ANSI32 of CAD programs dashes
26
+ * it; a DXF file names the pattern ANSI32 at its standard scale.
27
+ * @beta
28
+ */
29
+ let hatchPatternEnum;
30
+ (function (hatchPatternEnum) {
31
+ hatchPatternEnum["solid"] = "solid";
32
+ hatchPatternEnum["ansi31"] = "ansi31";
33
+ hatchPatternEnum["ansi32"] = "ansi32";
34
+ hatchPatternEnum["ansi37"] = "ansi37";
35
+ })(hatchPatternEnum = IO.hatchPatternEnum || (IO.hatchPatternEnum = {}));
36
+ /**
37
+ * What a dimension measures: a `linear` distance between two points, the `diameter` or the
38
+ * `radius` of a circle, or the `angle` between two arms that meet at a point.
39
+ * @beta
40
+ */
41
+ let dimensionKindEnum;
42
+ (function (dimensionKindEnum) {
43
+ dimensionKindEnum["linear"] = "linear";
44
+ dimensionKindEnum["diameter"] = "diameter";
45
+ dimensionKindEnum["radius"] = "radius";
46
+ dimensionKindEnum["angular"] = "angular";
47
+ })(dimensionKindEnum = IO.dimensionKindEnum || (IO.dimensionKindEnum = {}));
48
+ /**
49
+ * A straight line in a drawing path, from `start` to `end`. Points may carry a Z coordinate; one
50
+ * without it lies at Z 0.
51
+ */
52
+ class DrawingLineSegmentDto {
12
53
  constructor(start, end) {
13
54
  if (start !== undefined) {
14
55
  this.start = start;
@@ -18,12 +59,13 @@ export var IO;
18
59
  }
19
60
  }
20
61
  }
21
- IO.DxfLineSegmentDto = DxfLineSegmentDto;
62
+ IO.DrawingLineSegmentDto = DrawingLineSegmentDto;
22
63
  /**
23
- * Arc segment defined by center, radius, and start/end angles in degrees
64
+ * A circular arc in a drawing path, running counterclockwise from `startAngle` to `endAngle`
65
+ * about its `center`, in the XY plane unless a `normal` tilts it.
24
66
  */
25
- class DxfArcSegmentDto {
26
- constructor(center, radius, startAngle, endAngle) {
67
+ class DrawingArcSegmentDto {
68
+ constructor(center, radius, startAngle, endAngle, normal) {
27
69
  if (center !== undefined) {
28
70
  this.center = center;
29
71
  }
@@ -36,31 +78,38 @@ export var IO;
36
78
  if (endAngle !== undefined) {
37
79
  this.endAngle = endAngle;
38
80
  }
81
+ if (normal !== undefined) {
82
+ this.normal = normal;
83
+ }
39
84
  }
40
85
  }
41
- IO.DxfArcSegmentDto = DxfArcSegmentDto;
86
+ IO.DrawingArcSegmentDto = DrawingArcSegmentDto;
42
87
  /**
43
- * A full circle in a DXF path, given by its center and radius.
88
+ * A full circle in a drawing path, given by its center and radius, in the XY plane unless a
89
+ * `normal` tilts it.
44
90
  */
45
- class DxfCircleSegmentDto {
46
- constructor(center, radius) {
91
+ class DrawingCircleSegmentDto {
92
+ constructor(center, radius, normal) {
47
93
  if (center !== undefined) {
48
94
  this.center = center;
49
95
  }
50
96
  if (radius !== undefined) {
51
97
  this.radius = radius;
52
98
  }
99
+ if (normal !== undefined) {
100
+ this.normal = normal;
101
+ }
53
102
  }
54
103
  }
55
- IO.DxfCircleSegmentDto = DxfCircleSegmentDto;
104
+ IO.DrawingCircleSegmentDto = DrawingCircleSegmentDto;
56
105
  /**
57
- * Polyline segment defined by multiple points
58
- * Can include bulge values to create arc segments between vertices
106
+ * Connected straight segments through `points`, each of which a bulge can bend into an arc. A
107
+ * polyline whose points do not all share one Z is written as a 3D polyline, which takes no bulges.
59
108
  */
60
- class DxfPolylineSegmentDto {
109
+ class DrawingPolylineSegmentDto {
61
110
  constructor(points, closed, bulges) {
62
111
  /**
63
- * Whether the polyline is closed
112
+ * Whether a segment joins the last vertex back to the first.
64
113
  * @default false
65
114
  */
66
115
  this.closed = false;
@@ -75,19 +124,24 @@ export var IO;
75
124
  }
76
125
  }
77
126
  }
78
- IO.DxfPolylineSegmentDto = DxfPolylineSegmentDto;
127
+ IO.DrawingPolylineSegmentDto = DrawingPolylineSegmentDto;
79
128
  /**
80
- * Spline/B-spline segment defined by control points and degree
129
+ * A B-spline or NURBS curve in a drawing path, given by its control points, degree and
130
+ * optionally its knots and weights. Without knots the curve starts and ends at its end points.
81
131
  */
82
- class DxfSplineSegmentDto {
83
- constructor(controlPoints, degree, closed) {
132
+ class DrawingSplineSegmentDto {
133
+ constructor(controlPoints, degree, closed, knots, weights) {
84
134
  /**
85
- * Degree of the spline (typically 2 or 3)
135
+ * The degree of the curve: 1 draws the control polygon, 2 and 3 smooth curves.
86
136
  * @default 3
137
+ * @minimum 1
138
+ * @maximum Infinity
139
+ * @step 1
87
140
  */
88
141
  this.degree = 3;
89
142
  /**
90
- * Whether the spline is closed
143
+ * Without `knots`, whether the curve wraps around its control points into a smooth closed
144
+ * loop. With `knots`, the knots decide, and this is ignored.
91
145
  * @default false
92
146
  */
93
147
  this.closed = false;
@@ -100,36 +154,250 @@ export var IO;
100
154
  if (closed !== undefined) {
101
155
  this.closed = closed;
102
156
  }
157
+ if (knots !== undefined) {
158
+ this.knots = knots;
159
+ }
160
+ if (weights !== undefined) {
161
+ this.weights = weights;
162
+ }
103
163
  }
104
164
  }
105
- IO.DxfSplineSegmentDto = DxfSplineSegmentDto;
165
+ IO.DrawingSplineSegmentDto = DrawingSplineSegmentDto;
106
166
  /**
107
- * A path can contain multiple segments of different types (lines, arcs, polylines, circles, splines)
108
- * Similar to OCCT wires that can combine different edge types
167
+ * An ellipse or an arc of one in a drawing path: its center, the vector to the end of its major
168
+ * axis and the minor to major ratio, in the XY plane unless `normal` tilts it.
109
169
  */
110
- class DxfPathDto {
170
+ class DrawingEllipseSegmentDto {
171
+ constructor(center, majorAxis, ratio, startParameter, endParameter, normal) {
172
+ /**
173
+ * Where the arc starts, as the ellipse's parameter t in radians (the point center +
174
+ * cos(t) `majorAxis` + sin(t) minor axis), the angle only when `ratio` is 1.
175
+ * @default 0
176
+ * @minimum -Infinity
177
+ * @maximum Infinity
178
+ */
179
+ this.startParameter = 0;
180
+ /**
181
+ * Where the arc ends, as the same parameter in radians; the arc runs counterclockwise from the
182
+ * start, through 0 when the end is below the start.
183
+ * @default 6.283185307179586
184
+ * @minimum -Infinity
185
+ * @maximum Infinity
186
+ */
187
+ this.endParameter = 6.283185307179586;
188
+ if (center !== undefined) {
189
+ this.center = center;
190
+ }
191
+ if (majorAxis !== undefined) {
192
+ this.majorAxis = majorAxis;
193
+ }
194
+ if (ratio !== undefined) {
195
+ this.ratio = ratio;
196
+ }
197
+ if (startParameter !== undefined) {
198
+ this.startParameter = startParameter;
199
+ }
200
+ if (endParameter !== undefined) {
201
+ this.endParameter = endParameter;
202
+ }
203
+ if (normal !== undefined) {
204
+ this.normal = normal;
205
+ }
206
+ }
207
+ }
208
+ IO.DrawingEllipseSegmentDto = DrawingEllipseSegmentDto;
209
+ /**
210
+ * A path of a drawing: segments of any kind (lines, arcs, circles, polylines, splines and
211
+ * ellipses), in the order they are drawn, like the edges of a wire.
212
+ */
213
+ class DrawingPathDto {
111
214
  constructor(segments) {
112
215
  if (segments !== undefined) {
113
216
  this.segments = segments;
114
217
  }
115
218
  }
116
219
  }
117
- IO.DxfPathDto = DxfPathDto;
220
+ IO.DrawingPathDto = DrawingPathDto;
118
221
  /**
119
- * A part containing multiple paths on the same layer with the same color
222
+ * A line of text, in the stroke font `text.vectorText` draws.
223
+ *
224
+ * SVG draws its strokes; DXF writes a text fitted to their width. Accented Latin letters are
225
+ * drawn; a character the font lacks is a question mark, an emoji two.
226
+ * @beta
120
227
  */
121
- class DxfPathsPartDto {
122
- constructor(layer, color, paths) {
228
+ class DrawingTextDto {
229
+ constructor(text, position, height, anchor, rotation, widthFactor) {
230
+ /**
231
+ * The height of a capital letter, in drawing units.
232
+ * @default 3.5
233
+ * @minimum 0
234
+ * @exclusiveMinimum true
235
+ */
236
+ this.height = 3.5;
123
237
  /**
124
- * Layer name for all paths in this part
238
+ * Which point of the baseline `position` is: where the text starts, its middle or its end.
239
+ * @default start
240
+ */
241
+ this.anchor = "start";
242
+ /**
243
+ * The angle of the baseline in degrees, counterclockwise from the X axis.
244
+ * @default 0
245
+ */
246
+ this.rotation = 0;
247
+ /**
248
+ * How wide the letters are drawn against their natural width: below 1 narrows a text to fit a
249
+ * cell, above 1 widens it.
250
+ * @default 1
251
+ * @minimum 0
252
+ * @exclusiveMinimum true
253
+ */
254
+ this.widthFactor = 1;
255
+ if (text !== undefined) {
256
+ this.text = text;
257
+ }
258
+ if (position !== undefined) {
259
+ this.position = position;
260
+ }
261
+ if (height !== undefined) {
262
+ this.height = height;
263
+ }
264
+ if (anchor !== undefined) {
265
+ this.anchor = anchor;
266
+ }
267
+ if (rotation !== undefined) {
268
+ this.rotation = rotation;
269
+ }
270
+ if (widthFactor !== undefined) {
271
+ this.widthFactor = widthFactor;
272
+ }
273
+ }
274
+ }
275
+ IO.DrawingTextDto = DrawingTextDto;
276
+ /**
277
+ * The room a drawing text takes, as `io.drawing.textSize` measures it.
278
+ * @beta
279
+ */
280
+ class DrawingTextSizeDto {
281
+ }
282
+ IO.DrawingTextSizeDto = DrawingTextSizeDto;
283
+ /**
284
+ * A hatched region of a drawing part: what its boundaries enclose, filled with a pattern.
285
+ *
286
+ * A boundary inside another cuts a hole, and one whose ends do not meet is closed by a
287
+ * straight line.
288
+ * @beta
289
+ */
290
+ class DrawingHatchDto {
291
+ constructor(boundaries, pattern, angle, spacing) {
292
+ /**
293
+ * What the region is filled with.
294
+ * @default ansi31
295
+ */
296
+ this.pattern = hatchPatternEnum.ansi31;
297
+ /**
298
+ * The angle of the pattern's lines in degrees, counterclockwise from the X axis; `solid`
299
+ * ignores it.
300
+ * @default 45
301
+ */
302
+ this.angle = 45;
303
+ /**
304
+ * The distance between the pattern's lines, in drawing units; `solid` ignores it. DXF writes
305
+ * it as a scale of the pattern in `acad.pat` for an inch drawing, in `acadiso.pat` otherwise.
306
+ * @default 3
307
+ * @minimum 0
308
+ * @exclusiveMinimum true
309
+ */
310
+ this.spacing = 3;
311
+ if (boundaries !== undefined) {
312
+ this.boundaries = boundaries;
313
+ }
314
+ if (pattern !== undefined) {
315
+ this.pattern = pattern;
316
+ }
317
+ if (angle !== undefined) {
318
+ this.angle = angle;
319
+ }
320
+ if (spacing !== undefined) {
321
+ this.spacing = spacing;
322
+ }
323
+ }
324
+ }
325
+ IO.DrawingHatchDto = DrawingHatchDto;
326
+ /**
327
+ * A hatch and how closely its curved boundaries are followed, for `io.drawing.clippedHatchLines`,
328
+ * which clips the pattern's lines to the region, and `io.drawing.hatchOutlines`, which gives the
329
+ * region's outlines as points.
330
+ * @beta
331
+ */
332
+ class DrawingHatchRegionDto {
333
+ constructor(boundaries, pattern, angle, spacing, tolerance) {
334
+ /**
335
+ * What the region is filled with; `solid` has no lines.
336
+ * @default ansi31
337
+ */
338
+ this.pattern = hatchPatternEnum.ansi31;
339
+ /**
340
+ * The angle of the pattern's lines in degrees, counterclockwise from the X axis.
341
+ * @default 45
342
+ */
343
+ this.angle = 45;
344
+ /**
345
+ * The distance between the pattern's lines, in drawing units.
346
+ * @default 3
347
+ * @minimum 0
348
+ * @exclusiveMinimum true
349
+ */
350
+ this.spacing = 3;
351
+ /**
352
+ * How far, in drawing units, the outline may stray from a curved boundary: arcs, circles,
353
+ * ellipses and splines become straight pieces this close to the curve.
354
+ * @default 0.01
355
+ * @minimum 0
356
+ * @exclusiveMinimum true
357
+ * @maximum Infinity
358
+ * @step 0.001
359
+ */
360
+ this.tolerance = 0.01;
361
+ if (boundaries !== undefined) {
362
+ this.boundaries = boundaries;
363
+ }
364
+ if (pattern !== undefined) {
365
+ this.pattern = pattern;
366
+ }
367
+ if (angle !== undefined) {
368
+ this.angle = angle;
369
+ }
370
+ if (spacing !== undefined) {
371
+ this.spacing = spacing;
372
+ }
373
+ if (tolerance !== undefined) {
374
+ this.tolerance = tolerance;
375
+ }
376
+ }
377
+ }
378
+ IO.DrawingHatchRegionDto = DrawingHatchRegionDto;
379
+ /**
380
+ * A part of a drawing: paths, texts and hatches on one layer, in one color, line type and line
381
+ * weight, which `io.dxf.dxfCreate` writes as DXF and `io.svg.svgCreate` as SVG.
382
+ */
383
+ class DrawingPartDto {
384
+ constructor(layer, color, paths, lineType, lineWeight, texts, hatches) {
385
+ /**
386
+ * The layer the paths go on. Parts may share a layer, which takes the first part's color and
387
+ * line type; every part's paths keep their own.
125
388
  * @default Default
126
389
  */
127
390
  this.layer = "Default";
128
391
  /**
129
- * Color for all paths in this part, as a hex string such as `#000000`
392
+ * The color of every path in the part, as a hex string such as `#000000`.
130
393
  * @default #000000
131
394
  */
132
395
  this.color = "#000000";
396
+ /**
397
+ * Whether the lines are whole or dashed, such as `hidden` for edges a view cannot see.
398
+ * @default continuous
399
+ */
400
+ this.lineType = lineTypeEnum.continuous;
133
401
  if (layer !== undefined) {
134
402
  this.layer = layer;
135
403
  }
@@ -139,27 +407,245 @@ export var IO;
139
407
  if (paths !== undefined) {
140
408
  this.paths = paths;
141
409
  }
410
+ if (lineType !== undefined) {
411
+ this.lineType = lineType;
412
+ }
413
+ if (lineWeight !== undefined) {
414
+ this.lineWeight = lineWeight;
415
+ }
416
+ if (texts !== undefined) {
417
+ this.texts = texts;
418
+ }
419
+ if (hatches !== undefined) {
420
+ this.hatches = hatches;
421
+ }
422
+ }
423
+ }
424
+ IO.DrawingPartDto = DrawingPartDto;
425
+ /**
426
+ * Drawing parts and the one factor `io.drawing.scaleParts` scales them by about the origin, such
427
+ * as 1/25.4 to turn a drawing in millimetres into inches before writing it.
428
+ * @beta
429
+ */
430
+ class DrawingScalePartsDto {
431
+ constructor(parts, factor) {
432
+ /**
433
+ * What every length is multiplied by: 2 doubles the drawing, 25.4 turns inches into
434
+ * millimetres.
435
+ * @default 1
436
+ * @minimum 0
437
+ * @exclusiveMinimum true
438
+ */
439
+ this.factor = 1;
440
+ if (parts !== undefined) {
441
+ this.parts = parts;
442
+ }
443
+ if (factor !== undefined) {
444
+ this.factor = factor;
445
+ }
446
+ }
447
+ }
448
+ IO.DrawingScalePartsDto = DrawingScalePartsDto;
449
+ /**
450
+ * A dimension in the drawing's plane for `io.drawing.dimensionPicture`, which draws it, and
451
+ * `io.drawing.dimensionExtent`, which measures the box it fills: what it measures, between which
452
+ * points, and the size of its text and arrows.
453
+ * @beta
454
+ */
455
+ class DrawingDimensionDto {
456
+ constructor(kind, start, end, direction, offset, angle, value, decimalPlaces, upperTolerance, lowerTolerance, textHeight, arrowLength) {
457
+ /**
458
+ * What the dimension measures; it decides what `start`, `end`, `offset` and `angle` mean.
459
+ * @default linear
460
+ */
461
+ this.kind = dimensionKindEnum.linear;
462
+ /**
463
+ * For `linear`, how far the dimension line stands from `start`, in drawing units, to the left of
464
+ * `direction`; negative puts it right. Other kinds ignore it.
465
+ * @default 10
466
+ * @minimum -Infinity
467
+ * @maximum Infinity
468
+ */
469
+ this.offset = 10;
470
+ /**
471
+ * For `angular`, the angle in degrees from the first arm, the one through `end`,
472
+ * counterclockwise to the second arm. Other kinds ignore it.
473
+ * @default 90
474
+ * @minimum 0
475
+ * @maximum 360
476
+ * @exclusiveMinimum true
477
+ * @exclusiveMaximum true
478
+ */
479
+ this.angle = 90;
480
+ /**
481
+ * How many decimals the value keeps; trailing zeros are dropped, so 15.50 shows as 15.5.
482
+ * @default 2
483
+ * @minimum 0
484
+ * @maximum 15
485
+ * @step 1
486
+ */
487
+ this.decimalPlaces = 2;
488
+ /**
489
+ * The height of the text's digits, in drawing units; the gaps around the lines are sized from it.
490
+ * @default 3.5
491
+ * @minimum 0
492
+ * @exclusiveMinimum true
493
+ */
494
+ this.textHeight = 3.5;
495
+ if (kind !== undefined) {
496
+ this.kind = kind;
497
+ }
498
+ if (start !== undefined) {
499
+ this.start = start;
500
+ }
501
+ if (end !== undefined) {
502
+ this.end = end;
503
+ }
504
+ if (direction !== undefined) {
505
+ this.direction = direction;
506
+ }
507
+ if (offset !== undefined) {
508
+ this.offset = offset;
509
+ }
510
+ if (angle !== undefined) {
511
+ this.angle = angle;
512
+ }
513
+ if (value !== undefined) {
514
+ this.value = value;
515
+ }
516
+ if (decimalPlaces !== undefined) {
517
+ this.decimalPlaces = decimalPlaces;
518
+ }
519
+ if (upperTolerance !== undefined) {
520
+ this.upperTolerance = upperTolerance;
521
+ }
522
+ if (lowerTolerance !== undefined) {
523
+ this.lowerTolerance = lowerTolerance;
524
+ }
525
+ if (textHeight !== undefined) {
526
+ this.textHeight = textHeight;
527
+ }
528
+ if (arrowLength !== undefined) {
529
+ this.arrowLength = arrowLength;
530
+ }
142
531
  }
143
532
  }
533
+ IO.DrawingDimensionDto = DrawingDimensionDto;
534
+ /**
535
+ * The box a dimension's picture fills, as `io.drawing.dimensionExtent` and
536
+ * `io.drawing.dimensionPicture` measure it, by its lowest and highest corner.
537
+ * @beta
538
+ */
539
+ class DrawingExtentDto {
540
+ }
541
+ IO.DrawingExtentDto = DrawingExtentDto;
542
+ /**
543
+ * A dimension drawn by `io.drawing.dimensionPicture`: its lines, its arrowheads as loops to
544
+ * fill, its text as strokes and as a drawing text, and the box all of it fills.
545
+ * @beta
546
+ */
547
+ class DrawingDimensionPictureDto {
548
+ }
549
+ IO.DrawingDimensionPictureDto = DrawingDimensionPictureDto;
550
+ /**
551
+ * A straight line in a drawing path, under its former DXF name.
552
+ *
553
+ * @deprecated Use `DrawingLineSegmentDto`, the same DTO under the drawing's own name; this one is removed
554
+ * in the next major version.
555
+ */
556
+ class DxfLineSegmentDto extends DrawingLineSegmentDto {
557
+ }
558
+ IO.DxfLineSegmentDto = DxfLineSegmentDto;
559
+ /**
560
+ * A circular arc in a drawing path, under its former DXF name.
561
+ *
562
+ * @deprecated Use `DrawingArcSegmentDto`, the same DTO under the drawing's own name; this one is removed
563
+ * in the next major version.
564
+ */
565
+ class DxfArcSegmentDto extends DrawingArcSegmentDto {
566
+ }
567
+ IO.DxfArcSegmentDto = DxfArcSegmentDto;
568
+ /**
569
+ * A full circle in a drawing path, under its former DXF name.
570
+ *
571
+ * @deprecated Use `DrawingCircleSegmentDto`, the same DTO under the drawing's own name; this one is removed
572
+ * in the next major version.
573
+ */
574
+ class DxfCircleSegmentDto extends DrawingCircleSegmentDto {
575
+ }
576
+ IO.DxfCircleSegmentDto = DxfCircleSegmentDto;
577
+ /**
578
+ * Connected straight segments in a drawing path, under its former DXF name.
579
+ *
580
+ * @deprecated Use `DrawingPolylineSegmentDto`, the same DTO under the drawing's own name; this one is removed
581
+ * in the next major version.
582
+ */
583
+ class DxfPolylineSegmentDto extends DrawingPolylineSegmentDto {
584
+ }
585
+ IO.DxfPolylineSegmentDto = DxfPolylineSegmentDto;
586
+ /**
587
+ * A B-spline or NURBS curve in a drawing path, under its former DXF name.
588
+ *
589
+ * @deprecated Use `DrawingSplineSegmentDto`, the same DTO under the drawing's own name; this one is removed
590
+ * in the next major version.
591
+ */
592
+ class DxfSplineSegmentDto extends DrawingSplineSegmentDto {
593
+ }
594
+ IO.DxfSplineSegmentDto = DxfSplineSegmentDto;
595
+ /**
596
+ * An ellipse or an arc of one in a drawing path, under its former DXF name.
597
+ *
598
+ * @deprecated Use `DrawingEllipseSegmentDto`, the same DTO under the drawing's own name; this one is removed
599
+ * in the next major version.
600
+ */
601
+ class DxfEllipseSegmentDto extends DrawingEllipseSegmentDto {
602
+ }
603
+ IO.DxfEllipseSegmentDto = DxfEllipseSegmentDto;
604
+ /**
605
+ * A path of a drawing, under its former DXF name.
606
+ *
607
+ * @deprecated Use `DrawingPathDto`, the same DTO under the drawing's own name; this one is removed
608
+ * in the next major version.
609
+ */
610
+ class DxfPathDto extends DrawingPathDto {
611
+ }
612
+ IO.DxfPathDto = DxfPathDto;
613
+ /**
614
+ * A part of a drawing: paths on one layer with one color and one line type, under its former DXF name.
615
+ *
616
+ * @deprecated Use `DrawingPartDto`, the same DTO under the drawing's own name; this one is removed
617
+ * in the next major version.
618
+ */
619
+ class DxfPathsPartDto extends DrawingPartDto {
620
+ }
144
621
  IO.DxfPathsPartDto = DxfPathsPartDto;
145
622
  /**
146
- * A whole DXF drawing: its path parts by layer and color, and the color and version format to
147
- * write.
623
+ * A whole DXF drawing for `io.dxf.dxfCreate`: its path parts by layer and color, and the color
624
+ * format, the version and the unit to write. In inches it is marked imperial, so hatch scales
625
+ * count from inch patterns.
148
626
  */
149
627
  class DxfModelDto {
150
- constructor(dxfPathsParts, colorFormat, acadVersion, unit) {
628
+ constructor(dxfPathsParts, colorFormat, acadVersion, unit, curveTolerance, lineTypeScale) {
151
629
  /**
152
- * How colors are written: `aci`, the AutoCAD color index from 1 to 255 that older
153
- * software reads, or `truecolor`, full 24-bit RGB for newer software.
630
+ * How colors are written: `aci`, the nearest of AutoCAD's 255 index colors, or `truecolor`,
631
+ * the exact color beside that index (`AC1015` only; `AC1009` writes the index).
154
632
  * @default aci
155
633
  */
156
634
  this.colorFormat = "aci";
157
635
  /**
158
- * The DXF version to write: `AC1009` (AutoCAD R12) for the widest compatibility, or
159
- * `AC1015` (AutoCAD 2000) for the newer features.
160
- * @default AC1009
636
+ * The DXF version: `AC1015` (AutoCAD 2000), which keeps splines and ellipses exact, or `AC1009`
637
+ * (AutoCAD R12) for old software, where they become polylines within `curveTolerance`.
638
+ * @default AC1015
639
+ */
640
+ this.acadVersion = "AC1015";
641
+ /**
642
+ * The largest distance, in drawing units, between a curve and the polyline that stands in for
643
+ * it where the version cannot hold the curve exactly.
644
+ * @default 0.01
645
+ * @minimum 0
646
+ * @exclusiveMinimum true
161
647
  */
162
- this.acadVersion = "AC1009";
648
+ this.curveTolerance = 0.01;
163
649
  if (dxfPathsParts !== undefined) {
164
650
  this.dxfPathsParts = dxfPathsParts;
165
651
  }
@@ -172,7 +658,250 @@ export var IO;
172
658
  if (unit !== undefined) {
173
659
  this.unit = unit;
174
660
  }
661
+ if (curveTolerance !== undefined) {
662
+ this.curveTolerance = curveTolerance;
663
+ }
664
+ if (lineTypeScale !== undefined) {
665
+ this.lineTypeScale = lineTypeScale;
666
+ }
175
667
  }
176
668
  }
177
669
  IO.DxfModelDto = DxfModelDto;
670
+ /**
671
+ * The text of a DXF file for `io.dxf.dxfRead`, which reads its drawing into path parts, and
672
+ * whether layers that are switched off or frozen are read too.
673
+ */
674
+ class DxfReadDto {
675
+ constructor(dxf, includeHiddenLayers) {
676
+ /**
677
+ * When true, layers the file has switched off or frozen are read as well.
678
+ * @default false
679
+ */
680
+ this.includeHiddenLayers = false;
681
+ if (dxf !== undefined) {
682
+ this.dxf = dxf;
683
+ }
684
+ if (includeHiddenLayers !== undefined) {
685
+ this.includeHiddenLayers = includeHiddenLayers;
686
+ }
687
+ }
688
+ }
689
+ IO.DxfReadDto = DxfReadDto;
690
+ /**
691
+ * A drawing read from a DXF file by `io.dxf.dxfRead`: its parts by layer, color and line type, in
692
+ * the shape `io.dxf.dxfCreate` and `io.svg.svgCreate` write, with the unit and what was left out.
693
+ */
694
+ class DxfDrawingDto {
695
+ }
696
+ IO.DxfDrawingDto = DxfDrawingDto;
697
+ /**
698
+ * A whole SVG drawing for `io.svg.svgCreate`: its path parts by layer, color and line type, the
699
+ * unit that gives it its true size, and how wide the lines and the border are.
700
+ */
701
+ class SvgModelDto {
702
+ constructor(parts, unit, strokeWidth, margin, tolerance, lineTypeScale) {
703
+ /**
704
+ * The largest distance, in drawing units, between a curve SVG cannot draw exactly (a rational
705
+ * or higher degree spline) and the cubic curves that stand in for it.
706
+ * @default 0.01
707
+ * @minimum 0
708
+ * @exclusiveMinimum true
709
+ */
710
+ this.tolerance = 0.01;
711
+ if (parts !== undefined) {
712
+ this.parts = parts;
713
+ }
714
+ if (unit !== undefined) {
715
+ this.unit = unit;
716
+ }
717
+ if (strokeWidth !== undefined) {
718
+ this.strokeWidth = strokeWidth;
719
+ }
720
+ if (margin !== undefined) {
721
+ this.margin = margin;
722
+ }
723
+ if (tolerance !== undefined) {
724
+ this.tolerance = tolerance;
725
+ }
726
+ if (lineTypeScale !== undefined) {
727
+ this.lineTypeScale = lineTypeScale;
728
+ }
729
+ }
730
+ }
731
+ IO.SvgModelDto = SvgModelDto;
732
+ /**
733
+ * One drawing path for `io.svg.pathData`, and how its coordinates are written.
734
+ */
735
+ class SvgPathDataDto {
736
+ constructor(path, flipY, tolerance, cubicsOnly) {
737
+ /**
738
+ * Whether Y is negated, as an SVG file needs (its Y runs down); leave it off for data drawn
739
+ * inside a group that flips Y itself.
740
+ * @default true
741
+ */
742
+ this.flipY = true;
743
+ /**
744
+ * The largest distance, in drawing units, between a curve SVG cannot draw exactly and the
745
+ * cubic curves that stand in for it.
746
+ * @default 0.01
747
+ * @minimum 0
748
+ * @exclusiveMinimum true
749
+ */
750
+ this.tolerance = 0.01;
751
+ /**
752
+ * When true, every curve is written as cubic Beziers (`C`), arcs within `tolerance`, for
753
+ * renderers that draw only lines and cubics.
754
+ * @default false
755
+ * @beta
756
+ */
757
+ this.cubicsOnly = false;
758
+ if (path !== undefined) {
759
+ this.path = path;
760
+ }
761
+ if (flipY !== undefined) {
762
+ this.flipY = flipY;
763
+ }
764
+ if (tolerance !== undefined) {
765
+ this.tolerance = tolerance;
766
+ }
767
+ if (cubicsOnly !== undefined) {
768
+ this.cubicsOnly = cubicsOnly;
769
+ }
770
+ }
771
+ }
772
+ IO.SvgPathDataDto = SvgPathDataDto;
773
+ /**
774
+ * The text of an SVG file for `io.svg.svgRead`, which reads its drawing into path parts, with the
775
+ * unit that brings it in at true size and whether hidden elements are read too.
776
+ */
777
+ class SvgReadDto {
778
+ constructor(svg, unit, includeInvisible) {
779
+ /**
780
+ * When true, elements hidden by `display` or `visibility` are read as well.
781
+ * @default false
782
+ */
783
+ this.includeInvisible = false;
784
+ if (svg !== undefined) {
785
+ this.svg = svg;
786
+ }
787
+ if (unit !== undefined) {
788
+ this.unit = unit;
789
+ }
790
+ if (includeInvisible !== undefined) {
791
+ this.includeInvisible = includeInvisible;
792
+ }
793
+ }
794
+ }
795
+ IO.SvgReadDto = SvgReadDto;
796
+ /**
797
+ * A drawing read from an SVG file by `io.svg.svgRead`: its parts by layer, color and line type, in
798
+ * the shape `io.dxf.dxfCreate` and `io.svg.svgCreate` write, with the unit, the view box and what
799
+ * was left out.
800
+ */
801
+ class SvgDrawingDto {
802
+ }
803
+ IO.SvgDrawingDto = SvgDrawingDto;
804
+ /**
805
+ * An SVG file for `io.drawing.svgToDxf`, which reads it as `io.svg.svgRead` does and writes it as
806
+ * `io.dxf.dxfCreate` does, with the options of both.
807
+ */
808
+ class SvgToDxfDto {
809
+ constructor(svg, unit, includeInvisible, colorFormat, acadVersion, curveTolerance) {
810
+ /**
811
+ * When true, elements hidden by `display` or `visibility` are written as well.
812
+ * @default false
813
+ */
814
+ this.includeInvisible = false;
815
+ /**
816
+ * How colors are written: `aci`, the nearest of AutoCAD's 255 index colors, or `truecolor`,
817
+ * the exact color beside that index (`AC1015` only; `AC1009` writes the index).
818
+ * @default aci
819
+ */
820
+ this.colorFormat = "aci";
821
+ /**
822
+ * The DXF version: `AC1015` (AutoCAD 2000), which keeps splines and ellipses exact, or `AC1009`
823
+ * (AutoCAD R12) for old software, where they become polylines within `curveTolerance`.
824
+ * @default AC1015
825
+ */
826
+ this.acadVersion = "AC1015";
827
+ /**
828
+ * The largest distance, in drawing units, between a curve and the polyline that stands in for
829
+ * it where the version cannot hold the curve exactly.
830
+ * @default 0.01
831
+ * @minimum 0
832
+ * @exclusiveMinimum true
833
+ */
834
+ this.curveTolerance = 0.01;
835
+ if (svg !== undefined) {
836
+ this.svg = svg;
837
+ }
838
+ if (unit !== undefined) {
839
+ this.unit = unit;
840
+ }
841
+ if (includeInvisible !== undefined) {
842
+ this.includeInvisible = includeInvisible;
843
+ }
844
+ if (colorFormat !== undefined) {
845
+ this.colorFormat = colorFormat;
846
+ }
847
+ if (acadVersion !== undefined) {
848
+ this.acadVersion = acadVersion;
849
+ }
850
+ if (curveTolerance !== undefined) {
851
+ this.curveTolerance = curveTolerance;
852
+ }
853
+ }
854
+ }
855
+ IO.SvgToDxfDto = SvgToDxfDto;
856
+ /**
857
+ * What `io.drawing.svgToDxf` returns: the DXF file it wrote from an SVG file, and what the
858
+ * reading left out or read differently.
859
+ */
860
+ class SvgToDxfResultDto {
861
+ }
862
+ IO.SvgToDxfResultDto = SvgToDxfResultDto;
863
+ /**
864
+ * A DXF file for `io.drawing.dxfToSvg`, which reads it as `io.dxf.dxfRead` does and writes it as
865
+ * `io.svg.svgCreate` does, with the options of both.
866
+ */
867
+ class DxfToSvgDto {
868
+ constructor(dxf, includeHiddenLayers, strokeWidth, margin, tolerance) {
869
+ /**
870
+ * When true, layers the file has switched off or frozen are written as well.
871
+ * @default false
872
+ */
873
+ this.includeHiddenLayers = false;
874
+ /**
875
+ * The largest distance, in drawing units, between a curve SVG cannot draw exactly (a rational
876
+ * or higher degree spline) and the cubic curves that stand in for it.
877
+ * @default 0.01
878
+ * @minimum 0
879
+ * @exclusiveMinimum true
880
+ */
881
+ this.tolerance = 0.01;
882
+ if (dxf !== undefined) {
883
+ this.dxf = dxf;
884
+ }
885
+ if (includeHiddenLayers !== undefined) {
886
+ this.includeHiddenLayers = includeHiddenLayers;
887
+ }
888
+ if (strokeWidth !== undefined) {
889
+ this.strokeWidth = strokeWidth;
890
+ }
891
+ if (margin !== undefined) {
892
+ this.margin = margin;
893
+ }
894
+ if (tolerance !== undefined) {
895
+ this.tolerance = tolerance;
896
+ }
897
+ }
898
+ }
899
+ IO.DxfToSvgDto = DxfToSvgDto;
900
+ /**
901
+ * What `io.drawing.dxfToSvg` returns: the SVG file it wrote from a DXF file, and what the reading
902
+ * left out.
903
+ */
904
+ class DxfToSvgResultDto {
905
+ }
906
+ IO.DxfToSvgResultDto = DxfToSvgResultDto;
178
907
  })(IO || (IO = {}));