dgeoutils 2.2.6 → 2.2.7
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/dist/DPoint.d.ts +10 -0
- package/dist/DPoint.js +4 -0
- package/dist/DPolygonLoop.d.ts +10 -0
- package/dist/DPolygonLoop.js +35 -23
- package/package.json +1 -1
package/dist/DPoint.d.ts
CHANGED
|
@@ -83,6 +83,16 @@ export declare class DPoint {
|
|
|
83
83
|
* @param f
|
|
84
84
|
*/
|
|
85
85
|
setX(f: SetterFunction): DPoint;
|
|
86
|
+
/**
|
|
87
|
+
* Set `z` value
|
|
88
|
+
* @param z
|
|
89
|
+
*/
|
|
90
|
+
setZ(z: number): DPoint;
|
|
91
|
+
/**
|
|
92
|
+
* Transform `z` value by function
|
|
93
|
+
* @param f
|
|
94
|
+
*/
|
|
95
|
+
setZ(f: SetterFunction): DPoint;
|
|
86
96
|
/**
|
|
87
97
|
* Set `y` value
|
|
88
98
|
* @param y
|
package/dist/DPoint.js
CHANGED
|
@@ -152,6 +152,10 @@ class DPoint {
|
|
|
152
152
|
this.x = typeof x === 'number' ? x : x(this);
|
|
153
153
|
return this;
|
|
154
154
|
}
|
|
155
|
+
setZ(z) {
|
|
156
|
+
this.z = typeof z === 'number' ? z : z(this);
|
|
157
|
+
return this;
|
|
158
|
+
}
|
|
155
159
|
setY(y) {
|
|
156
160
|
this.y = typeof y === 'number' ? y : y(this);
|
|
157
161
|
return this;
|
package/dist/DPolygonLoop.d.ts
CHANGED
|
@@ -39,6 +39,16 @@ export declare class DPolygonLoop {
|
|
|
39
39
|
* @param f
|
|
40
40
|
*/
|
|
41
41
|
setY(f: SetterFunction): DPolygonLoop;
|
|
42
|
+
/**
|
|
43
|
+
* Set `z` value
|
|
44
|
+
* @param z
|
|
45
|
+
*/
|
|
46
|
+
setZ(z: number): DPolygonLoop;
|
|
47
|
+
/**
|
|
48
|
+
* Transform `z` value by function
|
|
49
|
+
* @param f
|
|
50
|
+
*/
|
|
51
|
+
setZ(f: SetterFunction): DPolygonLoop;
|
|
42
52
|
rotate(a: number): DPolygonLoop;
|
|
43
53
|
/**
|
|
44
54
|
* Add `v` to `x` and `y`
|
package/dist/DPolygonLoop.js
CHANGED
|
@@ -8,29 +8,30 @@ var LoopFunctions;
|
|
|
8
8
|
LoopFunctions[LoopFunctions["height"] = 2] = "height";
|
|
9
9
|
LoopFunctions[LoopFunctions["setX"] = 3] = "setX";
|
|
10
10
|
LoopFunctions[LoopFunctions["setY"] = 4] = "setY";
|
|
11
|
-
LoopFunctions[LoopFunctions["
|
|
12
|
-
LoopFunctions[LoopFunctions["
|
|
13
|
-
LoopFunctions[LoopFunctions["
|
|
14
|
-
LoopFunctions[LoopFunctions["
|
|
15
|
-
LoopFunctions[LoopFunctions["
|
|
16
|
-
LoopFunctions[LoopFunctions["
|
|
17
|
-
LoopFunctions[LoopFunctions["
|
|
18
|
-
LoopFunctions[LoopFunctions["
|
|
19
|
-
LoopFunctions[LoopFunctions["
|
|
20
|
-
LoopFunctions[LoopFunctions["
|
|
21
|
-
LoopFunctions[LoopFunctions["
|
|
22
|
-
LoopFunctions[LoopFunctions["
|
|
23
|
-
LoopFunctions[LoopFunctions["
|
|
24
|
-
LoopFunctions[LoopFunctions["
|
|
25
|
-
LoopFunctions[LoopFunctions["
|
|
26
|
-
LoopFunctions[LoopFunctions["
|
|
27
|
-
LoopFunctions[LoopFunctions["
|
|
28
|
-
LoopFunctions[LoopFunctions["
|
|
29
|
-
LoopFunctions[LoopFunctions["
|
|
30
|
-
LoopFunctions[LoopFunctions["
|
|
31
|
-
LoopFunctions[LoopFunctions["
|
|
32
|
-
LoopFunctions[LoopFunctions["
|
|
33
|
-
LoopFunctions[LoopFunctions["
|
|
11
|
+
LoopFunctions[LoopFunctions["setZ"] = 5] = "setZ";
|
|
12
|
+
LoopFunctions[LoopFunctions["rotate"] = 6] = "rotate";
|
|
13
|
+
LoopFunctions[LoopFunctions["move"] = 7] = "move";
|
|
14
|
+
LoopFunctions[LoopFunctions["round"] = 8] = "round";
|
|
15
|
+
LoopFunctions[LoopFunctions["ceil"] = 9] = "ceil";
|
|
16
|
+
LoopFunctions[LoopFunctions["floor"] = 10] = "floor";
|
|
17
|
+
LoopFunctions[LoopFunctions["toFixed"] = 11] = "toFixed";
|
|
18
|
+
LoopFunctions[LoopFunctions["abs"] = 12] = "abs";
|
|
19
|
+
LoopFunctions[LoopFunctions["scale"] = 13] = "scale";
|
|
20
|
+
LoopFunctions[LoopFunctions["divide"] = 14] = "divide";
|
|
21
|
+
LoopFunctions[LoopFunctions["degreeToRadians"] = 15] = "degreeToRadians";
|
|
22
|
+
LoopFunctions[LoopFunctions["radiansToDegrees"] = 16] = "radiansToDegrees";
|
|
23
|
+
LoopFunctions[LoopFunctions["radiansToMeters"] = 17] = "radiansToMeters";
|
|
24
|
+
LoopFunctions[LoopFunctions["metersToRadians"] = 18] = "metersToRadians";
|
|
25
|
+
LoopFunctions[LoopFunctions["hipPoint"] = 19] = "hipPoint";
|
|
26
|
+
LoopFunctions[LoopFunctions["xPoint"] = 20] = "xPoint";
|
|
27
|
+
LoopFunctions[LoopFunctions["yPoint"] = 21] = "yPoint";
|
|
28
|
+
LoopFunctions[LoopFunctions["wPoint"] = 22] = "wPoint";
|
|
29
|
+
LoopFunctions[LoopFunctions["hPoint"] = 23] = "hPoint";
|
|
30
|
+
LoopFunctions[LoopFunctions["setIfLessThan"] = 24] = "setIfLessThan";
|
|
31
|
+
LoopFunctions[LoopFunctions["minus"] = 25] = "minus";
|
|
32
|
+
LoopFunctions[LoopFunctions["degreeToMeters"] = 26] = "degreeToMeters";
|
|
33
|
+
LoopFunctions[LoopFunctions["metersToDegree"] = 27] = "metersToDegree";
|
|
34
|
+
LoopFunctions[LoopFunctions["flipVertically"] = 28] = "flipVertically";
|
|
34
35
|
})(LoopFunctions || (LoopFunctions = {}));
|
|
35
36
|
// eslint-disable-next-line complexity
|
|
36
37
|
const decodePoolRecord = (a, { functionName, pointArg, numberPointArg, numberArg, setterArg }) => {
|
|
@@ -57,6 +58,10 @@ const decodePoolRecord = (a, { functionName, pointArg, numberPointArg, numberArg
|
|
|
57
58
|
res = (k) => a(k)
|
|
58
59
|
.setY(setterArg);
|
|
59
60
|
break;
|
|
61
|
+
case LoopFunctions.setZ:
|
|
62
|
+
res = (k) => a(k)
|
|
63
|
+
.setZ(setterArg);
|
|
64
|
+
break;
|
|
60
65
|
case LoopFunctions.rotate:
|
|
61
66
|
res = (k) => a(k)
|
|
62
67
|
.rotate(numberArg);
|
|
@@ -208,6 +213,13 @@ class DPolygonLoop {
|
|
|
208
213
|
});
|
|
209
214
|
return this;
|
|
210
215
|
}
|
|
216
|
+
setZ(z) {
|
|
217
|
+
this.pool.push({
|
|
218
|
+
functionName: LoopFunctions.setZ,
|
|
219
|
+
setterArg: z
|
|
220
|
+
});
|
|
221
|
+
return this;
|
|
222
|
+
}
|
|
211
223
|
rotate(a) {
|
|
212
224
|
this.pool.push({
|
|
213
225
|
functionName: LoopFunctions.rotate,
|