@bitbybit-dev/base 1.3.2 → 1.4.0-rc.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 (77) hide show
  1. package/README.md +1 -1
  2. package/lib/api/GlobalCDNProvider.js +1 -1
  3. package/lib/api/index.d.ts +2 -0
  4. package/lib/api/index.js +2 -0
  5. package/lib/api/inputs/base-inputs.d.ts +10 -4
  6. package/lib/api/inputs/color-inputs.d.ts +24 -23
  7. package/lib/api/inputs/color-inputs.js +1 -0
  8. package/lib/api/inputs/dates-inputs.d.ts +16 -16
  9. package/lib/api/inputs/frame-inputs.d.ts +515 -0
  10. package/lib/api/inputs/frame-inputs.js +617 -0
  11. package/lib/api/inputs/index.d.ts +1 -0
  12. package/lib/api/inputs/index.js +1 -0
  13. package/lib/api/inputs/io-inputs.d.ts +3 -3
  14. package/lib/api/inputs/io-inputs.js +1 -1
  15. package/lib/api/inputs/lists-inputs.d.ts +23 -23
  16. package/lib/api/inputs/logic-inputs.d.ts +11 -11
  17. package/lib/api/inputs/math-inputs.d.ts +49 -49
  18. package/lib/api/inputs/math-inputs.js +4 -4
  19. package/lib/api/inputs/mesh-inputs.d.ts +3 -3
  20. package/lib/api/inputs/mesh-inputs.js +3 -3
  21. package/lib/api/inputs/point-inputs.d.ts +39 -38
  22. package/lib/api/inputs/point-inputs.js +6 -5
  23. package/lib/api/inputs/polyline-inputs.d.ts +5 -4
  24. package/lib/api/inputs/polyline-inputs.js +3 -3
  25. package/lib/api/inputs/text-inputs.d.ts +34 -33
  26. package/lib/api/inputs/text-inputs.js +15 -12
  27. package/lib/api/inputs/transforms-inputs.d.ts +16 -16
  28. package/lib/api/inputs/vector-inputs.d.ts +26 -25
  29. package/lib/api/inputs/vector-inputs.js +2 -1
  30. package/lib/api/kernel-calls/call-by-path.d.ts +12 -0
  31. package/lib/api/kernel-calls/call-by-path.js +36 -0
  32. package/lib/api/kernel-calls/constraints.d.ts +53 -0
  33. package/lib/api/kernel-calls/constraints.js +21 -0
  34. package/lib/api/kernel-calls/describe-failure.d.ts +32 -0
  35. package/lib/api/kernel-calls/describe-failure.js +164 -0
  36. package/lib/api/kernel-calls/errors.d.ts +55 -0
  37. package/lib/api/kernel-calls/errors.js +42 -0
  38. package/lib/api/kernel-calls/failure-message.d.ts +18 -0
  39. package/lib/api/kernel-calls/failure-message.js +36 -0
  40. package/lib/api/kernel-calls/index.d.ts +10 -0
  41. package/lib/api/kernel-calls/index.js +10 -0
  42. package/lib/api/kernel-calls/input-rules.d.ts +67 -0
  43. package/lib/api/kernel-calls/input-rules.js +135 -0
  44. package/lib/api/kernel-calls/input-validation.d.ts +130 -0
  45. package/lib/api/kernel-calls/input-validation.js +221 -0
  46. package/lib/api/kernel-calls/rehydrate.d.ts +16 -0
  47. package/lib/api/kernel-calls/rehydrate.js +38 -0
  48. package/lib/api/kernel-calls/resolve-dto.d.ts +59 -0
  49. package/lib/api/kernel-calls/resolve-dto.js +61 -0
  50. package/lib/api/kernel-calls/with-defaults.d.ts +16 -0
  51. package/lib/api/kernel-calls/with-defaults.js +53 -0
  52. package/lib/api/resolved-inputs/index.d.ts +304 -0
  53. package/lib/api/resolved-inputs/index.js +1 -0
  54. package/lib/api/services/color.js +43 -26
  55. package/lib/api/services/dates.js +53 -33
  56. package/lib/api/services/frame.d.ts +670 -0
  57. package/lib/api/services/frame.js +1040 -0
  58. package/lib/api/services/helpers/dxf/dxf-generator.d.ts +2 -3
  59. package/lib/api/services/helpers/dxf/dxf-generator.js +27 -37
  60. package/lib/api/services/helpers/dxf/dxf.js +10 -4
  61. package/lib/api/services/helpers/frame-axes.d.ts +36 -0
  62. package/lib/api/services/helpers/frame-axes.js +57 -0
  63. package/lib/api/services/helpers/matrices.d.ts +17 -0
  64. package/lib/api/services/helpers/matrices.js +51 -0
  65. package/lib/api/services/index.d.ts +1 -0
  66. package/lib/api/services/index.js +1 -0
  67. package/lib/api/services/line.js +15 -12
  68. package/lib/api/services/lists.js +174 -136
  69. package/lib/api/services/logic.js +44 -34
  70. package/lib/api/services/math.js +127 -82
  71. package/lib/api/services/mesh.js +20 -13
  72. package/lib/api/services/point.js +62 -46
  73. package/lib/api/services/polyline.js +22 -18
  74. package/lib/api/services/text.js +81 -46
  75. package/lib/api/services/transforms.js +38 -25
  76. package/lib/api/services/vector.js +37 -22
  77. package/package.json +1 -1
