@eturnity/eturnity_3d 6.46.3 → 6.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,7 +1,7 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_3d",
3
3
  "private": false,
4
- "version": "6.46.3",
4
+ "version": "6.48.0",
5
5
  "main": "dist/main.js",
6
6
  "scripts": {
7
7
  "dev": "vue-cli-service serve --skip-plugins @vue/cli-plugin-eslint",
@@ -10,7 +10,7 @@
10
10
  "prettier": "prettier --write \"**/*.{js,vue}\""
11
11
  },
12
12
  "dependencies": {
13
- "@eturnity/eturnity_maths": "6.46.0",
13
+ "@eturnity/eturnity_maths": "6.48.0",
14
14
  "axios": "^1.3.2",
15
15
  "core-js": "^2.6.12",
16
16
  "cors": "^2.8.5",
@@ -74,4 +74,4 @@
74
74
  "> 1%",
75
75
  "last 2 versions"
76
76
  ]
77
- }
77
+ }
@@ -61,11 +61,13 @@ export default {
61
61
  },
62
62
  screenshotable: false,
63
63
  areModuleFieldsVisible: false,
64
- intervalId: null
64
+ intervalId: null,
65
+ requestAnimationFrameId: null,
65
66
  }
66
67
  },
67
68
  beforeDestroy() {
68
69
  clearInterval(this.intervalId)
70
+ cancelAnimationFrame(this.requestAnimationFrameId)
69
71
  },
70
72
  mixins: [renderMixin, threeMixin, materialMixin],
71
73
  async mounted() {
@@ -286,7 +288,7 @@ export default {
286
288
  },
287
289
  animate() {
288
290
  this.render()
289
- requestAnimationFrame(this.animate)
291
+ this.requestAnimationFrameId = requestAnimationFrame(this.animate)
290
292
  },
291
293
  render() {
292
294
  this.renderer.clear()
@@ -33,9 +33,9 @@ export function UpdateRoofModuleFieldRelations(state) {
33
33
  //check if everypoint is in the same roof and if they are not too far from the flat surface.(at least above)
34
34
  let roofPolygonCandidates = roofPolygons.filter((roof) => {
35
35
  const intersection = intersectOutlines(moduleField.outline, roof.outline)
36
- if (intersection.length == 0) return false
36
+ if (intersection.length == 0) return false
37
37
  const intersectionArea = calculateArea(intersection[0])
38
- return intersectionArea > 100
38
+ return intersectionArea > 100 && moduleField.area <= roof.area
39
39
  })
40
40
  //roofs on roof can lead to multiple roof under a point. moduleField is on the smallest
41
41
  let smallestRoof = null
@@ -46,7 +46,6 @@ export function UpdateRoofModuleFieldRelations(state) {
46
46
  }
47
47
  let roofPolygon = smallestRoof
48
48
  if (!roofPolygon) {
49
- //no roof found under first node of moduleField => moduleField will be deleted
50
49
  continue
51
50
  }
52
51
  roofPolygon.moduleFields.push(moduleField)
@@ -76,14 +76,11 @@ export default {
76
76
  }
77
77
  },
78
78
  setTweenTo(position, target) {
79
+ TWEEN.removeAll()
79
80
  if (this.orbitControl) {
80
81
  this.tweenOrbit = new TWEEN.Tween(this.orbitControl.target)
81
82
  .to({ x: target[0], y: target[1], z: target[2] }, 2000)
82
83
  .easing(TWEEN.Easing.Sinusoidal.Out)
83
- .onUpdate(() => {
84
- if (this.orbitControl && this.orbitControl.update)
85
- this.orbitControl.update()
86
- })
87
84
  .start()
88
85
  }
89
86
  if (this.camera) {
@@ -97,5 +94,8 @@ export default {
97
94
  .start()
98
95
  }
99
96
  }
97
+ },
98
+ beforeDestroy(){
99
+ TWEEN.removeAll()
100
100
  }
101
101
  }