@eturnity/eturnity_3d 8.34.0 → 8.34.1

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": "8.34.0",
4
+ "version": "8.34.1",
5
5
  "files": [
6
6
  "dist",
7
7
  "src"
package/src/config.js CHANGED
@@ -293,3 +293,9 @@ export const fittingPanelsColorMap = {
293
293
  white: '#ffffff',
294
294
  default: '#0068DE',
295
295
  }
296
+
297
+ export const defaultTextureColorMap = {
298
+ 0: 'blue',
299
+ 1: 'black',
300
+ 2: 'black',
301
+ }
@@ -7,7 +7,7 @@ import {
7
7
  isPolygonInsidePolygon,
8
8
  getConcaveOutlines,
9
9
  } from '@eturnity/eturnity_maths'
10
- import { fittingPanelsColorMap } from '../config'
10
+ import { defaultTextureColorMap, fittingPanelsColorMap } from '../config'
11
11
  //this function just update the "roof" and "moduleField(s)" properties of panels,moduleFields and roofs
12
12
  export function UpdateRoofModuleFieldRelations(state) {
13
13
  let moduleFields = state.polygons.filter(
@@ -106,9 +106,12 @@ export function updateModuleFieldFittingPanels(moduleField) {
106
106
  })
107
107
  })
108
108
 
109
- // map backsheet color to hex color
110
- const backSheetColor = moduleField.pvData?.backsheet_color || 'default'
111
- const mappedColor = fittingPanelsColorMap[backSheetColor]
109
+ const hasCustomTexture = moduleField.pvData?.texture_img_url
110
+ const defaultTextureIndex = moduleField.pvData?.module_texture_version_id || 0
111
+ const color = hasCustomTexture
112
+ ? moduleField.pvData?.backsheet_color
113
+ : defaultTextureColorMap[defaultTextureIndex]
114
+ const mappedColor = fittingPanelsColorMap[color || 'default']
112
115
 
113
116
  moduleField.fittingPanels = {
114
117
  polygons,