dgeoutils 2.4.21 → 2.4.23
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/cjs/TraceMatrix.d.ts +1 -0
- package/dist/cjs/TraceMatrix.js +5 -1
- package/dist/cjs/utils.js +2 -1
- package/dist/es2015/TraceMatrix.js +5 -1
- package/dist/es2015/utils.js +2 -1
- package/dist/esm/TraceMatrix.js +5 -1
- package/dist/esm/utils.js +2 -1
- package/dist/umd/dgeoutils.js +8 -3
- package/dist/umd/dgeoutils.min.js +1 -1
- package/dist/umd/dgeoutils.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ export declare type SimpleMatrix = TraceMatrixValues[][];
|
|
|
8
8
|
export declare class TraceMatrix {
|
|
9
9
|
private readonly size;
|
|
10
10
|
private readonly m;
|
|
11
|
+
approximation: boolean;
|
|
11
12
|
constructor(size: DPoint, f: (p: DPoint) => TraceMatrixValues);
|
|
12
13
|
fullMatrixTrace(): DPolygon[];
|
|
13
14
|
private reverseMatrix;
|
package/dist/cjs/TraceMatrix.js
CHANGED
|
@@ -64,6 +64,7 @@ var TraceMatrix = (function () {
|
|
|
64
64
|
function TraceMatrix(size, f) {
|
|
65
65
|
var _this = this;
|
|
66
66
|
this.size = size;
|
|
67
|
+
this.approximation = true;
|
|
67
68
|
this.findGroupByIndex = function (m, s) {
|
|
68
69
|
var res = new DPolygon_1.DPolygon();
|
|
69
70
|
if (s && getByPosition(m, s) === TraceMatrixValues.t) {
|
|
@@ -149,7 +150,10 @@ var TraceMatrix = (function () {
|
|
|
149
150
|
p = p.clone().move(traceDirections[direction]);
|
|
150
151
|
direction = left(left(direction));
|
|
151
152
|
}
|
|
152
|
-
|
|
153
|
+
if (_this.approximation) {
|
|
154
|
+
return points.approximation().close();
|
|
155
|
+
}
|
|
156
|
+
return points.clone().close();
|
|
153
157
|
};
|
|
154
158
|
this.createHoleMatrix = function (group) {
|
|
155
159
|
var e_1, _a;
|
package/dist/cjs/utils.js
CHANGED
|
@@ -274,6 +274,7 @@ var parseDegreesMinutesSeconds = function (i) {
|
|
|
274
274
|
}
|
|
275
275
|
finally { if (e_1) throw e_1.error; }
|
|
276
276
|
}
|
|
277
|
-
|
|
277
|
+
var h = d < 0 ? -1 : 1;
|
|
278
|
+
return d + h * m / 60 + h * s / 3600;
|
|
278
279
|
};
|
|
279
280
|
exports.parseDegreesMinutesSeconds = parseDegreesMinutesSeconds;
|
|
@@ -23,6 +23,7 @@ const setByPosition = (m, p, value) => {
|
|
|
23
23
|
export class TraceMatrix {
|
|
24
24
|
constructor(size, f) {
|
|
25
25
|
this.size = size;
|
|
26
|
+
this.approximation = true;
|
|
26
27
|
this.findGroupByIndex = (m, s) => {
|
|
27
28
|
const res = new DPolygon();
|
|
28
29
|
if (s && getByPosition(m, s) === TraceMatrixValues.t) {
|
|
@@ -108,7 +109,10 @@ export class TraceMatrix {
|
|
|
108
109
|
p = p.clone().move(traceDirections[direction]);
|
|
109
110
|
direction = left(left(direction));
|
|
110
111
|
}
|
|
111
|
-
|
|
112
|
+
if (this.approximation) {
|
|
113
|
+
return points.approximation().close();
|
|
114
|
+
}
|
|
115
|
+
return points.clone().close();
|
|
112
116
|
};
|
|
113
117
|
this.createHoleMatrix = (group) => {
|
|
114
118
|
const fullTraceDirections = [
|
package/dist/es2015/utils.js
CHANGED
package/dist/esm/TraceMatrix.js
CHANGED
|
@@ -61,6 +61,7 @@ var TraceMatrix = (function () {
|
|
|
61
61
|
function TraceMatrix(size, f) {
|
|
62
62
|
var _this = this;
|
|
63
63
|
this.size = size;
|
|
64
|
+
this.approximation = true;
|
|
64
65
|
this.findGroupByIndex = function (m, s) {
|
|
65
66
|
var res = new DPolygon();
|
|
66
67
|
if (s && getByPosition(m, s) === TraceMatrixValues.t) {
|
|
@@ -146,7 +147,10 @@ var TraceMatrix = (function () {
|
|
|
146
147
|
p = p.clone().move(traceDirections[direction]);
|
|
147
148
|
direction = left(left(direction));
|
|
148
149
|
}
|
|
149
|
-
|
|
150
|
+
if (_this.approximation) {
|
|
151
|
+
return points.approximation().close();
|
|
152
|
+
}
|
|
153
|
+
return points.clone().close();
|
|
150
154
|
};
|
|
151
155
|
this.createHoleMatrix = function (group) {
|
|
152
156
|
var e_1, _a;
|