@eturnity/eturnity_3d 7.2.2-qa-7.2.7 → 7.2.2-qa-7.2.8

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": "7.2.2-qa-7.2.7",
4
+ "version": "7.2.2-qa-7.2.8",
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": "7.2.2-qa-7.2.4",
13
+ "@eturnity/eturnity_maths": "7.2.2-qa-7.2.6",
14
14
  "core-js": "^2.6.12",
15
15
  "cors": "^2.8.5",
16
16
  "earcut": "^2.2.4",
@@ -33,7 +33,7 @@ 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
38
  return intersectionArea > 100 && moduleField.area <= roof.area
39
39
  })
@@ -7,6 +7,21 @@ import {
7
7
  } from '@eturnity/eturnity_maths'
8
8
  import getLayers from '../utils/layers'
9
9
  import { UpdateRoofObstacleRelations } from '../helper/UpdateRoofObstacleRelations'
10
+ function sanitizedOutline(outline) {
11
+ return outline.reduce((accumulator, currentValue) => {
12
+ if (
13
+ !accumulator.find(
14
+ (p) =>
15
+ p[0] == currentValue[0] &&
16
+ p[1] == currentValue[1] &&
17
+ p[2] == currentValue[2]
18
+ )
19
+ ) {
20
+ accumulator.push(currentValue)
21
+ }
22
+ return accumulator
23
+ }, [])
24
+ }
10
25
  export async function hydratePolygons({
11
26
  roofsResponse,
12
27
  obstaclesResponse,
@@ -17,18 +32,24 @@ export async function hydratePolygons({
17
32
  //removing empty roof,obstacle and modulefield generated by BE on variant creation
18
33
  roofsResponse = roofsResponse.reduce((acc, cur) => {
19
34
  if (cur.roof_outline.length > 0) {
35
+ let outline = sanitizedOutline(cur.roof_outline)
36
+ cur.roof_outline = outline
20
37
  acc.push(cur)
21
38
  }
22
39
  return acc
23
40
  }, [])
24
41
  obstaclesResponse = obstaclesResponse.reduce((acc, cur) => {
25
42
  if (cur.obstacle_outline.length > 0) {
43
+ let outline = sanitizedOutline(cur.obstacle_outline)
44
+ cur.obstacle_outline = outline
26
45
  acc.push(cur)
27
46
  }
28
47
  return acc
29
48
  }, [])
30
49
  moduleFieldsResponse = moduleFieldsResponse.reduce((acc, cur) => {
31
50
  if (cur.module_field_outline.length > 0) {
51
+ let outline = sanitizedOutline(cur.module_field_outline)
52
+ cur.module_field_outline = outline
32
53
  acc.push(cur)
33
54
  }
34
55
  return acc