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 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;
@@ -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`
@@ -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["rotate"] = 5] = "rotate";
12
- LoopFunctions[LoopFunctions["move"] = 6] = "move";
13
- LoopFunctions[LoopFunctions["round"] = 7] = "round";
14
- LoopFunctions[LoopFunctions["ceil"] = 8] = "ceil";
15
- LoopFunctions[LoopFunctions["floor"] = 9] = "floor";
16
- LoopFunctions[LoopFunctions["toFixed"] = 10] = "toFixed";
17
- LoopFunctions[LoopFunctions["abs"] = 11] = "abs";
18
- LoopFunctions[LoopFunctions["scale"] = 12] = "scale";
19
- LoopFunctions[LoopFunctions["divide"] = 13] = "divide";
20
- LoopFunctions[LoopFunctions["degreeToRadians"] = 14] = "degreeToRadians";
21
- LoopFunctions[LoopFunctions["radiansToDegrees"] = 15] = "radiansToDegrees";
22
- LoopFunctions[LoopFunctions["radiansToMeters"] = 16] = "radiansToMeters";
23
- LoopFunctions[LoopFunctions["metersToRadians"] = 17] = "metersToRadians";
24
- LoopFunctions[LoopFunctions["hipPoint"] = 18] = "hipPoint";
25
- LoopFunctions[LoopFunctions["xPoint"] = 19] = "xPoint";
26
- LoopFunctions[LoopFunctions["yPoint"] = 20] = "yPoint";
27
- LoopFunctions[LoopFunctions["wPoint"] = 21] = "wPoint";
28
- LoopFunctions[LoopFunctions["hPoint"] = 22] = "hPoint";
29
- LoopFunctions[LoopFunctions["setIfLessThan"] = 23] = "setIfLessThan";
30
- LoopFunctions[LoopFunctions["minus"] = 24] = "minus";
31
- LoopFunctions[LoopFunctions["degreeToMeters"] = 25] = "degreeToMeters";
32
- LoopFunctions[LoopFunctions["metersToDegree"] = 26] = "metersToDegree";
33
- LoopFunctions[LoopFunctions["flipVertically"] = 27] = "flipVertically";
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dgeoutils",
3
- "version": "2.2.6",
3
+ "version": "2.2.7",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build": "node_modules/.bin/tsc",