@bitbybit-dev/base 1.6.0 → 1.6.2

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 (38) hide show
  1. package/lib/api/GlobalCDNProvider.js +1 -1
  2. package/lib/api/inputs/base-inputs.d.ts +25 -2
  3. package/lib/api/inputs/color-inputs.d.ts +54 -1
  4. package/lib/api/inputs/color-inputs.js +73 -1
  5. package/lib/api/inputs/frame-inputs.d.ts +2 -1
  6. package/lib/api/inputs/frame-inputs.js +2 -1
  7. package/lib/api/inputs/math-inputs.d.ts +62 -0
  8. package/lib/api/inputs/math-inputs.js +82 -0
  9. package/lib/api/inputs/mesh-inputs.d.ts +16 -0
  10. package/lib/api/inputs/mesh-inputs.js +14 -0
  11. package/lib/api/inputs/transforms-inputs.d.ts +76 -0
  12. package/lib/api/inputs/transforms-inputs.js +85 -0
  13. package/lib/api/resolved-inputs/index.d.ts +10 -0
  14. package/lib/api/services/color.d.ts +36 -2
  15. package/lib/api/services/color.js +59 -9
  16. package/lib/api/services/helpers/color/color-forms.constants.d.ts +7 -0
  17. package/lib/api/services/helpers/color/color-forms.constants.js +7 -0
  18. package/lib/api/services/helpers/color/color-forms.d.ts +2 -0
  19. package/lib/api/services/helpers/color/color-forms.js +24 -0
  20. package/lib/api/services/helpers/geometry/quaternions.constants.d.ts +3 -0
  21. package/lib/api/services/helpers/geometry/quaternions.constants.js +3 -0
  22. package/lib/api/services/helpers/geometry/quaternions.d.ts +14 -0
  23. package/lib/api/services/helpers/geometry/quaternions.js +71 -0
  24. package/lib/api/services/helpers/geometry/scalars.constants.d.ts +1 -0
  25. package/lib/api/services/helpers/geometry/scalars.constants.js +1 -0
  26. package/lib/api/services/helpers/geometry/scalars.d.ts +3 -0
  27. package/lib/api/services/helpers/geometry/scalars.js +29 -1
  28. package/lib/api/services/helpers/mesh/mesh-proximity.constants.d.ts +1 -0
  29. package/lib/api/services/helpers/mesh/mesh-proximity.constants.js +1 -0
  30. package/lib/api/services/helpers/mesh/mesh-proximity.d.ts +1 -0
  31. package/lib/api/services/helpers/mesh/mesh-proximity.js +40 -40
  32. package/lib/api/services/math.d.ts +35 -0
  33. package/lib/api/services/math.js +56 -1
  34. package/lib/api/services/mesh.d.ts +17 -0
  35. package/lib/api/services/mesh.js +27 -1
  36. package/lib/api/services/transforms.d.ts +119 -1
  37. package/lib/api/services/transforms.js +158 -30
  38. package/package.json +1 -1
@@ -1,3 +1,3 @@
1
1
  export class GlobalCDNProvider {
2
2
  }
3
- GlobalCDNProvider.BITBYBIT_CDN_URL = "https://git-cdn.bitbybit.dev/v1.6.0";
3
+ GlobalCDNProvider.BITBYBIT_CDN_URL = "https://git-cdn.bitbybit.dev/v1.6.2";
@@ -55,6 +55,13 @@ export declare namespace Base {
55
55
  * Many operations expect it normalized, and say so on the parameter.
56
56
  */
57
57
  type Vector3 = [number, number, number];
58
+ /**
59
+ * A rotation as four numbers [x, y, z, w]: the axis scaled by the sine of half the angle, then
60
+ * the cosine of half the angle. The order glTF and the renderers store rotations in; a
61
+ * quaternion of length 1 is a pure rotation, and one of any other length is scaled to 1 where it
62
+ * is read.
63
+ */
64
+ type Quaternion = [number, number, number, number];
58
65
  /**
59
66
  * An axis in space: an origin point and a direction vector. Used wherever an operation needs both
60
67
  * a position and an orientation - rotating about an arbitrary line, revolving a profile, mirroring
@@ -91,6 +98,15 @@ export declare namespace Base {
91
98
  * flips the normal.
92
99
  */
93
100
  type Triangle3 = [Base.Point3, Base.Point3, Base.Point3];
101
+ /**
102
+ * The point of a triangle nearest to another point, with the share of each corner in it:
103
+ * `point` is `weights[0]` times the first corner plus `weights[1]` times the second plus
104
+ * `weights[2]` times the third, and the weights add up to 1.
105
+ */
106
+ type TrianglePoint3 = {
107
+ point: Point3;
108
+ weights: Vector3;
109
+ };
94
110
  /**
95
111
  * A mesh as a flat list of triangles. The simplest possible mesh representation - no shared
96
112
  * vertices and no index buffer - which makes it easy to build and to reason about, at the cost of
@@ -319,7 +335,9 @@ export declare namespace Base {
319
335
  */
320
336
  of: number;
321
337
  /**
322
- * The indices of what is cut away, all at once.
338
+ * The indices of what is cut away, all at once. A solid tool that ends within the recipe's
339
+ * `tolerance` of a side of the solid's bounding box, as the half-spaces before it leave the
340
+ * solid, passes through that side.
323
341
  */
324
342
  tools: number[];
325
343
  }
