@bitbybit-dev/base 1.6.2 → 1.7.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 (163) hide show
  1. package/lib/api/GlobalCDNProvider.js +1 -1
  2. package/lib/api/inputs/base-inputs.d.ts +20 -7
  3. package/lib/api/inputs/base-inputs.js +10 -0
  4. package/lib/api/inputs/io-inputs.d.ts +527 -59
  5. package/lib/api/inputs/io-inputs.js +432 -40
  6. package/lib/api/inputs/line-inputs.d.ts +17 -0
  7. package/lib/api/inputs/line-inputs.js +15 -0
  8. package/lib/api/kernel-calls/index.d.ts +1 -0
  9. package/lib/api/kernel-calls/index.js +1 -0
  10. package/lib/api/kernel-calls/settings.d.ts +82 -0
  11. package/lib/api/kernel-calls/settings.js +123 -0
  12. package/lib/api/recipes/surface-mesh.d.ts +2 -1
  13. package/lib/api/recipes/surface-mesh.js +5 -3
  14. package/lib/api/resolved-inputs/index.d.ts +22 -2
  15. package/lib/api/services/base-bitbybit.d.ts +12 -0
  16. package/lib/api/services/base-bitbybit.js +19 -3
  17. package/lib/api/services/color.js +2 -3
  18. package/lib/api/services/helpers/color/color-forms.constants.d.ts +3 -0
  19. package/lib/api/services/helpers/color/color-forms.constants.js +3 -0
  20. package/lib/api/services/helpers/color/color-forms.d.ts +1 -0
  21. package/lib/api/services/helpers/color/color-forms.js +4 -1
  22. package/lib/api/services/helpers/color/css-colors.constants.d.ts +9 -0
  23. package/lib/api/services/helpers/color/css-colors.constants.js +158 -0
  24. package/lib/api/services/helpers/color/css-colors.d.ts +1 -0
  25. package/lib/api/services/helpers/color/css-colors.js +61 -0
  26. package/lib/api/services/helpers/curves/bezier-pieces.constants.d.ts +5 -0
  27. package/lib/api/services/helpers/curves/bezier-pieces.constants.js +5 -0
  28. package/lib/api/services/helpers/curves/bezier-pieces.d.ts +24 -0
  29. package/lib/api/services/helpers/curves/bezier-pieces.js +149 -0
  30. package/lib/api/services/helpers/curves/conic-arcs.constants.d.ts +5 -0
  31. package/lib/api/services/helpers/curves/conic-arcs.constants.js +5 -0
  32. package/lib/api/services/helpers/curves/conic-arcs.d.ts +24 -0
  33. package/lib/api/services/helpers/curves/conic-arcs.js +85 -0
  34. package/lib/api/services/helpers/curves/nurbs-forms.d.ts +20 -0
  35. package/lib/api/services/helpers/curves/nurbs-forms.js +112 -0
  36. package/lib/api/services/helpers/curves/nurbs.d.ts +4 -0
  37. package/lib/api/services/helpers/curves/nurbs.js +10 -9
  38. package/lib/api/services/helpers/files/drawing/drawing-budget.d.ts +3 -0
  39. package/lib/api/services/helpers/files/drawing/drawing-budget.js +24 -0
  40. package/lib/api/services/helpers/files/drawing/drawing-geometry.d.ts +18 -0
  41. package/lib/api/services/helpers/files/drawing/drawing-geometry.js +84 -0
  42. package/lib/api/services/helpers/files/drawing/drawing-model.d.ts +5 -0
  43. package/lib/api/services/helpers/files/drawing/drawing-model.js +252 -0
  44. package/lib/api/services/helpers/files/drawing/drawing-types.d.ts +60 -0
  45. package/lib/api/services/helpers/files/drawing/drawing-types.js +1 -0
  46. package/lib/api/services/helpers/files/drawing/drawing.constants.d.ts +28 -0
  47. package/lib/api/services/helpers/files/drawing/drawing.constants.js +29 -0
  48. package/lib/api/services/helpers/files/dxf/dxf-colors.d.ts +5 -0
  49. package/lib/api/services/helpers/files/dxf/dxf-colors.js +45 -0
  50. package/lib/api/services/helpers/files/dxf/dxf-entities.d.ts +17 -0
  51. package/lib/api/services/helpers/files/dxf/dxf-entities.js +193 -0
  52. package/lib/api/services/helpers/files/dxf/dxf-file-text.d.ts +1 -0
  53. package/lib/api/services/helpers/files/dxf/dxf-file-text.js +50 -0
  54. package/lib/api/services/helpers/files/dxf/dxf-generator.d.ts +2 -36
  55. package/lib/api/services/helpers/files/dxf/dxf-generator.js +81 -523
  56. package/lib/api/services/helpers/files/dxf/dxf-reader-dtos.d.ts +6 -0
  57. package/lib/api/services/helpers/files/dxf/dxf-reader-dtos.js +81 -0
  58. package/lib/api/services/helpers/files/dxf/dxf-reader-geometry.d.ts +21 -0
  59. package/lib/api/services/helpers/files/dxf/dxf-reader-geometry.js +67 -0
  60. package/lib/api/services/helpers/files/dxf/dxf-reader-types.d.ts +69 -0
  61. package/lib/api/services/helpers/files/dxf/dxf-reader-types.js +1 -0
  62. package/lib/api/services/helpers/files/dxf/dxf-reader.constants.d.ts +71 -0
  63. package/lib/api/services/helpers/files/dxf/dxf-reader.constants.js +78 -0
  64. package/lib/api/services/helpers/files/dxf/dxf-reader.d.ts +2 -0
  65. package/lib/api/services/helpers/files/dxf/dxf-reader.js +556 -0
  66. package/lib/api/services/helpers/files/dxf/dxf-tables.d.ts +27 -0
  67. package/lib/api/services/helpers/files/dxf/dxf-tables.js +247 -0
  68. package/lib/api/services/helpers/files/dxf/dxf-text.d.ts +26 -0
  69. package/lib/api/services/helpers/files/dxf/dxf-text.js +97 -0
  70. package/lib/api/services/helpers/files/dxf/dxf-tokens.d.ts +9 -0
  71. package/lib/api/services/helpers/files/dxf/dxf-tokens.js +65 -0
  72. package/lib/api/services/helpers/files/dxf/dxf.constants.d.ts +32 -1
  73. package/lib/api/services/helpers/files/dxf/dxf.constants.js +34 -1
  74. package/lib/api/services/helpers/files/file-bytes.d.ts +1 -0
  75. package/lib/api/services/helpers/files/file-bytes.js +15 -0
  76. package/lib/api/services/helpers/files/ground-axes.d.ts +2 -0
  77. package/lib/api/services/helpers/files/ground-axes.js +4 -0
  78. package/lib/api/services/helpers/files/mesh-file-axes.d.ts +7 -0
  79. package/lib/api/services/helpers/files/mesh-file-axes.js +17 -0
  80. package/lib/api/services/helpers/files/stl-axes.d.ts +4 -0
  81. package/lib/api/services/helpers/files/stl-axes.js +22 -0
  82. package/lib/api/services/helpers/files/stl-types.d.ts +7 -0
  83. package/lib/api/services/helpers/files/stl-types.js +1 -0
  84. package/lib/api/services/helpers/files/stl.constants.d.ts +11 -0
  85. package/lib/api/services/helpers/files/stl.constants.js +11 -0
  86. package/lib/api/services/helpers/files/stl.d.ts +3 -0
  87. package/lib/api/services/helpers/files/stl.js +93 -0
  88. package/lib/api/services/helpers/files/svg/svg-css.d.ts +48 -0
  89. package/lib/api/services/helpers/files/svg/svg-css.js +444 -0
  90. package/lib/api/services/helpers/files/svg/svg-dash-patterns.d.ts +2 -0
  91. package/lib/api/services/helpers/files/svg/svg-dash-patterns.js +35 -0
  92. package/lib/api/services/helpers/files/svg/svg-document.d.ts +26 -0
  93. package/lib/api/services/helpers/files/svg/svg-document.js +89 -0
  94. package/lib/api/services/helpers/files/svg/svg-memo.d.ts +1 -0
  95. package/lib/api/services/helpers/files/svg/svg-memo.js +8 -0
  96. package/lib/api/services/helpers/files/svg/svg-normalizer.d.ts +6 -0
  97. package/lib/api/services/helpers/files/svg/svg-normalizer.js +433 -0
  98. package/lib/api/services/helpers/files/svg/svg-numbers.d.ts +15 -0
  99. package/lib/api/services/helpers/files/svg/svg-numbers.js +61 -0
  100. package/lib/api/services/helpers/files/svg/svg-path-data.constants.d.ts +8 -0
  101. package/lib/api/services/helpers/files/svg/svg-path-data.constants.js +10 -0
  102. package/lib/api/services/helpers/files/svg/svg-path-data.d.ts +9 -0
  103. package/lib/api/services/helpers/files/svg/svg-path-data.js +203 -0
  104. package/lib/api/services/helpers/files/svg/svg-path-types.d.ts +33 -0
  105. package/lib/api/services/helpers/files/svg/svg-path-types.js +1 -0
  106. package/lib/api/services/helpers/files/svg/svg-reader.constants.d.ts +35 -0
  107. package/lib/api/services/helpers/files/svg/svg-reader.constants.js +35 -0
  108. package/lib/api/services/helpers/files/svg/svg-reading.constants.d.ts +9 -0
  109. package/lib/api/services/helpers/files/svg/svg-reading.constants.js +9 -0
  110. package/lib/api/services/helpers/files/svg/svg-reading.d.ts +6 -0
  111. package/lib/api/services/helpers/files/svg/svg-reading.js +233 -0
  112. package/lib/api/services/helpers/files/svg/svg-scene-types.d.ts +54 -0
  113. package/lib/api/services/helpers/files/svg/svg-scene-types.js +1 -0
  114. package/lib/api/services/helpers/files/svg/svg-shapes.d.ts +6 -0
  115. package/lib/api/services/helpers/files/svg/svg-shapes.js +102 -0
  116. package/lib/api/services/helpers/files/svg/svg-strokes.d.ts +38 -0
  117. package/lib/api/services/helpers/files/svg/svg-strokes.js +108 -0
  118. package/lib/api/services/helpers/files/svg/svg-style.d.ts +26 -0
  119. package/lib/api/services/helpers/files/svg/svg-style.js +211 -0
  120. package/lib/api/services/helpers/files/svg/svg-transform.d.ts +10 -0
  121. package/lib/api/services/helpers/files/svg/svg-transform.js +76 -0
  122. package/lib/api/services/helpers/files/svg/svg-writer.d.ts +16 -0
  123. package/lib/api/services/helpers/files/svg/svg-writer.js +153 -0
  124. package/lib/api/services/helpers/files/svg/svg-xml.d.ts +11 -0
  125. package/lib/api/services/helpers/files/svg/svg-xml.js +322 -0
  126. package/lib/api/services/helpers/files/svg/svg.constants.d.ts +13 -0
  127. package/lib/api/services/helpers/files/svg/svg.constants.js +13 -0
  128. package/lib/api/services/helpers/files/work-budget.d.ts +11 -0
  129. package/lib/api/services/helpers/files/work-budget.js +26 -0
  130. package/lib/api/services/helpers/geometry/affine2.d.ts +8 -0
  131. package/lib/api/services/helpers/geometry/affine2.js +18 -0
  132. package/lib/api/services/helpers/geometry/ellipse-arcs.d.ts +14 -0
  133. package/lib/api/services/helpers/geometry/ellipse-arcs.js +96 -0
  134. package/lib/api/services/helpers/geometry/frame-axes.d.ts +3 -1
  135. package/lib/api/services/helpers/geometry/polygon-nesting.constants.d.ts +6 -0
  136. package/lib/api/services/helpers/geometry/polygon-nesting.constants.js +6 -0
  137. package/lib/api/services/helpers/geometry/polygon-nesting.d.ts +31 -0
  138. package/lib/api/services/helpers/geometry/polygon-nesting.js +251 -0
  139. package/lib/api/services/helpers/geometry/vectors.d.ts +1 -0
  140. package/lib/api/services/helpers/geometry/vectors.js +6 -0
  141. package/lib/api/services/io/drawing.d.ts +170 -0
  142. package/lib/api/services/io/drawing.js +212 -0
  143. package/lib/api/services/io/dxf.d.ts +134 -0
  144. package/lib/api/services/io/dxf.js +167 -0
  145. package/lib/api/services/io/index.d.ts +4 -0
  146. package/lib/api/services/io/index.js +4 -0
  147. package/lib/api/services/io/io.d.ts +14 -0
  148. package/lib/api/services/io/io.js +15 -0
  149. package/lib/api/services/io/svg.d.ts +64 -0
  150. package/lib/api/services/io/svg.js +102 -0
  151. package/lib/api/services/line.d.ts +17 -0
  152. package/lib/api/services/line.js +20 -1
  153. package/lib/api/services/point.d.ts +4 -1
  154. package/lib/api/services/point.js +9 -4
  155. package/lib/api/services/recipes.d.ts +3 -0
  156. package/lib/api/services/recipes.js +4 -1
  157. package/lib/api/services/text.d.ts +4 -1
  158. package/lib/api/services/text.js +8 -3
  159. package/package.json +1 -1
  160. package/lib/api/services/helpers/files/dxf/dxf.d.ts +0 -87
  161. package/lib/api/services/helpers/files/dxf/dxf.js +0 -111
  162. package/lib/api/services/io.d.ts +0 -9
  163. package/lib/api/services/io.js +0 -10
