@eturnity/eturnity_maths 7.42.2 → 7.48.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_maths",
3
- "version": "7.42.2",
3
+ "version": "7.48.0",
4
4
  "author": "Eturnity Team",
5
5
  "main": "src/index.js",
6
6
  "private": false,
@@ -170,20 +170,22 @@ export class Polygon {
170
170
  this.outline = this.outline.map((point) => {
171
171
  return translate2D(point, vectorInMm)
172
172
  })
173
- if (this.layer == 'moduleField' && this.data && this.data.modules) {
174
- this.data.modules.forEach((module) => {
175
- module.outline.forEach((p) => {
176
- p[0] += vectorInMm.x
177
- p[1] += vectorInMm.y
178
- })
173
+
174
+ if (this.layer == 'moduleField') {
175
+ this.trimedOutline = this.trimedOutline.map((point) => {
176
+ return addVector(point, vectorInMm)
179
177
  })
178
+ } else {
179
+ updateComputedGeometryPolygon(this)
180
180
  }
181
- updateComputedGeometryPolygon(this)
182
181
  }
183
182
  translateOffset(newPositionOffset, center = { x: 0, y: 0 }) {
184
183
  const shift = substractVector(newPositionOffset, this.positionOffset)
185
184
  this.translate(shift)
186
185
  }
186
+ resetOffset() {
187
+ this.positionOffset = { x: 0, y: 0, z: 0 }
188
+ }
187
189
  serialize() {
188
190
  const baseSerialization = {
189
191
  id: this.id,