@@ -345,6 +363,8 @@ export declare namespace Base {
345
363
  /**
346
364
  * A host solid with openings cut through it, such as a wall with its doors' and windows' holes.
347
365
  * The same as a difference, kept apart so an executor can cut openings through flat hosts in 2D.
366
+ * An opening that ends within the recipe's `tolerance` of a side of the host's bounding box passes
367
+ * through that side, so an opening as deep as its wall cuts through it however its placement rounds.
348
368
  * @beta
349
369
  */
350
370
  interface RecipeVoidsNode {
@@ -970,7 +990,10 @@ export declare namespace Base {
970
990
  millimetresPerUnit: number;
971
991
  /**
972
992
  * The distance below which two positions count as the same, in the recipe's units, as the
973
- * recipe's source measured it. An executor may use it where it compares positions, or not.
993
+ * recipe's source measured it. Every executor applies it to cuts: an opening of a `voids` step,
994
+ * or a solid tool of a `difference`, that ends within it of a side of the bounding box of what it
995
+ * cuts passes through that side. Elsewhere an executor may use it where it compares positions,
996
+ * or not.
974
997
  */
975
998
  tolerance: number;
976
999
  /**
@@ -24,11 +24,64 @@ export declare namespace Color {
24
24
  class HexDto {
25
25
  constructor(color?: Base.Color);
26
26
  /**
27
- * The color as a hex text such as `#ff5733`, with or without the `#`.
27
+ * The color as a hex text such as `#ff5733` or `#f53`, with or without the `#`.
28
28
  * @default #0000ff
29
29
  */
30
30
  color?: Base.Color | undefined;
31
31
  }
32
+ /**
33
+ * A hex color and an opacity for `color.hexToRgba`.
34
+ */
35
+ class HexAlphaDto {
36
+ constructor(color?: Base.Color, alpha?: number);
37
+ /**
38
+ * The color as a hex text such as `#ff5733` or `#f53`, with or without the `#`.
39
+ * @default #0000ff
40
+ */
41
+ color?: Base.Color | undefined;
42
+ /**
43
+ * How opaque the color is, from 0 for fully transparent to 1 for solid; a value outside that is held
44
+ * at the nearer end.
45
+ * @default 0.5
46
+ * @minimum -Infinity
47
+ * @maximum Infinity
48
+ * @step 0.05
49
+ */
50
+ alpha?: number | undefined;
51
+ }
52
+ /**
53
+ * A hue, a saturation and a lightness for `color.hslToHex`.
54
+ */
55
+ class HslDto {
56
+ constructor(hue?: number, saturation?: number, lightness?: number);
57
+ /**
58
+ * The hue in degrees round the color wheel: 0 red, 120 green, 240 blue; any angle is taken
59
+ * whole turns aside.
60
+ * @default 210
61
+ * @minimum -Infinity
62
+ * @maximum Infinity
63
+ * @step 1
64
+ */
65
+ hue?: number | undefined;
66
+ /**
67
+ * How strong the color is, from 0 for grey to 1 for the purest hue; a value outside that is held at
68
+ * the nearer end.
69
+ * @default 0.6
70
+ * @minimum -Infinity
71
+ * @maximum Infinity
72
+ * @step 0.05
73
+ */
74
+ saturation?: number | undefined;
75
+ /**
76
+ * How light the color is, from 0 for black through 0.5 for the full hue to 1 for white; a value
77
+ * outside that is held at the nearer end.
78
+ * @default 0.5
79
+ * @minimum -Infinity
80
+ * @maximum Infinity
81
+ * @step 0.05
82
+ */
83
+ lightness?: number | undefined;
84
+ }
32
85
  /**
33
86
  * An `{ r, g, b }` color with channels from 0 to 255, for `color.rgb255Color`.
34
87
  */
@@ -29,7 +29,7 @@ export var Color;
29
29
  class HexDto {
30
30
  constructor(color) {
31
31
  /**
32
- * The color as a hex text such as `#ff5733`, with or without the `#`.
32
+ * The color as a hex text such as `#ff5733` or `#f53`, with or without the `#`.
33
33
  * @default #0000ff
34
34
  */
35
35
  this.color = "#0000ff";
@@ -39,6 +39,78 @@ export var Color;
39
39
  }
40
40
  }
41
41
  Color.HexDto = HexDto;
42
+ /**
43
+ * A hex color and an opacity for `color.hexToRgba`.
44
+ */
45
+ class HexAlphaDto {
46
+ constructor(color, alpha) {
47
+ /**
48
+ * The color as a hex text such as `#ff5733` or `#f53`, with or without the `#`.
49
+ * @default #0000ff
50
+ */
51
+ this.color = "#0000ff";
52
+ /**
53
+ * How opaque the color is, from 0 for fully transparent to 1 for solid; a value outside that is held
54
+ * at the nearer end.
55
+ * @default 0.5
56
+ * @minimum -Infinity
57
+ * @maximum Infinity
58
+ * @step 0.05
59
+ */
60
+ this.alpha = 0.5;
61
+ if (color !== undefined) {
62
+ this.color = color;
63
+ }
64
+ if (alpha !== undefined) {
65
+ this.alpha = alpha;
66
+ }
67
+ }
68
+ }
69
+ Color.HexAlphaDto = HexAlphaDto;
70
+ /**
71
+ * A hue, a saturation and a lightness for `color.hslToHex`.
72
+ */
73
+ class HslDto {
74
+ constructor(hue, saturation, lightness) {
75
+ /**
76
+ * The hue in degrees round the color wheel: 0 red, 120 green, 240 blue; any angle is taken
77
+ * whole turns aside.
78
+ * @default 210
79
+ * @minimum -Infinity
80
+ * @maximum Infinity
81
+ * @step 1
82
+ */
83
+ this.hue = 210;
84
+ /**
85
+ * How strong the color is, from 0 for grey to 1 for the purest hue; a value outside that is held at
86
+ * the nearer end.
87
+ * @default 0.6
88
+ * @minimum -Infinity
89
+ * @maximum Infinity
90
+ * @step 0.05
91
+ */
92
+ this.saturation = 0.6;
93
+ /**
94
+ * How light the color is, from 0 for black through 0.5 for the full hue to 1 for white; a value
95
+ * outside that is held at the nearer end.
96
+ * @default 0.5
97
+ * @minimum -Infinity
98
+ * @maximum Infinity
99
+ * @step 0.05
100
+ */
101
+ this.lightness = 0.5;
102
+ if (hue !== undefined) {
103
+ this.hue = hue;
104
+ }
105
+ if (saturation !== undefined) {
106
+ this.saturation = saturation;
107
+ }
108
+ if (lightness !== undefined) {
109
+ this.lightness = lightness;
110
+ }
111
+ }
112
+ }
113
+ Color.HslDto = HslDto;
42
114
  /**
43
115
  * An `{ r, g, b }` color with channels from 0 to 255, for `color.rgb255Color`.
44
116
  */
@@ -103,7 +103,8 @@ export declare namespace Frame {
103
103
  }
104
104
  /**
105
105
  * One frame, for the methods that read a frame or turn it over: `frame.origin`, `frame.normal`,
106
- * `frame.direction`, `frame.yDirection`, `frame.flip` and `frame.toMatrix`.
106
+ * `frame.direction`, `frame.yDirection`, `frame.flip`, `frame.toMatrix` and
107
+ * `transforms.quaternionFromFrame`.
107
108
  */
108
109
  class FrameDto {
109
110
  constructor(frame?: Base.Frame);
@@ -138,7 +138,8 @@ export var Frame;
138
138
  Frame.BestFitDto = BestFitDto;
139
139
  /**
140
140
  * One frame, for the methods that read a frame or turn it over: `frame.origin`, `frame.normal`,
141
- * `frame.direction`, `frame.yDirection`, `frame.flip` and `frame.toMatrix`.
141
+ * `frame.direction`, `frame.yDirection`, `frame.flip`, `frame.toMatrix` and
142
+ * `transforms.quaternionFromFrame`.
142
143
  */
143
144
  class FrameDto {
144
145
  constructor(frame) {
@@ -47,6 +47,16 @@ export declare namespace Math {
47
47
  radToDeg = "radToDeg",
48
48
  degToRad = "degToRad"
49
49
  }
50
+ /**
51
+ * Which way a value moves to reach a step on the 1, 2, 5 scale: `up` to the smallest step at or
52
+ * above it, `down` to the largest at or below it, `nearest` to the closest by ratio. A value within
53
+ * a billionth of a step counts as that step.
54
+ */
55
+ enum niceStepDirectionEnum {
56
+ up = "up",
57
+ down = "down",
58
+ nearest = "nearest"
59
+ }
50
60
  /**
51
61
  * The easing curve applied when interpolating between two values, in the usual in/out/inOut
52
62
  * families - sine, quadratic, cubic, quartic, quintic, exponential and the rest. Governs how an
@@ -545,6 +555,58 @@ export declare namespace Math {
545
555
  */
546
556
  maxDelta?: number | undefined;
547
557
  }
558
+ /**
559
+ * Two angles and the size of a whole turn for `math.shortestAngle`.
560
+ */
561
+ class ShortestAngleDto {
562
+ constructor(from?: number, to?: number, fullTurn?: number);
563
+ /**
564
+ * The angle the turn starts from, in the unit `fullTurn` sets.
565
+ * @default 10
566
+ * @minimum -Infinity
567
+ * @maximum Infinity
568
+ * @step 1
569
+ */
570
+ from?: number | undefined;
571
+ /**
572
+ * The angle to arrive at, in the same unit as `from`; any number of whole turns may be added
573
+ * to it without changing the answer.
574
+ * @default 350
575
+ * @minimum -Infinity
576
+ * @maximum Infinity
577
+ * @step 1
578
+ */
579
+ to?: number | undefined;
580
+ /**
581
+ * How large a whole turn is in the unit the angles use: 360 for degrees, two pi for radians.
582
+ * @default 360
583
+ * @minimum 0
584
+ * @exclusiveMinimum true
585
+ * @maximum Infinity
586
+ * @step 1
587
+ */
588
+ fullTurn?: number | undefined;
589
+ }
590
+ /**
591
+ * A positive number and a direction for `math.niceStep`.
592
+ */
593
+ class NiceStepDto {
594
+ constructor(number?: number, direction?: niceStepDirectionEnum);
595
+ /**
596
+ * The rough size to turn into a step, such as a span divided by the number of ticks wanted.
597
+ * @default 0.37
598
+ * @minimum 0
599
+ * @exclusiveMinimum true
600
+ * @maximum Infinity
601
+ * @step 0.01
602
+ */
603
+ number?: number | undefined;
604
+ /**
605
+ * Whether the step may be larger than `number`, smaller, or whichever is closer.
606
+ * @default up
607
+ */
608
+ direction?: niceStepDirectionEnum | undefined;
609
+ }
548
610
  /**
549
611
  * An expression written as text for `math.evalArithmetic`.
550
612
  */
@@ -51,6 +51,17 @@ export var Math;
51
51
  mathOneNrOperatorEnum["radToDeg"] = "radToDeg";
52
52
  mathOneNrOperatorEnum["degToRad"] = "degToRad";
53
53
  })(mathOneNrOperatorEnum = Math.mathOneNrOperatorEnum || (Math.mathOneNrOperatorEnum = {}));
54
+ /**
55
+ * Which way a value moves to reach a step on the 1, 2, 5 scale: `up` to the smallest step at or
56
+ * above it, `down` to the largest at or below it, `nearest` to the closest by ratio. A value within
57
+ * a billionth of a step counts as that step.
58
+ */
59
+ let niceStepDirectionEnum;
60
+ (function (niceStepDirectionEnum) {
61
+ niceStepDirectionEnum["up"] = "up";
62
+ niceStepDirectionEnum["down"] = "down";
63
+ niceStepDirectionEnum["nearest"] = "nearest";
64
+ })(niceStepDirectionEnum = Math.niceStepDirectionEnum || (Math.niceStepDirectionEnum = {}));
54
65
  /**
55
66
  * The easing curve applied when interpolating between two values, in the usual in/out/inOut
56
67
  * families - sine, quadratic, cubic, quartic, quintic, exponential and the rest. Governs how an
@@ -702,6 +713,77 @@ export var Math;
702
713
  }
703
714
  }
704
715
  Math.MoveTowardsDto = MoveTowardsDto;
716
+ /**
717
+ * Two angles and the size of a whole turn for `math.shortestAngle`.
718
+ */
719
+ class ShortestAngleDto {
720
+ constructor(from, to, fullTurn) {
721
+ /**
722
+ * The angle the turn starts from, in the unit `fullTurn` sets.
723
+ * @default 10
724
+ * @minimum -Infinity
725
+ * @maximum Infinity
726
+ * @step 1
727
+ */
728
+ this.from = 10;
729
+ /**
730
+ * The angle to arrive at, in the same unit as `from`; any number of whole turns may be added
731
+ * to it without changing the answer.
732
+ * @default 350
733
+ * @minimum -Infinity
734
+ * @maximum Infinity
735
+ * @step 1
736
+ */
737
+ this.to = 350;
738
+ /**
739
+ * How large a whole turn is in the unit the angles use: 360 for degrees, two pi for radians.
740
+ * @default 360
741
+ * @minimum 0
742
+ * @exclusiveMinimum true
743
+ * @maximum Infinity
744
+ * @step 1
745
+ */
746
+ this.fullTurn = 360;
747
+ if (from !== undefined) {
748
+ this.from = from;
749
+ }
750
+ if (to !== undefined) {
751
+ this.to = to;
752
+ }
753
+ if (fullTurn !== undefined) {
754
+ this.fullTurn = fullTurn;
755
+ }
756
+ }
757
+ }
758
+ Math.ShortestAngleDto = ShortestAngleDto;
759
+ /**
760
+ * A positive number and a direction for `math.niceStep`.
761
+ */
762
+ class NiceStepDto {
763
+ constructor(number, direction) {
764
+ /**
765
+ * The rough size to turn into a step, such as a span divided by the number of ticks wanted.
766
+ * @default 0.37
767
+ * @minimum 0
768
+ * @exclusiveMinimum true
769
+ * @maximum Infinity
770
+ * @step 0.01
771
+ */
772
+ this.number = 0.37;
773
+ /**
774
+ * Whether the step may be larger than `number`, smaller, or whichever is closer.
775
+ * @default up
776
+ */
777
+ this.direction = niceStepDirectionEnum.up;
778
+ if (number !== undefined) {
779
+ this.number = number;
780
+ }
781
+ if (direction !== undefined) {
782
+ this.direction = direction;
783
+ }
784
+ }
785
+ }
786
+ Math.NiceStepDto = NiceStepDto;
705
787
  /**
706
788
  * An expression written as text for `math.evalArithmetic`.
707
789
  */
@@ -33,6 +33,22 @@ export declare namespace Mesh {
33
33
  */
34
34
  triangle: Base.Triangle3;
35
35
  }
36
+ /**
37
+ * A point and a triangle for `mesh.closestPointOnTriangle`.
38
+ */
39
+ class PointTriangleDto {
40
+ constructor(point?: Base.Point3, triangle?: Base.Triangle3);
41
+ /**
42
+ * The point to measure from.
43
+ * @default undefined
44
+ */
45
+ point: Base.Point3;
46
+ /**
47
+ * The corners to search between, in the order the weights come back in.
48
+ * @default undefined
49
+ */
50
+ triangle: Base.Triangle3;
51
+ }
36
52
  /**
37
53
  * A triangle and a tolerance for `mesh.calculateTrianglePlane`.
38
54
  */
@@ -30,6 +30,20 @@ export var Mesh;
30
30
  }
31
31
  }