@@ -1,3 +1,5 @@
1
+ import * as Inputs from "../inputs";
2
+ import { resolveDto } from "../kernel-calls";
1
3
  /**
2
4
  * Points as plain number arrays. A point is `[x, y, z]` with Y pointing up, the same shape as a
3
5
  * vector, so the two can be passed to each other's methods; a 2D point is `[x, y]`. Every method
@@ -141,8 +143,9 @@ export class Point {
141
143
  * ```
142
144
  */
143
145
  translateXYZPoints(inputs) {
144
- const translationTransform = this.transforms.translationXYZ({ translation: [inputs.x, inputs.y, inputs.z] });
145
- return this.geometryHelper.transformControlPoints(translationTransform, inputs.points);
146
+ const resolved = resolveDto(Inputs.Point.TranslateXYZPointsDto, inputs);
147
+ const translationTransform = this.transforms.translationXYZ({ translation: [resolved.x, resolved.y, resolved.z] });
148
+ return this.geometryHelper.transformControlPoints(translationTransform, resolved.points);
146
149
  }
147
150
  /**
148
151
  * Scales points away from or toward a center, with its own factor per axis.
@@ -163,8 +166,9 @@ export class Point {
163
166
  * ```
164
167
  */
165
168
  scalePointsCenterXYZ(inputs) {
166
- const scaleTransforms = this.transforms.scaleCenterXYZ({ center: inputs.center, scaleXyz: inputs.scaleXyz });
167
- return this.geometryHelper.transformControlPoints(scaleTransforms, inputs.points);
169
+ const resolved = resolveDto(Inputs.Point.ScalePointsCenterXYZDto, inputs);
170
+ const scaleTransforms = this.transforms.scaleCenterXYZ({ center: resolved.center, scaleXyz: resolved.scaleXyz });
171
+ return this.geometryHelper.transformControlPoints(scaleTransforms, resolved.points);
168
172
  }
169
173
  /**
170
174
  * Stretches points along one direction, measured from a center; distances across that direction
@@ -187,8 +191,9 @@ export class Point {
187
191
  * ```
188
192
  */
189
193
  stretchPointsDirFromCenter(inputs) {
190
- const stretchTransforms = this.transforms.stretchDirFromCenter({ center: inputs.center, scale: inputs.scale, direction: inputs.direction });
191
- return this.geometryHelper.transformControlPoints(stretchTransforms, inputs.points);
194
+ const resolved = resolveDto(Inputs.Point.StretchPointsDirFromCenterDto, inputs);
195
+ const stretchTransforms = this.transforms.stretchDirFromCenter({ center: resolved.center, scale: resolved.scale, direction: resolved.direction });
196
+ return this.geometryHelper.transformControlPoints(stretchTransforms, resolved.points);
192
197
  }
193
198
  /**
194
199
  * Rotates points around an axis that passes through a center.
@@ -211,8 +216,9 @@ export class Point {
211
216
  * ```
212
217
  */
213
218
  rotatePointsCenterAxis(inputs) {
214
- const rotationTransforms = this.transforms.rotationCenterAxis({ center: inputs.center, axis: inputs.axis, angle: inputs.angle });
215
- return this.geometryHelper.transformControlPoints(rotationTransforms, inputs.points);
219
+ const resolved = resolveDto(Inputs.Point.RotatePointsCenterAxisDto, inputs);
220
+ const rotationTransforms = this.transforms.rotationCenterAxis({ center: resolved.center, axis: resolved.axis, angle: resolved.angle });
221
+ return this.geometryHelper.transformControlPoints(rotationTransforms, resolved.points);
216
222
  }