@@ -6,9 +6,22 @@
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
+ * A straight line in a drawing path, from `start` to `end`. Points may carry a Z coordinate; one
22
+ * without it lies at Z 0.
23
+ */
24
+ class DrawingLineSegmentDto {
12
25
  constructor(start, end) {
13
26
  if (start !== undefined) {
14
27
  this.start = start;
@@ -18,12 +31,13 @@ export var IO;
18
31
  }
19
32
  }
20
33
  }
21
- IO.DxfLineSegmentDto = DxfLineSegmentDto;
34
+ IO.DrawingLineSegmentDto = DrawingLineSegmentDto;
22
35
  /**
23
- * Arc segment defined by center, radius, and start/end angles in degrees
36
+ * A circular arc in a drawing path, running counterclockwise from `startAngle` to `endAngle`
37
+ * about its `center`, in the XY plane unless a `normal` tilts it.
24
38
  */
25
- class DxfArcSegmentDto {
26
- constructor(center, radius, startAngle, endAngle) {
39
+ class DrawingArcSegmentDto {
40
+ constructor(center, radius, startAngle, endAngle, normal) {
27
41
  if (center !== undefined) {
28
42
  this.center = center;
29
43
  }
@@ -36,31 +50,38 @@ export var IO;
36
50
  if (endAngle !== undefined) {
37
51
  this.endAngle = endAngle;
38
52
  }
53
+ if (normal !== undefined) {
54
+ this.normal = normal;
55
+ }
39
56
  }
40
57
  }
41
- IO.DxfArcSegmentDto = DxfArcSegmentDto;
58
+ IO.DrawingArcSegmentDto = DrawingArcSegmentDto;
42
59
  /**
43
- * A full circle in a DXF path, given by its center and radius.
60
+ * A full circle in a drawing path, given by its center and radius, in the XY plane unless a
61
+ * `normal` tilts it.
44
62
  */
45
- class DxfCircleSegmentDto {
46
- constructor(center, radius) {
63
+ class DrawingCircleSegmentDto {
64
+ constructor(center, radius, normal) {
47
65
  if (center !== undefined) {
48
66
  this.center = center;
49
67
  }
50
68
  if (radius !== undefined) {
51
69
  this.radius = radius;
52
70
  }
71
+ if (normal !== undefined) {
72
+ this.normal = normal;
73
+ }
53
74
  }
54
75
  }
55
- IO.DxfCircleSegmentDto = DxfCircleSegmentDto;
76
+ IO.DrawingCircleSegmentDto = DrawingCircleSegmentDto;
56
77
  /**
57
- * Polyline segment defined by multiple points
58
- * Can include bulge values to create arc segments between vertices
78
+ * Connected straight segments through `points`, each of which a bulge can bend into an arc. A
79
+ * polyline whose points do not all share one Z is written as a 3D polyline, which takes no bulges.
59
80
  */
60
- class DxfPolylineSegmentDto {
81
+ class DrawingPolylineSegmentDto {
61
82
  constructor(points, closed, bulges) {
62
83
  /**
63
- * Whether the polyline is closed
84
+ * Whether a segment joins the last vertex back to the first.
64
85
  * @default false
65
86
  */
66
87
  this.closed = false;
@@ -75,19 +96,24 @@ export var IO;
75
96
  }
76
97
  }
77
98
  }
78
- IO.DxfPolylineSegmentDto = DxfPolylineSegmentDto;
99
+ IO.DrawingPolylineSegmentDto = DrawingPolylineSegmentDto;
79
100
  /**
80
- * Spline/B-spline segment defined by control points and degree
101
+ * A B-spline or NURBS curve in a drawing path, given by its control points, degree and
102
+ * optionally its knots and weights. Without knots the curve starts and ends at its end points.
81
103
  */
82
- class DxfSplineSegmentDto {
83
- constructor(controlPoints, degree, closed) {
104
+ class DrawingSplineSegmentDto {
105
+ constructor(controlPoints, degree, closed, knots, weights) {
84
106
  /**
85
- * Degree of the spline (typically 2 or 3)
107
+ * The degree of the curve: 1 draws the control polygon, 2 and 3 smooth curves.
86
108
  * @default 3
109
+ * @minimum 1
110
+ * @maximum Infinity
111
+ * @step 1
87
112
  */
88
113
  this.degree = 3;
89
114
  /**
90
- * Whether the spline is closed
115
+ * Without `knots`, whether the curve wraps around its control points into a smooth closed
116
+ * loop. With `knots`, the knots decide, and this is ignored.
91
117
  * @default false
92
118
  */
93
119
  this.closed = false;
@@ -100,36 +126,92 @@ export var IO;
100
126
  if (closed !== undefined) {
101
127
  this.closed = closed;
102
128
  }
129
+ if (knots !== undefined) {
130
+ this.knots = knots;
131
+ }
132
+ if (weights !== undefined) {
133
+ this.weights = weights;
134
+ }
103
135
  }
104
136
  }
105
- IO.DxfSplineSegmentDto = DxfSplineSegmentDto;
137
+ IO.DrawingSplineSegmentDto = DrawingSplineSegmentDto;
106
138
  /**
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
139
+ * An ellipse or an arc of one in a drawing path: its center, the vector to the end of its major
140
+ * axis and the minor to major ratio, in the XY plane unless `normal` tilts it.
109
141
  */
110
- class DxfPathDto {
142
+ class DrawingEllipseSegmentDto {
143
+ constructor(center, majorAxis, ratio, startParameter, endParameter, normal) {
144
+ /**
145
+ * Where the arc starts, as the ellipse's parameter t in radians (the point center +
146
+ * cos(t) `majorAxis` + sin(t) minor axis), the angle only when `ratio` is 1.
147
+ * @default 0
148
+ * @minimum -Infinity
149
+ * @maximum Infinity
150
+ */
151
+ this.startParameter = 0;
152
+ /**
153
+ * Where the arc ends, as the same parameter in radians; the arc runs counterclockwise from the
154
+ * start, through 0 when the end is below the start.
155
+ * @default 6.283185307179586
156
+ * @minimum -Infinity
157
+ * @maximum Infinity
158
+ */
159
+ this.endParameter = 6.283185307179586;
160
+ if (center !== undefined) {
161
+ this.center = center;
162
+ }
163
+ if (majorAxis !== undefined) {
164
+ this.majorAxis = majorAxis;
165
+ }
166
+ if (ratio !== undefined) {
167
+ this.ratio = ratio;
168
+ }
169
+ if (startParameter !== undefined) {
170
+ this.startParameter = startParameter;
171
+ }
172
+ if (endParameter !== undefined) {
173
+ this.endParameter = endParameter;
174
+ }
175
+ if (normal !== undefined) {
176
+ this.normal = normal;
177
+ }
178
+ }
179
+ }
180
+ IO.DrawingEllipseSegmentDto = DrawingEllipseSegmentDto;
181
+ /**
182
+ * A path of a drawing: segments of any kind (lines, arcs, circles, polylines, splines and
183
+ * ellipses), in the order they are drawn, like the edges of a wire.
184
+ */
185
+ class DrawingPathDto {
111
186
  constructor(segments) {
112
187
  if (segments !== undefined) {
113
188
  this.segments = segments;
114
189
  }
115
190
  }
116
191
  }
117
- IO.DxfPathDto = DxfPathDto;
192
+ IO.DrawingPathDto = DrawingPathDto;
118
193
  /**
119
- * A part containing multiple paths on the same layer with the same color
194
+ * A part of a drawing: paths drawn on one layer with one color and one line type, which
195
+ * `io.dxf.dxfCreate` writes as DXF and `io.svg.svgCreate` as SVG.
120
196
  */
121
- class DxfPathsPartDto {
122
- constructor(layer, color, paths) {
197
+ class DrawingPartDto {
198
+ constructor(layer, color, paths, lineType) {
123
199
  /**
124
- * Layer name for all paths in this part
200
+ * The layer the paths go on. Parts may share a layer, which takes the first part's color and
201
+ * line type; every part's paths keep their own.
125
202
  * @default Default
126
203
  */
127
204
  this.layer = "Default";
128
205
  /**
129
- * Color for all paths in this part, as a hex string such as `#000000`
206
+ * The color of every path in the part, as a hex string such as `#000000`.
130
207
  * @default #000000
131
208
  */
132
209
  this.color = "#000000";
210
+ /**
211
+ * Whether the lines are whole or dashed, such as `hidden` for edges a view cannot see.
212
+ * @default continuous
213
+ */
214
+ this.lineType = lineTypeEnum.continuous;
133
215
  if (layer !== undefined) {
134
216
  this.layer = layer;
135
217
  }
@@ -139,27 +221,110 @@ export var IO;
139
221
  if (paths !== undefined) {
140
222
  this.paths = paths;
141
223
  }
224
+ if (lineType !== undefined) {
225
+ this.lineType = lineType;
226
+ }
142
227
  }
143
228
  }
229
+ IO.DrawingPartDto = DrawingPartDto;
230
+ /**
231
+ * A straight line in a drawing path, under its former DXF name.
232
+ *
233
+ * @deprecated Use `DrawingLineSegmentDto`, the same DTO under the drawing's own name; this one is removed
234
+ * in the next major version.
235
+ */
236
+ class DxfLineSegmentDto extends DrawingLineSegmentDto {
237
+ }
238
+ IO.DxfLineSegmentDto = DxfLineSegmentDto;
239
+ /**
240
+ * A circular arc in a drawing path, under its former DXF name.
241
+ *
242
+ * @deprecated Use `DrawingArcSegmentDto`, the same DTO under the drawing's own name; this one is removed
243
+ * in the next major version.
244
+ */
245
+ class DxfArcSegmentDto extends DrawingArcSegmentDto {
246
+ }
247
+ IO.DxfArcSegmentDto = DxfArcSegmentDto;
248
+ /**
249
+ * A full circle in a drawing path, under its former DXF name.
250
+ *
251
+ * @deprecated Use `DrawingCircleSegmentDto`, the same DTO under the drawing's own name; this one is removed
252
+ * in the next major version.
253
+ */
254
+ class DxfCircleSegmentDto extends DrawingCircleSegmentDto {
255
+ }
256
+ IO.DxfCircleSegmentDto = DxfCircleSegmentDto;
257
+ /**
258
+ * Connected straight segments in a drawing path, under its former DXF name.
259
+ *
260
+ * @deprecated Use `DrawingPolylineSegmentDto`, the same DTO under the drawing's own name; this one is removed
261
+ * in the next major version.
262
+ */
263
+ class DxfPolylineSegmentDto extends DrawingPolylineSegmentDto {
264
+ }
265
+ IO.DxfPolylineSegmentDto = DxfPolylineSegmentDto;
266
+ /**
267
+ * A B-spline or NURBS curve in a drawing path, under its former DXF name.
268
+ *
269
+ * @deprecated Use `DrawingSplineSegmentDto`, the same DTO under the drawing's own name; this one is removed
270
+ * in the next major version.
271
+ */
272
+ class DxfSplineSegmentDto extends DrawingSplineSegmentDto {
273
+ }
274
+ IO.DxfSplineSegmentDto = DxfSplineSegmentDto;
275
+ /**
276
+ * An ellipse or an arc of one in a drawing path, under its former DXF name.
277
+ *
278
+ * @deprecated Use `DrawingEllipseSegmentDto`, the same DTO under the drawing's own name; this one is removed
279
+ * in the next major version.
280
+ */
281
+ class DxfEllipseSegmentDto extends DrawingEllipseSegmentDto {
282
+ }
283
+ IO.DxfEllipseSegmentDto = DxfEllipseSegmentDto;
284
+ /**
285
+ * A path of a drawing, under its former DXF name.
286
+ *
287
+ * @deprecated Use `DrawingPathDto`, the same DTO under the drawing's own name; this one is removed
288
+ * in the next major version.
289
+ */
290
+ class DxfPathDto extends DrawingPathDto {
291
+ }
292
+ IO.DxfPathDto = DxfPathDto;
293
+ /**
294
+ * A part of a drawing: paths on one layer with one color and one line type, under its former DXF name.
295
+ *
296
+ * @deprecated Use `DrawingPartDto`, the same DTO under the drawing's own name; this one is removed
297
+ * in the next major version.
298
+ */
299
+ class DxfPathsPartDto extends DrawingPartDto {
300
+ }
144
301
  IO.DxfPathsPartDto = DxfPathsPartDto;
145
302
  /**
146
- * A whole DXF drawing: its path parts by layer and color, and the color and version format to
147
- * write.
303
+ * A whole DXF drawing for `io.dxf.dxfCreate`: its path parts by layer and color, and the color
304
+ * format, the version and the unit to write.
148
305
  */
149
306
  class DxfModelDto {
150
- constructor(dxfPathsParts, colorFormat, acadVersion, unit) {
307
+ constructor(dxfPathsParts, colorFormat, acadVersion, unit, curveTolerance) {
151
308
  /**
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.
309
+ * How colors are written: `aci`, the nearest of AutoCAD's 255 index colors, or `truecolor`,
310
+ * the exact color beside that index (`AC1015` only; `AC1009` writes the index).
154
311
  * @default aci
155
312
  */
156
313
  this.colorFormat = "aci";
157
314
  /**
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
315
+ * The DXF version: `AC1015` (AutoCAD 2000), which keeps splines and ellipses exact, or `AC1009`
316
+ * (AutoCAD R12) for old software, where they become polylines within `curveTolerance`.
317
+ * @default AC1015
161
318
  */
162
- this.acadVersion = "AC1009";
319
+ this.acadVersion = "AC1015";
320
+ /**
321
+ * The largest distance, in drawing units, between a curve and the polyline that stands in for
322
+ * it where the version cannot hold the curve exactly.
323
+ * @default 0.01
324
+ * @minimum 0
325
+ * @exclusiveMinimum true
326
+ */
327
+ this.curveTolerance = 0.01;
163
328
  if (dxfPathsParts !== undefined) {
164
329
  this.dxfPathsParts = dxfPathsParts;
165
330
  }
@@ -172,7 +337,234 @@ export var IO;
172
337
  if (unit !== undefined) {
173
338
  this.unit = unit;
174
339
  }
340
+ if (curveTolerance !== undefined) {
341
+ this.curveTolerance = curveTolerance;
342
+ }
175
343
  }
176
344
  }
177
345
  IO.DxfModelDto = DxfModelDto;
346
+ /**
347
+ * The text of a DXF file for `io.dxf.dxfRead`, which reads its drawing into path parts, and
348
+ * whether layers that are switched off or frozen are read too.
349
+ */
350
+ class DxfReadDto {
351
+ constructor(dxf, includeHiddenLayers) {
352
+ /**
353
+ * When true, layers the file has switched off or frozen are read as well.
354
+ * @default false
355
+ */
356
+ this.includeHiddenLayers = false;
357
+ if (dxf !== undefined) {
358
+ this.dxf = dxf;
359
+ }
360
+ if (includeHiddenLayers !== undefined) {
361
+ this.includeHiddenLayers = includeHiddenLayers;
362
+ }
363
+ }
364
+ }
365
+ IO.DxfReadDto = DxfReadDto;
366
+ /**
367
+ * A drawing read from a DXF file by `io.dxf.dxfRead`: its parts by layer, color and line type, in
368
+ * the shape `io.dxf.dxfCreate` and `io.svg.svgCreate` write, with the unit and what was left out.
369
+ */
370
+ class DxfDrawingDto {
371
+ }
372
+ IO.DxfDrawingDto = DxfDrawingDto;
373
+ /**
374
+ * A whole SVG drawing for `io.svg.svgCreate`: its path parts by layer, color and line type, the
375
+ * unit that gives it its true size, and how wide the lines and the border are.
376
+ */
377
+ class SvgModelDto {
378
+ constructor(parts, unit, strokeWidth, margin, tolerance) {
379
+ /**
380
+ * The largest distance, in drawing units, between a curve SVG cannot draw exactly (a rational
381
+ * or higher degree spline) and the cubic curves that stand in for it.
382
+ * @default 0.01
383
+ * @minimum 0
384
+ * @exclusiveMinimum true
385
+ */
386
+ this.tolerance = 0.01;
387
+ if (parts !== undefined) {
388
+ this.parts = parts;
389
+ }
390
+ if (unit !== undefined) {
391
+ this.unit = unit;
392
+ }
393
+ if (strokeWidth !== undefined) {
394
+ this.strokeWidth = strokeWidth;
395
+ }
396
+ if (margin !== undefined) {
397
+ this.margin = margin;
398
+ }
399
+ if (tolerance !== undefined) {
400
+ this.tolerance = tolerance;
401
+ }
402
+ }
403
+ }
404
+ IO.SvgModelDto = SvgModelDto;
405
+ /**
406
+ * One drawing path for `io.svg.pathData`, and how its coordinates are written.
407
+ */
408
+ class SvgPathDataDto {
409
+ constructor(path, flipY, tolerance) {
410
+ /**
411
+ * Whether Y is negated, as an SVG file needs (its Y runs down); leave it off for data drawn
412
+ * inside a group that flips Y itself.
413
+ * @default true
414
+ */
415
+ this.flipY = true;
416
+ /**
417
+ * The largest distance, in drawing units, between a curve SVG cannot draw exactly and the
418
+ * cubic curves that stand in for it.
419
+ * @default 0.01
420
+ * @minimum 0
421
+ * @exclusiveMinimum true
422
+ */
423
+ this.tolerance = 0.01;
424
+ if (path !== undefined) {
425
+ this.path = path;
426
+ }
427
+ if (flipY !== undefined) {
428
+ this.flipY = flipY;
429
+ }
430
+ if (tolerance !== undefined) {
431
+ this.tolerance = tolerance;
432
+ }
433
+ }
434
+ }
435
+ IO.SvgPathDataDto = SvgPathDataDto;
436
+ /**
437
+ * The text of an SVG file for `io.svg.svgRead`, which reads its drawing into path parts, with the
438
+ * unit that brings it in at true size and whether hidden elements are read too.
439
+ */
440
+ class SvgReadDto {
441
+ constructor(svg, unit, includeInvisible) {
442
+ /**
443
+ * When true, elements hidden by `display` or `visibility` are read as well.
444
+ * @default false
445
+ */
446
+ this.includeInvisible = false;
447
+ if (svg !== undefined) {
448
+ this.svg = svg;
449
+ }
450
+ if (unit !== undefined) {
451
+ this.unit = unit;
452
+ }
453
+ if (includeInvisible !== undefined) {
454
+ this.includeInvisible = includeInvisible;
455
+ }
456
+ }
457
+ }
458
+ IO.SvgReadDto = SvgReadDto;
459
+ /**
460
+ * A drawing read from an SVG file by `io.svg.svgRead`: its parts by layer, color and line type, in
461
+ * the shape `io.dxf.dxfCreate` and `io.svg.svgCreate` write, with the unit, the view box and what
462
+ * was left out.
463
+ */
464
+ class SvgDrawingDto {
465
+ }
466
+ IO.SvgDrawingDto = SvgDrawingDto;
467
+ /**
468
+ * An SVG file for `io.drawing.svgToDxf`, which reads it as `io.svg.svgRead` does and writes it as
469
+ * `io.dxf.dxfCreate` does, with the options of both.
470
+ */
471
+ class SvgToDxfDto {
472
+ constructor(svg, unit, includeInvisible, colorFormat, acadVersion, curveTolerance) {
473
+ /**
474
+ * When true, elements hidden by `display` or `visibility` are written as well.
475
+ * @default false
476
+ */
477
+ this.includeInvisible = false;
478
+ /**
479
+ * How colors are written: `aci`, the nearest of AutoCAD's 255 index colors, or `truecolor`,
480
+ * the exact color beside that index (`AC1015` only; `AC1009` writes the index).
481
+ * @default aci
482
+ */
483
+ this.colorFormat = "aci";
484
+ /**
485
+ * The DXF version: `AC1015` (AutoCAD 2000), which keeps splines and ellipses exact, or `AC1009`
486
+ * (AutoCAD R12) for old software, where they become polylines within `curveTolerance`.
487
+ * @default AC1015
488
+ */
489
+ this.acadVersion = "AC1015";
490
+ /**
491
+ * The largest distance, in drawing units, between a curve and the polyline that stands in for
492
+ * it where the version cannot hold the curve exactly.
493
+ * @default 0.01
494
+ * @minimum 0
495
+ * @exclusiveMinimum true
496
+ */
497
+ this.curveTolerance = 0.01;
498
+ if (svg !== undefined) {
499
+ this.svg = svg;
500
+ }
501
+ if (unit !== undefined) {
502
+ this.unit = unit;
503
+ }
504
+ if (includeInvisible !== undefined) {
505
+ this.includeInvisible = includeInvisible;
506
+ }
507
+ if (colorFormat !== undefined) {
508
+ this.colorFormat = colorFormat;
509
+ }
510
+ if (acadVersion !== undefined) {
511
+ this.acadVersion = acadVersion;
512
+ }
513
+ if (curveTolerance !== undefined) {
514
+ this.curveTolerance = curveTolerance;
515
+ }
516
+ }
517
+ }
518
+ IO.SvgToDxfDto = SvgToDxfDto;
519
+ /**
520
+ * What `io.drawing.svgToDxf` returns: the DXF file it wrote from an SVG file, and what the
521
+ * reading left out or read differently.
522
+ */
523
+ class SvgToDxfResultDto {
524
+ }
525
+ IO.SvgToDxfResultDto = SvgToDxfResultDto;
526
+ /**
527
+ * A DXF file for `io.drawing.dxfToSvg`, which reads it as `io.dxf.dxfRead` does and writes it as
528
+ * `io.svg.svgCreate` does, with the options of both.
529
+ */
530
+ class DxfToSvgDto {
531
+ constructor(dxf, includeHiddenLayers, strokeWidth, margin, tolerance) {
532
+ /**
533
+ * When true, layers the file has switched off or frozen are written as well.
534
+ * @default false
535
+ */
536
+ this.includeHiddenLayers = false;
537
+ /**
538
+ * The largest distance, in drawing units, between a curve SVG cannot draw exactly (a rational
539
+ * or higher degree spline) and the cubic curves that stand in for it.
540
+ * @default 0.01
541
+ * @minimum 0
542
+ * @exclusiveMinimum true
543
+ */
544
+ this.tolerance = 0.01;
545
+ if (dxf !== undefined) {
546
+ this.dxf = dxf;
547
+ }
548
+ if (includeHiddenLayers !== undefined) {
549
+ this.includeHiddenLayers = includeHiddenLayers;
550
+ }
551
+ if (strokeWidth !== undefined) {
552
+ this.strokeWidth = strokeWidth;
553
+ }
554
+ if (margin !== undefined) {
555
+ this.margin = margin;
556
+ }
557
+ if (tolerance !== undefined) {
558
+ this.tolerance = tolerance;
559
+ }
560
+ }
561
+ }
562
+ IO.DxfToSvgDto = DxfToSvgDto;
563
+ /**
564
+ * What `io.drawing.dxfToSvg` returns: the SVG file it wrote from a DXF file, and what the reading
565
+ * left out.
566
+ */
567
+ class DxfToSvgResultDto {
568
+ }
569
+ IO.DxfToSvgResultDto = DxfToSvgResultDto;
178
570
  })(IO || (IO = {}));
@@ -228,6 +228,23 @@ export declare namespace Line {
228
228
  */
229
229
  tolerance?: number | undefined;
230
230
  }
231
+ /**
232
+ * A line and a point for `line.distanceToPoint`, which measures from the point to the nearest
233
+ * point of the line between its start and its end.
234
+ */
235
+ class LinePointDistanceDto {
236
+ constructor(line?: LinePointsDto, point?: Base.Point3);
237
+ /**
238
+ * The line to measure to; nothing past its start or its end counts.
239
+ * @default undefined
240
+ */
241
+ line: LinePointsDto;
242
+ /**
243
+ * The point to measure from.
244
+ * @default undefined
245
+ */
246
+ point: Base.Point3;
247
+ }
231
248
  /**
232
249
  * A line and a fraction along it for `line.getPointOnLine`.
233
250
  */
@@ -242,6 +242,21 @@ export var Line;
242
242
  }
243
243
  }
244
244
  Line.LineLineIntersectionDto = LineLineIntersectionDto;
245
+ /**
246
+ * A line and a point for `line.distanceToPoint`, which measures from the point to the nearest
247
+ * point of the line between its start and its end.
248
+ */
249
+ class LinePointDistanceDto {
250
+ constructor(line, point) {
251
+ if (line !== undefined) {
252
+ this.line = line;
253
+ }
254
+ if (point !== undefined) {
255
+ this.point = point;
256
+ }
257
+ }
258
+ }
259
+ Line.LinePointDistanceDto = LinePointDistanceDto;
245
260
  /**
246
261
  * A line and a fraction along it for `line.getPointOnLine`.
247
262
  */
@@ -11,3 +11,4 @@ export * from "./with-defaults";
11
11
  export * from "./hashing";
12
12
  export * from "./unknown-values";
13
13
  export * from "./kernel-steps";
14
+ export * from "./settings";
@@ -11,3 +11,4 @@ export * from "./with-defaults";
11
11
  export * from "./hashing";
12
12
  export * from "./unknown-values";
13
13
  export * from "./kernel-steps";
14
+ export * from "./settings";