32
32
  Mesh.TriangleDto = TriangleDto;
33
+ /**
34
+ * A point and a triangle for `mesh.closestPointOnTriangle`.
35
+ */
36
+ class PointTriangleDto {
37
+ constructor(point, triangle) {
38
+ if (point !== undefined) {
39
+ this.point = point;
40
+ }
41
+ if (triangle !== undefined) {
42
+ this.triangle = triangle;
43
+ }
44
+ }
45
+ }
46
+ Mesh.PointTriangleDto = PointTriangleDto;
33
47
  /**
34
48
  * A triangle and a tolerance for `mesh.calculateTrianglePlane`.
35
49
  */
@@ -233,4 +233,80 @@ export declare namespace Transforms {
233
233
  */
234
234
  tolerance?: number | undefined;
235
235
  }
236
+ /**
237
+ * An axis and an angle for `transforms.quaternionFromAxisAngle`.
238
+ */
239
+ class AxisAngleDto {
240
+ constructor(axis?: Base.Vector3, angle?: number);
241
+ /**
242
+ * The direction to turn about; any length but 0.
243
+ * @default [0, 0, 1]
244
+ */
245
+ axis?: Base.Vector3 | undefined;
246
+ /**
247
+ * How far to turn, in degrees; positive is counter-clockwise when the axis points toward
248
+ * you.
249
+ * @default 90
250
+ * @minimum -Infinity
251
+ * @maximum Infinity
252
+ * @step 1
253
+ */
254
+ angle?: number | undefined;
255
+ }
256
+ /**
257
+ * Three angles in degrees, about X, Y and Z in turn, for `transforms.quaternionFromEuler`.
258
+ */
259
+ class EulerAnglesDto {
260
+ constructor(angles?: Base.Vector3);
261
+ /**
262
+ * The turns in degrees about the X, Y and Z axes, applied in that order about the fixed
263
+ * world axes.
264
+ * @default [0, 0, 0]
265
+ */
266
+ angles?: Base.Vector3 | undefined;
267
+ }
268
+ /**
269
+ * A rotation held as a quaternion, for `transforms.quaternionToEuler` and
270
+ * `transforms.quaternionToMatrix`.
271
+ */
272
+ class QuaternionDto {
273
+ constructor(quaternion?: Base.Quaternion);
274
+ /**
275
+ * The rotation as [x, y, z, w]; any length but 0 is scaled to 1.
276
+ * @default undefined
277
+ */
278
+ quaternion: Base.Quaternion;
279
+ }
280
+ /**
281
+ * Two rotations, applied one after the other, for `transforms.quaternionCombine`.
282
+ */
283
+ class TwoQuaternionsDto {
284
+ constructor(first?: Base.Quaternion, second?: Base.Quaternion);
285
+ /**
286
+ * The rotation applied first, as [x, y, z, w].
287
+ * @default undefined
288
+ */
289
+ first: Base.Quaternion;
290
+ /**
291
+ * The rotation applied after it, as [x, y, z, w].
292
+ * @default undefined
293
+ */
294
+ second: Base.Quaternion;
295
+ }
296
+ /**
297
+ * A rotation and a vector for `transforms.quaternionRotateVector`.
298
+ */
299
+ class QuaternionVectorDto {
300
+ constructor(quaternion?: Base.Quaternion, vector?: Base.Vector3);
301
+ /**
302
+ * The rotation as [x, y, z, w].
303
+ * @default undefined
304
+ */
305
+ quaternion: Base.Quaternion;
306
+ /**
307
+ * The vector or point to turn about the origin.
308
+ * @default undefined
309
+ */
310
+ vector: Base.Vector3;
311
+ }
236
312
  }