217
223
  /**
218
224
  * Finds the smallest axis-aligned box that holds all the points.
@@ -452,7 +458,8 @@ export class Point {
452
458
  * ```
453
459
  */
454
460
  pointXYZ(inputs) {
455
- return [inputs.x, inputs.y, inputs.z];
461
+ const resolved = resolveDto(Inputs.Point.PointXYZDto, inputs);
462
+ return [resolved.x, resolved.y, resolved.z];
456
463
  }
457
464
  /**
458
465
  * Builds a 2D point from its x and y values.
@@ -469,7 +476,8 @@ export class Point {
469
476
  * ```
470
477
  */
471
478
  pointXY(inputs) {
472
- return [inputs.x, inputs.y];
479
+ const resolved = resolveDto(Inputs.Point.PointXYDto, inputs);
480
+ return [resolved.x, resolved.y];
473
481
  }
474
482
  /**
475
483
  * Lays out points along a logarithmic spiral in the XY plane, from the origin outward to
@@ -488,12 +496,13 @@ export class Point {
488
496
  * ```
489
497
  */
490
498
  spiral(inputs) {
491
- const phi = inputs.phi;
492
- const b = Math.log(phi) / (Math.PI / inputs.widening);
499
+ const resolved = resolveDto(Inputs.Point.SpiralDto, inputs);
500
+ const phi = resolved.phi;
501
+ const b = Math.log(phi) / (Math.PI / resolved.widening);
493
502
  const spiral = [];
494
- const step = inputs.radius / inputs.numberPoints;
495
- for (let i = 0; i < inputs.radius; i += step) {
496
- const th = Math.log(i / inputs.factor) / b;
503
+ const step = resolved.radius / resolved.numberPoints;
504
+ for (let i = 0; i < resolved.radius; i += step) {
505
+ const th = Math.log(i / resolved.factor) / b;
497
506
  const x = i * Math.cos(th);
498
507
  const y = i * Math.sin(th);
499
508
  spiral.push([x ? x : 0, y ? y : 0, 0]);
@@ -517,24 +526,25 @@ export class Point {
517
526
  * ```
518
527
  */
519
528
  hexGrid(inputs) {
520
- const xLength = Math.sqrt(Math.pow(inputs.radiusHexagon, 2) - Math.pow(inputs.radiusHexagon / 2, 2));
529
+ const resolved = resolveDto(Inputs.Point.HexGridCentersDto, inputs);
530
+ const xLength = Math.sqrt(Math.pow(resolved.radiusHexagon, 2) - Math.pow(resolved.radiusHexagon / 2, 2));
521
531
  const points = [];
522
- for (let ix = 0; ix < inputs.nrHexagonsX; ix++) {
532
+ for (let ix = 0; ix < resolved.nrHexagonsX; ix++) {
523
533
  const coordX = ix * xLength * 2;
524
- for (let iy = 0; iy < inputs.nrHexagonsY; iy++) {
525
- const coordY = (inputs.radiusHexagon + inputs.radiusHexagon / 2) * iy;
534
+ for (let iy = 0; iy < resolved.nrHexagonsY; iy++) {
535
+ const coordY = (resolved.radiusHexagon + resolved.radiusHexagon / 2) * iy;
526
536
  const adjustX = coordX + (iy % 2 === 0 ? 0 : xLength);
527
537
  points.push([adjustX, coordY, 0]);
528
538
  }
529
539
  }
530
- if (inputs.orientOnCenter) {
540
+ if (resolved.orientOnCenter) {
531
541
  const compensateX = points[points.length - 1][0] / 2;
532
542
  const compensateY = points[points.length - 1][1] / 2;
533
543
  points.forEach((p, index) => {
534
544
  points[index] = [p[0] - compensateX, p[1] - compensateY, 0];
535
545
  });
536
546
  }
537
- if (inputs.pointsOnGround) {
547
+ if (resolved.pointsOnGround) {
538
548
  points.forEach((p, index) => {
539
549
  points[index] = [p[0], 0, p[1]];
540
550
  });
@@ -566,16 +576,16 @@ export class Point {
566
576
  * ```
567
577
  */
568
578
  hexGridScaledToFit(inputs) {
569
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
570
- let width = (_a = inputs.width) !== null && _a !== void 0 ? _a : 10;
571
- let height = (_b = inputs.height) !== null && _b !== void 0 ? _b : 10;
572
- let nrHexagonsInHeight = (_c = inputs.nrHexagonsInHeight) !== null && _c !== void 0 ? _c : 10;
573
- let nrHexagonsInWidth = (_d = inputs.nrHexagonsInWidth) !== null && _d !== void 0 ? _d : 10;
574
- let extendTop = (_e = inputs.extendTop) !== null && _e !== void 0 ? _e : false;
575
- let extendBottom = (_f = inputs.extendBottom) !== null && _f !== void 0 ? _f : false;
576
- let extendLeft = (_g = inputs.extendLeft) !== null && _g !== void 0 ? _g : false;
577
- let extendRight = (_h = inputs.extendRight) !== null && _h !== void 0 ? _h : false;
578
- const { flatTop = false, centerGrid = false, pointsOnGround = false } = inputs;
579
+ const resolved = resolveDto(Inputs.Point.HexGridScaledToFitDto, inputs);
580
+ let width = resolved.width;
581
+ let height = resolved.height;
582
+ let nrHexagonsInHeight = resolved.nrHexagonsInHeight;
583
+ let nrHexagonsInWidth = resolved.nrHexagonsInWidth;
584
+ let extendTop = resolved.extendTop;
585
+ let extendBottom = resolved.extendBottom;
586
+ let extendLeft = resolved.extendLeft;
587
+ let extendRight = resolved.extendRight;
588
+ const { flatTop, centerGrid, pointsOnGround } = resolved;
579
589
  if (flatTop) {
580
590
  const oldWidth = width;
581
591
  width = height;
@@ -801,7 +811,7 @@ export class Point {
801
811
  if (flatTop) {
802
812
  const grouped = this.lists.groupNth({
803
813
  list: scaledHexagons.reverse(),
804
- nrElements: (_j = inputs.nrHexagonsInWidth) !== null && _j !== void 0 ? _j : 10,
814
+ nrElements: resolved.nrHexagonsInWidth,
805
815
  keepRemainder: true,
806
816
  });
807
817
  const res = this.lists.flipLists({
@@ -811,7 +821,7 @@ export class Point {
811
821
  scaledHexagons = res.flat();
812
822
  const groupedCenters = this.lists.groupNth({
813
823
  list: scaledCenters.reverse(),
814
- nrElements: (_k = inputs.nrHexagonsInWidth) !== null && _k !== void 0 ? _k : 10,
824
+ nrElements: resolved.nrHexagonsInWidth,
815
825
  keepRemainder: true,
816
826
  });
817
827
  const resCenters = this.lists.flipLists({
@@ -846,7 +856,8 @@ export class Point {
846
856
  * ```
847
857
  */
848
858
  maxFilletRadius(inputs) {
849
- const { start: p1, center: p2, end: c, tolerance = 1e-7 } = inputs;
859
+ const resolved = resolveDto(Inputs.Point.ThreePointsToleranceDto, inputs);
860
+ const { start: p1, center: p2, end: c, tolerance } = resolved;
850
861
  const v1 = this.vector.sub({ first: p1, second: c });
851
862
  const v2 = this.vector.sub({ first: p2, second: c });
852
863
  const len1 = this.vector.length({ vector: v1 });
@@ -891,7 +902,8 @@ export class Point {
891
902
  * ```
892
903
  */
893
904
  maxFilletRadiusHalfLine(inputs) {
894
- const { start: p1, center: p2, end: c, tolerance = 1e-7 } = inputs;
905
+ const resolved = resolveDto(Inputs.Point.ThreePointsToleranceDto, inputs);
906
+ const { start: p1, center: p2, end: c, tolerance } = resolved;
895
907
  const v1 = this.vector.sub({ first: p1, second: c });
896
908
  const v2 = this.vector.sub({ first: p2, second: c });
897
909
  const len1 = this.vector.length({ vector: v1 });
@@ -937,7 +949,8 @@ export class Point {
937
949
  * ```
938
950
  */
939
951
  maxFilletsHalfLine(inputs) {
940
- const { points, checkLastWithFirst = false, tolerance = 1e-7 } = inputs;
952
+ const resolved = resolveDto(Inputs.Point.PointsMaxFilletsHalfLineDto, inputs);
953
+ const { points, checkLastWithFirst, tolerance } = resolved;
941
954
  const n = points.length;
942
955
  const results = [];
943
956
  if (n < 3) {
@@ -1000,7 +1013,8 @@ export class Point {
1000
1013
  * ```
1001
1014
  */
1002
1015
  safestPointsMaxFilletHalfLine(inputs) {
1003
- const allMaxRadii = this.maxFilletsHalfLine(inputs);
1016
+ const resolved = resolveDto(Inputs.Point.PointsMaxFilletsHalfLineDto, inputs);
1017
+ const allMaxRadii = this.maxFilletsHalfLine(resolved);
1004
1018
  if (allMaxRadii.length === 0) {
1005
1019
  return 0;
1006
1020
  }
@@ -1028,7 +1042,8 @@ export class Point {
1028
1042
  * ```
1029
1043
  */
1030
1044
  removeConsecutiveDuplicates(inputs) {
1031
- return this.geometryHelper.removeConsecutivePointDuplicates(inputs.points, inputs.checkFirstAndLast, inputs.tolerance);
1045
+ const resolved = resolveDto(Inputs.Point.RemoveConsecutiveDuplicatesDto, inputs);
1046
+ return this.geometryHelper.removeConsecutivePointDuplicates(resolved.points, resolved.checkFirstAndLast, resolved.tolerance);
1032
1047
  }
1033
1048
  /**
1034
1049
  * Finds the direction at right angles to the plane through three points, with length 1.
@@ -1053,9 +1068,10 @@ export class Point {
1053
1068
  * ```
1054
1069
  */
1055
1070
  normalFromThreePoints(inputs) {
1056
- const p1 = inputs.point1;
1057
- const p2 = inputs.point2;
1058
- const p3 = inputs.point3;
1071
+ const resolved = resolveDto(Inputs.Point.ThreePointsNormalDto, inputs);
1072
+ const p1 = resolved.point1;
1073
+ const p2 = resolved.point2;
1074
+ const p3 = resolved.point3;
1059
1075
  if (!p1 || !p2 || !p3 || p1.length !== 3 || p2.length !== 3 || p3.length !== 3) {
1060
1076
  throw new Error("All points must be arrays of 3 numbers [x, y, z]");
1061
1077
  }
@@ -1072,7 +1088,7 @@ export class Point {
1072
1088
  console.warn("Points are collinear or coincident; cannot calculate a unique normal.");
1073
1089
  return undefined;
1074
1090
  }
1075
- if (inputs.reverseNormal) {
1091
+ if (resolved.reverseNormal) {
1076
1092
  nx = -nx;
1077
1093
  ny = -ny;
1078
1094
  nz = -nz;
@@ -1109,11 +1125,11 @@ export class Point {
1109
1125
  * ```
1110
1126
  */
1111
1127
  twoPointsAlmostEqual(inputs) {
1112
- var _a;
1113
- const p1 = inputs.point1;
1114
- const p2 = inputs.point2;
1128
+ const resolved = resolveDto(Inputs.Point.TwoPointsToleranceDto, inputs);
1129
+ const p1 = resolved.point1;
1130
+ const p2 = resolved.point2;
1115
1131
  const dist = this.distance({ startPoint: p1, endPoint: p2 });
1116
- return dist < ((_a = inputs.tolerance) !== null && _a !== void 0 ? _a : 1e-7);
1132
+ return dist < (resolved.tolerance);
1117
1133
  }
1118
1134
  /**
1119
1135
  * Sorts points by X, then by Y for equal X, then by Z.
@@ -1,3 +1,5 @@
1
+ import * as Inputs from "../inputs";
2
+ import { resolveDto } from "../kernel-calls";
1
3
  /**
2
4
  * Polylines: chains of straight segments through a list of points, held as plain objects of the
3
5
  * form `{ points, isClosed }`. A closed polyline joins its last point back to its first. The
@@ -118,10 +120,10 @@ export class Polyline {
118
120
  * ```
119
121
  */
120
122
  create(inputs) {
121
- var _a;
123
+ const resolved = resolveDto(Inputs.Polyline.PolylineCreateDto, inputs);
122
124
  return {
123
- points: inputs.points,
124
- isClosed: (_a = inputs.isClosed) !== null && _a !== void 0 ? _a : false,
125
+ points: resolved.points,
126
+ isClosed: resolved.isClosed,
125
127
  };
126
128
  }
127
129
  /**
@@ -201,14 +203,14 @@ export class Polyline {
201
203
  * ```
202
204
  */
203
205
  polylineSelfIntersection(inputs) {
204
- const { polyline, tolerance } = inputs;
206
+ const resolved = resolveDto(Inputs.Polyline.PolylineToleranceDto, inputs);
207
+ const { polyline, tolerance } = resolved;
205
208
  const lines = this.polylineToLines({ polyline });
206
209
  const numSegments = lines.length;
207
210
  if (numSegments < 3) {
208
211
  return [];
209
212
  }
210
213
  const selfIntersectionPoints = [];
211
- const defaultTolerance = tolerance !== null && tolerance !== void 0 ? tolerance : 1e-6;
212
214
  for (let i = 0; i < numSegments; i++) {
213
215
  for (let j = i + 1; j < numSegments; j++) {
214
216
  let areAdjacent = (j === i + 1);
@@ -222,7 +224,7 @@ export class Polyline {
222
224
  line1: lines[i],
223
225
  line2: lines[j],
224
226
  checkSegmentsOnly: true,
225
- tolerance: defaultTolerance,
227
+ tolerance,
226
228
  });
227
229
  if (intersection) {
228
230
  let foundClose = false;
@@ -230,7 +232,7 @@ export class Polyline {
230
232
  if (this.point.twoPointsAlmostEqual({
231
233
  point1: intersection,
232
234
  point2: existingPoint,
233
- tolerance: defaultTolerance
235
+ tolerance
234
236
  })) {
235
237
  foundClose = true;
236
238
  break;
@@ -265,18 +267,18 @@ export class Polyline {
265
267
  * ```
266
268
  */
267
269
  twoPolylineIntersection(inputs) {
268
- const { polyline1, polyline2, tolerance } = inputs;
270
+ const resolved = resolveDto(Inputs.Polyline.TwoPolylinesToleranceDto, inputs);
271
+ const { polyline1, polyline2, tolerance } = resolved;
269
272
  const lines1 = this.polylineToLines({ polyline: polyline1 });
270
273
  const lines2 = this.polylineToLines({ polyline: polyline2 });
271
274
  const intersectionPoints = [];
272
- const defaultTolerance = tolerance !== null && tolerance !== void 0 ? tolerance : 1e-6;
273
275
  for (const seg1 of lines1) {
274
276
  for (const seg2 of lines2) {
275
277
  const intersection = this.line.lineLineIntersection({
276
278
  line1: seg1,
277
279
  line2: seg2,
278
280
  checkSegmentsOnly: true,
279
- tolerance: defaultTolerance,
281
+ tolerance,
280
282
  });
281
283
  if (intersection) {
282
284
  let foundClose = false;
@@ -284,7 +286,7 @@ export class Polyline {
284
286
  if (this.point.twoPointsAlmostEqual({
285
287
  point1: intersection,
286
288
  point2: existingPoint,
287
- tolerance: defaultTolerance
289
+ tolerance
288
290
  })) {
289
291
  foundClose = true;
290
292
  break;
@@ -318,9 +320,9 @@ export class Polyline {
318
320
  * ```
319
321
  */
320
322
  sortSegmentsIntoPolylines(inputs) {
321
- var _a;
322
- const tolerance = (_a = inputs.tolerance) !== null && _a !== void 0 ? _a : 1e-5;
323
- const segments = inputs.segments;
323
+ const resolved = resolveDto(Inputs.Polyline.SegmentsToleranceDto, inputs);
324
+ const tolerance = resolved.tolerance;
325
+ const segments = resolved.segments;
324
326
  if (!segments || segments.length === 0) {
325
327
  return [];
326
328
  }
@@ -472,10 +474,11 @@ export class Polyline {
472
474
  * ```
473
475
  */
474
476
  maxFilletsHalfLine(inputs) {
477
+ const resolved = resolveDto(Inputs.Polyline.PolylineToleranceDto, inputs);
475
478
  return this.point.maxFilletsHalfLine({
476
- points: inputs.polyline.points,
477
- checkLastWithFirst: inputs.polyline.isClosed,
478
- tolerance: inputs.tolerance,
479
+ points: resolved.polyline.points,
480
+ checkLastWithFirst: resolved.polyline.isClosed,
481
+ tolerance: resolved.tolerance,
479
482
  });
480
483
  }
481
484
  /**
@@ -497,7 +500,8 @@ export class Polyline {
497
500
  * ```
498
501
  */
499
502
  safestFilletRadius(inputs) {
500
- const allMaxRadii = this.maxFilletsHalfLine(inputs);
503
+ const resolved = resolveDto(Inputs.Polyline.PolylineToleranceDto, inputs);
504
+ const allMaxRadii = this.maxFilletsHalfLine(resolved);
501
505
  if (allMaxRadii.length === 0) {
502
506
  return 0;
503
507
  }