@bitbybit-dev/base 1.6.1 → 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.
- package/lib/api/GlobalCDNProvider.js +1 -1
- package/lib/api/inputs/base-inputs.d.ts +36 -7
- package/lib/api/inputs/base-inputs.js +10 -0
- package/lib/api/inputs/color-inputs.d.ts +54 -1
- package/lib/api/inputs/color-inputs.js +73 -1
- package/lib/api/inputs/frame-inputs.d.ts +2 -1
- package/lib/api/inputs/frame-inputs.js +2 -1
- package/lib/api/inputs/io-inputs.d.ts +527 -59
- package/lib/api/inputs/io-inputs.js +432 -40
- package/lib/api/inputs/line-inputs.d.ts +17 -0
- package/lib/api/inputs/line-inputs.js +15 -0
- package/lib/api/inputs/math-inputs.d.ts +62 -0
- package/lib/api/inputs/math-inputs.js +82 -0
- package/lib/api/inputs/mesh-inputs.d.ts +16 -0
- package/lib/api/inputs/mesh-inputs.js +14 -0
- package/lib/api/inputs/transforms-inputs.d.ts +76 -0
- package/lib/api/inputs/transforms-inputs.js +85 -0
- package/lib/api/kernel-calls/index.d.ts +1 -0
- package/lib/api/kernel-calls/index.js +1 -0
- package/lib/api/kernel-calls/settings.d.ts +82 -0
- package/lib/api/kernel-calls/settings.js +123 -0
- package/lib/api/recipes/surface-mesh.d.ts +2 -1
- package/lib/api/recipes/surface-mesh.js +5 -3
- package/lib/api/resolved-inputs/index.d.ts +32 -2
- package/lib/api/services/base-bitbybit.d.ts +12 -0
- package/lib/api/services/base-bitbybit.js +19 -3
- package/lib/api/services/color.d.ts +36 -2
- package/lib/api/services/color.js +60 -11
- package/lib/api/services/helpers/color/color-forms.constants.d.ts +10 -0
- package/lib/api/services/helpers/color/color-forms.constants.js +10 -0
- package/lib/api/services/helpers/color/color-forms.d.ts +3 -0
- package/lib/api/services/helpers/color/color-forms.js +27 -0
- package/lib/api/services/helpers/color/css-colors.constants.d.ts +9 -0
- package/lib/api/services/helpers/color/css-colors.constants.js +158 -0
- package/lib/api/services/helpers/color/css-colors.d.ts +1 -0
- package/lib/api/services/helpers/color/css-colors.js +61 -0
- package/lib/api/services/helpers/curves/bezier-pieces.constants.d.ts +5 -0
- package/lib/api/services/helpers/curves/bezier-pieces.constants.js +5 -0
- package/lib/api/services/helpers/curves/bezier-pieces.d.ts +24 -0
- package/lib/api/services/helpers/curves/bezier-pieces.js +149 -0
- package/lib/api/services/helpers/curves/conic-arcs.constants.d.ts +5 -0
- package/lib/api/services/helpers/curves/conic-arcs.constants.js +5 -0
- package/lib/api/services/helpers/curves/conic-arcs.d.ts +24 -0
- package/lib/api/services/helpers/curves/conic-arcs.js +85 -0
- package/lib/api/services/helpers/curves/nurbs-forms.d.ts +20 -0
- package/lib/api/services/helpers/curves/nurbs-forms.js +112 -0
- package/lib/api/services/helpers/curves/nurbs.d.ts +4 -0
- package/lib/api/services/helpers/curves/nurbs.js +10 -9
- package/lib/api/services/helpers/files/drawing/drawing-budget.d.ts +3 -0
- package/lib/api/services/helpers/files/drawing/drawing-budget.js +24 -0
- package/lib/api/services/helpers/files/drawing/drawing-geometry.d.ts +18 -0
- package/lib/api/services/helpers/files/drawing/drawing-geometry.js +84 -0
- package/lib/api/services/helpers/files/drawing/drawing-model.d.ts +5 -0
- package/lib/api/services/helpers/files/drawing/drawing-model.js +252 -0
- package/lib/api/services/helpers/files/drawing/drawing-types.d.ts +60 -0
- package/lib/api/services/helpers/files/drawing/drawing-types.js +1 -0
- package/lib/api/services/helpers/files/drawing/drawing.constants.d.ts +28 -0
- package/lib/api/services/helpers/files/drawing/drawing.constants.js +29 -0
- package/lib/api/services/helpers/files/dxf/dxf-colors.d.ts +5 -0
- package/lib/api/services/helpers/files/dxf/dxf-colors.js +45 -0
- package/lib/api/services/helpers/files/dxf/dxf-entities.d.ts +17 -0
- package/lib/api/services/helpers/files/dxf/dxf-entities.js +193 -0
- package/lib/api/services/helpers/files/dxf/dxf-file-text.d.ts +1 -0
- package/lib/api/services/helpers/files/dxf/dxf-file-text.js +50 -0
- package/lib/api/services/helpers/files/dxf/dxf-generator.d.ts +2 -36
- package/lib/api/services/helpers/files/dxf/dxf-generator.js +81 -523
- package/lib/api/services/helpers/files/dxf/dxf-reader-dtos.d.ts +6 -0
- package/lib/api/services/helpers/files/dxf/dxf-reader-dtos.js +81 -0
- package/lib/api/services/helpers/files/dxf/dxf-reader-geometry.d.ts +21 -0
- package/lib/api/services/helpers/files/dxf/dxf-reader-geometry.js +67 -0
- package/lib/api/services/helpers/files/dxf/dxf-reader-types.d.ts +69 -0
- package/lib/api/services/helpers/files/dxf/dxf-reader-types.js +1 -0
- package/lib/api/services/helpers/files/dxf/dxf-reader.constants.d.ts +71 -0
- package/lib/api/services/helpers/files/dxf/dxf-reader.constants.js +78 -0
- package/lib/api/services/helpers/files/dxf/dxf-reader.d.ts +2 -0
- package/lib/api/services/helpers/files/dxf/dxf-reader.js +556 -0
- package/lib/api/services/helpers/files/dxf/dxf-tables.d.ts +27 -0
- package/lib/api/services/helpers/files/dxf/dxf-tables.js +247 -0
- package/lib/api/services/helpers/files/dxf/dxf-text.d.ts +26 -0
- package/lib/api/services/helpers/files/dxf/dxf-text.js +97 -0
- package/lib/api/services/helpers/files/dxf/dxf-tokens.d.ts +9 -0
- package/lib/api/services/helpers/files/dxf/dxf-tokens.js +65 -0
- package/lib/api/services/helpers/files/dxf/dxf.constants.d.ts +32 -1
- package/lib/api/services/helpers/files/dxf/dxf.constants.js +34 -1
- package/lib/api/services/helpers/files/file-bytes.d.ts +1 -0
- package/lib/api/services/helpers/files/file-bytes.js +15 -0
- package/lib/api/services/helpers/files/ground-axes.d.ts +2 -0
- package/lib/api/services/helpers/files/ground-axes.js +4 -0
- package/lib/api/services/helpers/files/mesh-file-axes.d.ts +7 -0
- package/lib/api/services/helpers/files/mesh-file-axes.js +17 -0
- package/lib/api/services/helpers/files/stl-axes.d.ts +4 -0
- package/lib/api/services/helpers/files/stl-axes.js +22 -0
- package/lib/api/services/helpers/files/stl-types.d.ts +7 -0
- package/lib/api/services/helpers/files/stl-types.js +1 -0
- package/lib/api/services/helpers/files/stl.constants.d.ts +11 -0
- package/lib/api/services/helpers/files/stl.constants.js +11 -0
- package/lib/api/services/helpers/files/stl.d.ts +3 -0
- package/lib/api/services/helpers/files/stl.js +93 -0
- package/lib/api/services/helpers/files/svg/svg-css.d.ts +48 -0
- package/lib/api/services/helpers/files/svg/svg-css.js +444 -0
- package/lib/api/services/helpers/files/svg/svg-dash-patterns.d.ts +2 -0
- package/lib/api/services/helpers/files/svg/svg-dash-patterns.js +35 -0
- package/lib/api/services/helpers/files/svg/svg-document.d.ts +26 -0
- package/lib/api/services/helpers/files/svg/svg-document.js +89 -0
- package/lib/api/services/helpers/files/svg/svg-memo.d.ts +1 -0
- package/lib/api/services/helpers/files/svg/svg-memo.js +8 -0
- package/lib/api/services/helpers/files/svg/svg-normalizer.d.ts +6 -0
- package/lib/api/services/helpers/files/svg/svg-normalizer.js +433 -0
- package/lib/api/services/helpers/files/svg/svg-numbers.d.ts +15 -0
- package/lib/api/services/helpers/files/svg/svg-numbers.js +61 -0
- package/lib/api/services/helpers/files/svg/svg-path-data.constants.d.ts +8 -0
- package/lib/api/services/helpers/files/svg/svg-path-data.constants.js +10 -0
- package/lib/api/services/helpers/files/svg/svg-path-data.d.ts +9 -0
- package/lib/api/services/helpers/files/svg/svg-path-data.js +203 -0
- package/lib/api/services/helpers/files/svg/svg-path-types.d.ts +33 -0
- package/lib/api/services/helpers/files/svg/svg-path-types.js +1 -0
- package/lib/api/services/helpers/files/svg/svg-reader.constants.d.ts +35 -0
- package/lib/api/services/helpers/files/svg/svg-reader.constants.js +35 -0
- package/lib/api/services/helpers/files/svg/svg-reading.constants.d.ts +9 -0
- package/lib/api/services/helpers/files/svg/svg-reading.constants.js +9 -0
- package/lib/api/services/helpers/files/svg/svg-reading.d.ts +6 -0
- package/lib/api/services/helpers/files/svg/svg-reading.js +233 -0
- package/lib/api/services/helpers/files/svg/svg-scene-types.d.ts +54 -0
- package/lib/api/services/helpers/files/svg/svg-scene-types.js +1 -0
- package/lib/api/services/helpers/files/svg/svg-shapes.d.ts +6 -0
- package/lib/api/services/helpers/files/svg/svg-shapes.js +102 -0
- package/lib/api/services/helpers/files/svg/svg-strokes.d.ts +38 -0
- package/lib/api/services/helpers/files/svg/svg-strokes.js +108 -0
- package/lib/api/services/helpers/files/svg/svg-style.d.ts +26 -0
- package/lib/api/services/helpers/files/svg/svg-style.js +211 -0
- package/lib/api/services/helpers/files/svg/svg-transform.d.ts +10 -0
- package/lib/api/services/helpers/files/svg/svg-transform.js +76 -0
- package/lib/api/services/helpers/files/svg/svg-writer.d.ts +16 -0
- package/lib/api/services/helpers/files/svg/svg-writer.js +153 -0
- package/lib/api/services/helpers/files/svg/svg-xml.d.ts +11 -0
- package/lib/api/services/helpers/files/svg/svg-xml.js +322 -0
- package/lib/api/services/helpers/files/svg/svg.constants.d.ts +13 -0
- package/lib/api/services/helpers/files/svg/svg.constants.js +13 -0
- package/lib/api/services/helpers/files/work-budget.d.ts +11 -0
- package/lib/api/services/helpers/files/work-budget.js +26 -0
- package/lib/api/services/helpers/geometry/affine2.d.ts +8 -0
- package/lib/api/services/helpers/geometry/affine2.js +18 -0
- package/lib/api/services/helpers/geometry/ellipse-arcs.d.ts +14 -0
- package/lib/api/services/helpers/geometry/ellipse-arcs.js +96 -0
- package/lib/api/services/helpers/geometry/frame-axes.d.ts +3 -1
- package/lib/api/services/helpers/geometry/polygon-nesting.constants.d.ts +6 -0
- package/lib/api/services/helpers/geometry/polygon-nesting.constants.js +6 -0
- package/lib/api/services/helpers/geometry/polygon-nesting.d.ts +31 -0
- package/lib/api/services/helpers/geometry/polygon-nesting.js +251 -0
- package/lib/api/services/helpers/geometry/quaternions.constants.d.ts +3 -0
- package/lib/api/services/helpers/geometry/quaternions.constants.js +3 -0
- package/lib/api/services/helpers/geometry/quaternions.d.ts +14 -0
- package/lib/api/services/helpers/geometry/quaternions.js +71 -0
- package/lib/api/services/helpers/geometry/scalars.constants.d.ts +1 -0
- package/lib/api/services/helpers/geometry/scalars.constants.js +1 -0
- package/lib/api/services/helpers/geometry/scalars.d.ts +3 -0
- package/lib/api/services/helpers/geometry/scalars.js +29 -1
- package/lib/api/services/helpers/geometry/vectors.d.ts +1 -0
- package/lib/api/services/helpers/geometry/vectors.js +6 -0
- package/lib/api/services/helpers/mesh/mesh-proximity.constants.d.ts +1 -0
- package/lib/api/services/helpers/mesh/mesh-proximity.constants.js +1 -0
- package/lib/api/services/helpers/mesh/mesh-proximity.d.ts +1 -0
- package/lib/api/services/helpers/mesh/mesh-proximity.js +40 -40
- package/lib/api/services/io/drawing.d.ts +170 -0
- package/lib/api/services/io/drawing.js +212 -0
- package/lib/api/services/io/dxf.d.ts +134 -0
- package/lib/api/services/io/dxf.js +167 -0
- package/lib/api/services/io/index.d.ts +4 -0
- package/lib/api/services/io/index.js +4 -0
- package/lib/api/services/io/io.d.ts +14 -0
- package/lib/api/services/io/io.js +15 -0
- package/lib/api/services/io/svg.d.ts +64 -0
- package/lib/api/services/io/svg.js +102 -0
- package/lib/api/services/line.d.ts +17 -0
- package/lib/api/services/line.js +20 -1
- package/lib/api/services/math.d.ts +35 -0
- package/lib/api/services/math.js +56 -1
- package/lib/api/services/mesh.d.ts +17 -0
- package/lib/api/services/mesh.js +27 -1
- package/lib/api/services/point.d.ts +4 -1
- package/lib/api/services/point.js +9 -4
- package/lib/api/services/recipes.d.ts +3 -0
- package/lib/api/services/recipes.js +4 -1
- package/lib/api/services/text.d.ts +4 -1
- package/lib/api/services/text.js +8 -3
- package/lib/api/services/transforms.d.ts +119 -1
- package/lib/api/services/transforms.js +158 -30
- package/package.json +1 -1
- package/lib/api/services/helpers/files/dxf/dxf.d.ts +0 -87
- package/lib/api/services/helpers/files/dxf/dxf.js +0 -111
- package/lib/api/services/io.d.ts +0 -9
- package/lib/api/services/io.js +0 -10
|
@@ -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
|
|
@@ -320,8 +336,9 @@ export declare namespace Base {
|
|
|
320
336
|
of: number;
|
|
321
337
|
/**
|
|
322
338
|
* The indices of what is cut away, all at once. A solid tool that ends within the recipe's
|
|
323
|
-
* `tolerance` of a
|
|
324
|
-
* solid,
|
|
339
|
+
* `tolerance` of a face of the solid, as the half-spaces before it leave the solid, passes
|
|
340
|
+
* through that face: a side of the solid's bounding box, or a face inside it that the tool's end
|
|
341
|
+
* lies wholly on.
|
|
325
342
|
*/
|
|
326
343
|
tools: number[];
|
|
327
344
|
}
|
|
@@ -347,8 +364,9 @@ export declare namespace Base {
|
|
|
347
364
|
/**
|
|
348
365
|
* A host solid with openings cut through it, such as a wall with its doors' and windows' holes.
|
|
349
366
|
* The same as a difference, kept apart so an executor can cut openings through flat hosts in 2D.
|
|
350
|
-
* An opening that ends within the recipe's `tolerance` of a
|
|
351
|
-
*
|
|
367
|
+
* An opening that ends within the recipe's `tolerance` of a face of the host passes through that
|
|
368
|
+
* face, a side of the host's bounding box or a face inside it that the opening's end lies wholly on,
|
|
369
|
+
* so an opening as deep as its wall cuts through it however its placement rounds.
|
|
352
370
|
* @beta
|
|
353
371
|
*/
|
|
354
372
|
interface RecipeVoidsNode {
|
|
@@ -975,9 +993,11 @@ export declare namespace Base {
|
|
|
975
993
|
/**
|
|
976
994
|
* The distance below which two positions count as the same, in the recipe's units, as the
|
|
977
995
|
* recipe's source measured it. Every executor applies it to cuts: an opening of a `voids` step,
|
|
978
|
-
* or a solid tool of a `difference`, that ends within it of a
|
|
979
|
-
*
|
|
980
|
-
*
|
|
996
|
+
* or a solid tool of a `difference`, that ends within it of a face of what it cuts passes through
|
|
997
|
+
* that face, whether a side of the bounding box of what it cuts or a face inside it that the cut's
|
|
998
|
+
* end lies wholly on. An executor that cannot move such an end out without moving more of the
|
|
999
|
+
* cut, as beside a shallow chamfer of it, or with a part of what it cuts just beyond the end,
|
|
1000
|
+
* leaves it as drawn. Elsewhere an executor may use it where it compares positions, or not.
|
|
981
1001
|
*/
|
|
982
1002
|
tolerance: number;
|
|
983
1003
|
/**
|
|
@@ -1049,4 +1069,13 @@ export declare namespace Base {
|
|
|
1049
1069
|
metre = "m",
|
|
1050
1070
|
inch = "in"
|
|
1051
1071
|
}
|
|
1072
|
+
/**
|
|
1073
|
+
* The coordinate system the numbers of a model are in: left-handed, as a default Babylon.js
|
|
1074
|
+
* scene is, or right-handed, as three.js, PlayCanvas and CAD files are. Y is up in both. It
|
|
1075
|
+
* decides how a file, a drawing or a shape that names a hand maps to those numbers.
|
|
1076
|
+
*/
|
|
1077
|
+
enum coordinateSystemEnum {
|
|
1078
|
+
leftHanded = "leftHanded",
|
|
1079
|
+
rightHanded = "rightHanded"
|
|
1080
|
+
}
|
|
1052
1081
|
}
|
|
@@ -61,4 +61,14 @@ export var Base;
|
|
|
61
61
|
unitOfLengthEnum["metre"] = "m";
|
|
62
62
|
unitOfLengthEnum["inch"] = "in";
|
|
63
63
|
})(unitOfLengthEnum = Base.unitOfLengthEnum || (Base.unitOfLengthEnum = {}));
|
|
64
|
+
/**
|
|
65
|
+
* The coordinate system the numbers of a model are in: left-handed, as a default Babylon.js
|
|
66
|
+
* scene is, or right-handed, as three.js, PlayCanvas and CAD files are. Y is up in both. It
|
|
67
|
+
* decides how a file, a drawing or a shape that names a hand maps to those numbers.
|
|
68
|
+
*/
|
|
69
|
+
let coordinateSystemEnum;
|
|
70
|
+
(function (coordinateSystemEnum) {
|
|
71
|
+
coordinateSystemEnum["leftHanded"] = "leftHanded";
|
|
72
|
+
coordinateSystemEnum["rightHanded"] = "rightHanded";
|
|
73
|
+
})(coordinateSystemEnum = Base.coordinateSystemEnum || (Base.coordinateSystemEnum = {}));
|
|
64
74
|
})(Base || (Base = {}));
|
|
@@ -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
|
|
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
|
|
141
|
+
* `frame.direction`, `frame.yDirection`, `frame.flip`, `frame.toMatrix` and
|
|
142
|
+
* `transforms.quaternionFromFrame`.
|
|
142
143
|
*/
|
|
143
144
|
class FrameDto {
|
|
144
145
|
constructor(frame) {
|