@@ -309,4 +309,89 @@ export var Transforms;
309
309
  }
310
310
  }
311
311
  Transforms.TransformationToleranceDto = TransformationToleranceDto;
312
+ /**
313
+ * An axis and an angle for `transforms.quaternionFromAxisAngle`.
314
+ */
315
+ class AxisAngleDto {
316
+ constructor(axis, angle) {
317
+ /**
318
+ * The direction to turn about; any length but 0.
319
+ * @default [0, 0, 1]
320
+ */
321
+ this.axis = [0, 0, 1];
322
+ /**
323
+ * How far to turn, in degrees; positive is counter-clockwise when the axis points toward
324
+ * you.
325
+ * @default 90
326
+ * @minimum -Infinity
327
+ * @maximum Infinity
328
+ * @step 1
329
+ */
330
+ this.angle = 90;
331
+ if (axis !== undefined) {
332
+ this.axis = axis;
333
+ }
334
+ if (angle !== undefined) {
335
+ this.angle = angle;
336
+ }
337
+ }
338
+ }
339
+ Transforms.AxisAngleDto = AxisAngleDto;
340
+ /**
341
+ * Three angles in degrees, about X, Y and Z in turn, for `transforms.quaternionFromEuler`.
342
+ */
343
+ class EulerAnglesDto {
344
+ constructor(angles) {
345
+ /**
346
+ * The turns in degrees about the X, Y and Z axes, applied in that order about the fixed
347
+ * world axes.
348
+ * @default [0, 0, 0]
349
+ */
350
+ this.angles = [0, 0, 0];
351
+ if (angles !== undefined) {
352
+ this.angles = angles;
353
+ }
354
+ }
355
+ }
356
+ Transforms.EulerAnglesDto = EulerAnglesDto;
357
+ /**
358
+ * A rotation held as a quaternion, for `transforms.quaternionToEuler` and
359
+ * `transforms.quaternionToMatrix`.
360
+ */
361
+ class QuaternionDto {
362
+ constructor(quaternion) {
363
+ if (quaternion !== undefined) {
364
+ this.quaternion = quaternion;
365
+ }
366
+ }
367
+ }
368
+ Transforms.QuaternionDto = QuaternionDto;
369
+ /**
370
+ * Two rotations, applied one after the other, for `transforms.quaternionCombine`.
371
+ */
372
+ class TwoQuaternionsDto {
373
+ constructor(first, second) {
374
+ if (first !== undefined) {
375
+ this.first = first;
376
+ }
377
+ if (second !== undefined) {
378
+ this.second = second;
379
+ }
380
+ }
381
+ }
382
+ Transforms.TwoQuaternionsDto = TwoQuaternionsDto;
383
+ /**
384
+ * A rotation and a vector for `transforms.quaternionRotateVector`.
385
+ */
386
+ class QuaternionVectorDto {
387
+ constructor(quaternion, vector) {
388
+ if (quaternion !== undefined) {
389
+ this.quaternion = quaternion;
390
+ }
391
+ if (vector !== undefined) {
392
+ this.vector = vector;
393
+ }
394
+ }
395
+ }
396
+ Transforms.QuaternionVectorDto = QuaternionVectorDto;
312
397
  })(Transforms || (Transforms = {}));
