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.
@@ -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;
@@ -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
- return points.approximation().close();
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
- return d + m / 60 + s / 3600;
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
- return points.approximation().close();
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 = [
@@ -202,5 +202,6 @@ export const parseDegreesMinutesSeconds = (i) => {
202
202
  default:
203
203
  }
204
204
  }
205
- return d + m / 60 + s / 3600;
205
+ const h = d < 0 ? -1 : 1;
206
+ return d + h * m / 60 + h * s / 3600;
206
207
  };
@@ -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
- return points.approximation().close();
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;
package/dist/esm/utils.js CHANGED
@@ -260,5 +260,6 @@ export var parseDegreesMinutesSeconds = function (i) {
260
260
  }
261
261
  finally { if (e_1) throw e_1.error; }
262
262
  }
263
- return d + m / 60 + s / 3600;
263
+ var h = d < 0 ? -1 : 1;
264
+ return d + h * m / 60 + h * s / 3600;
264
265
  };