@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 +1 -1
- package/src/objects/Polygon.js +9 -7
package/package.json
CHANGED
package/src/objects/Polygon.js
CHANGED
|
@@ -170,20 +170,22 @@ export class Polygon {
|
|
|
170
170
|
this.outline = this.outline.map((point) => {
|
|
171
171
|
return translate2D(point, vectorInMm)
|
|
172
172
|
})
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
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,
|