@@ -6,8 +6,10 @@ import * as Inputs from "../inputs";
6
6
  */
7
7
  export declare namespace Color {
8
8
  type ChannelDto = WithDefaults<Inputs.Color.ChannelDto, "channel">;
9
+ type HexAlphaDto = WithDefaults<Inputs.Color.HexAlphaDto, "color" | "alpha">;
9
10
  type HexDto = WithDefaults<Inputs.Color.HexDto, "color">;
10
11
  type HexDtoMapped = WithDefaults<Inputs.Color.HexDtoMapped, "color" | "from" | "to">;
12
+ type HslDto = WithDefaults<Inputs.Color.HslDto, "hue" | "saturation" | "lightness">;
11
13
  type InvertHexDto = WithDefaults<Inputs.Color.InvertHexDto, "color" | "blackAndWhite">;
12
14
  type Rgb1Dto = WithDefaults<Inputs.Color.Rgb1Dto, "colorRgb">;
13
15
  type Rgb255Dto = WithDefaults<Inputs.Color.Rgb255Dto, "colorRgb">;
@@ -221,12 +223,14 @@ export declare namespace Math {
221
223
  type LerpDto = WithDefaults<Inputs.Math.LerpDto, "start" | "end" | "t">;
222
224
  type ModulusDto = WithDefaults<Inputs.Math.ModulusDto, "number" | "modulus">;
223
225
  type MoveTowardsDto = WithDefaults<Inputs.Math.MoveTowardsDto, "current" | "target" | "maxDelta">;
226
+ type NiceStepDto = WithDefaults<Inputs.Math.NiceStepDto, "number" | "direction">;
224
227
  type NumberDto = WithDefaults<Inputs.Math.NumberDto, "number">;
225
228
  type PingPongDto = WithDefaults<Inputs.Math.PingPongDto, "t" | "length">;
226
229
  type RandomNumberDto = WithDefaults<Inputs.Math.RandomNumberDto, "low" | "high">;
227
230
  type RandomNumbersDto = WithDefaults<Inputs.Math.RandomNumbersDto, "low" | "high" | "count">;
228
231
  type RemapNumberDto = WithDefaults<Inputs.Math.RemapNumberDto, "number" | "fromLow" | "fromHigh" | "toLow" | "toHigh">;
229
232
  type RoundToDecimalsDto = WithDefaults<Inputs.Math.RoundToDecimalsDto, "number" | "decimalPlaces">;
233
+ type ShortestAngleDto = WithDefaults<Inputs.Math.ShortestAngleDto, "from" | "to" | "fullTurn">;
230
234
  type ToFixedDto = WithDefaults<Inputs.Math.ToFixedDto, "decimalPlaces">;
231
235
  type TwoNumbersDto = WithDefaults<Inputs.Math.TwoNumbersDto, "first" | "second">;
232
236
  type UnitOfLengthDto = WithDefaults<Inputs.Math.UnitOfLengthDto, "unit">;
@@ -246,6 +250,7 @@ export declare namespace Mesh {
246
250
  type MeshMeshToleranceDto = WithDefaults<Inputs.Mesh.MeshMeshToleranceDto, "tolerance">;
247
251
  type MeshPointDto = Inputs.Mesh.MeshPointDto;
248
252
  type MeshToIndexedDto = WithDefaults<Inputs.Mesh.MeshToIndexedDto, "tolerance">;
253
+ type PointTriangleDto = Inputs.Mesh.PointTriangleDto;
249
254
  type PolygonWithHolesDto = Inputs.Mesh.PolygonWithHolesDto;
250
255
  type SignedDistanceFromPlaneToPointDto = Inputs.Mesh.SignedDistanceFromPlaneToPointDto;
251
256
  type TriangleDto = Inputs.Mesh.TriangleDto;
@@ -347,6 +352,10 @@ export declare namespace Text {
347
352
  * the way `resolveDto` hands a DTO to the code that reads it.
348
353
  */
349
354
  export declare namespace Transforms {
355
+ type AxisAngleDto = WithDefaults<Inputs.Transforms.AxisAngleDto, "axis" | "angle">;
356
+ type EulerAnglesDto = WithDefaults<Inputs.Transforms.EulerAnglesDto, "angles">;
357
+ type QuaternionDto = Inputs.Transforms.QuaternionDto;
358
+ type QuaternionVectorDto = Inputs.Transforms.QuaternionVectorDto;
350
359
  type RotationCenterAxisDto = WithDefaults<Inputs.Transforms.RotationCenterAxisDto, "angle" | "axis" | "center">;
351
360
  type RotationCenterDto = WithDefaults<Inputs.Transforms.RotationCenterDto, "angle" | "center">;
352
361
  type RotationCenterYawPitchRollDto = WithDefaults<Inputs.Transforms.RotationCenterYawPitchRollDto, "yaw" | "pitch" | "roll" | "center">;
@@ -357,6 +366,7 @@ export declare namespace Transforms {
357
366
  type TransformationToleranceDto = WithDefaults<Inputs.Transforms.TransformationToleranceDto, "tolerance">;
358
367
  type TranslationsXYZDto = Inputs.Transforms.TranslationsXYZDto;
359
368
  type TranslationXYZDto = WithDefaults<Inputs.Transforms.TranslationXYZDto, "translation">;
369
+ type TwoQuaternionsDto = Inputs.Transforms.TwoQuaternionsDto;
360
370
  type UniformScaleDto = WithDefaults<Inputs.Transforms.UniformScaleDto, "scale">;
361
371
  type UniformScaleFromCenterDto = WithDefaults<Inputs.Transforms.UniformScaleFromCenterDto, "scale" | "center">;
362
372
  }