@eturnity/eturnity_3d 1.0.43-EPDM-7327 → 1.0.44

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": "1.0.43-EPDM-7327",
4
+ "version": "1.0.44",
5
5
  "main": "dist/main.js",
6
6
  "scripts": {
7
7
  "dev": "vue-cli-service serve --skip-plugins @vue/cli-plugin-eslint",
@@ -104,7 +104,7 @@ export default {
104
104
  hydrateData: 'hydrateData'
105
105
  }),
106
106
  ...mapMutations({
107
- setModuleTextureVersionId: 'mutate_moduleTextureVersionId'
107
+ set_module_texture_version_id: 'mutate_module_texture_version_id'
108
108
  }),
109
109
  setCamera(polygon, view_mode) {
110
110
  let margin=0.2
@@ -159,7 +159,6 @@ export default {
159
159
  //const target=[targetVector.x/1000,targetVector.y/1000,targetVector.z/1000]
160
160
  let cameraMoveVector = { x: 0, y: 0, z: 0 }
161
161
  console.log('normalVector:', polygonRef.normalVector)
162
- let flatRoof=polygonRef.normalVector.x==0 && polygonRef.normalVector.y==0
163
162
  if (view_mode == 'ortho') {
164
163
  cameraMoveVector = multiplyVector(
165
164
  distance * 1000,
@@ -190,12 +189,12 @@ export default {
190
189
  if (horizontalVector.x == 0 && horizontalVector.y == 0) {
191
190
  //if flat roof=> go south
192
191
  horizontalVector.y = 1
192
+
193
193
  }
194
194
  cameraMoveVector = multiplyVector(distance * 2000, horizontalVector)
195
195
  }
196
196
 
197
197
  const positionVector = addVector(polygonRef.meanPoint, cameraMoveVector)
198
- if(flatRoof) positionVector.z+=2000
199
198
  const position = [
200
199
  positionVector.x / 1000,
201
200
  positionVector.y / 1000 - 1,
@@ -17,7 +17,7 @@ material.edge=new THREE.MeshPhongMaterial({ color: beamColor,transparent:true,op
17
17
  material.node=new THREE.PointsMaterial( { size: 0.05, sizeAttenuation: true,color: node3DColor, opacity:node3dOpacity, transparent: true } );
18
18
  const loader = new THREE.TextureLoader()
19
19
  // texture.minFilter = THREE.LinearFilter
20
- material.panel={}
20
+ material.panel={}
21
21
 
22
22
  for(let k=0;k<defaultTextureUrls.length;k++){
23
23
  let texture=loader.load(defaultTextureUrls[k], function (texture) {})
@@ -26,6 +26,7 @@ material.node=new THREE.PointsMaterial( { size: 0.05, sizeAttenuation: true,colo
26
26
  side: THREE.DoubleSide,
27
27
  })
28
28
  }
29
+ console.log('panel texture:',material.panel)
29
30
 
30
31
  material.flatRoof = new THREE.MeshPhongMaterial({
31
32
  color: 0x00ff00,
@@ -79,7 +79,7 @@ export default {
79
79
 
80
80
  computed: {
81
81
  ...mapState({
82
- moduleTextureVersionId: (state) => state.threeDModule.moduleTextureVersionId,
82
+ module_texture_version_id: (state) => state.threeDModule.module_texture_version_id,
83
83
  selectedMapLayer: (state) => state.threeDModule.selectedMapLayer,
84
84
  pvDataMemo: (state) => state.threeDModule.pvDataMemo
85
85
  }),
@@ -776,8 +776,10 @@ export default {
776
776
 
777
777
  this.panels.forEach((panelPolygon) => {
778
778
  //definition of the material
779
+ console.log('panelPolygon.moduleField.data.number_of_panels_override',panelPolygon.moduleField.data.number_of_panels_override)
779
780
  if(panelPolygon.moduleField.data.number_of_panels_override) return
780
- let material = this.material.panel['default_'+this.moduleTextureVersionId]
781
+ console.log('material panel:','default_'+this.module_texture_version_id,this.material.panel)
782
+ let material = this.material.panel['default_'+this.module_texture_version_id]
781
783
  if (panelPolygon.moduleField.pvData) {
782
784
  let pvId = panelPolygon.moduleField.pvData.id
783
785
  if (this.material.panel[pvId]) {
@@ -825,7 +827,6 @@ export default {
825
827
  topMesh.geometry=updateBufferPanelGeometry(panelPolygon,topMesh.geometry)
826
828
  sideMesh.geometry=updateBufferPanelSideGeometry(panelPolygon,sideMesh.geometry)
827
829
  }
828
- let pvId = panelPolygon.moduleField.pvData.id
829
830
  topMesh.material= material
830
831
 
831
832
  }
@@ -36,9 +36,10 @@ export async function hydrateData({ state, commit }, data) {
36
36
 
37
37
  if (!!layoutSettingResponse) {
38
38
  const layoutSetting = layoutSettingResponse
39
-
39
+ const module_texture_version_id=layoutSetting.module_texture_version_id || 0
40
+ console.log("module_texture_version_id",module_texture_version_id)
40
41
  commit('mutate_layoutSettings', layoutSetting)
41
- commit('mutate_moduleTextureVersionId', layoutSetting.module_texture_version_id)
42
+ commit('mutate_module_texture_version_id', module_texture_version_id)
42
43
  let layers=getLayers()
43
44
  let selectedLayer=layers.find(layer=>layer.key==layoutSetting.background_map_settings.layerKey)
44
45
  commit('mutate_selectedMapLayer', selectedLayer)
@@ -164,38 +165,7 @@ export async function hydrateData({ state, commit }, data) {
164
165
  //Get PV & Mounting system component Data (texture):
165
166
  pv_module_ids = [...new Set(pv_module_ids)]
166
167
  mounting_system_ids = [...new Set(mounting_system_ids)]
167
- const promiseList = []
168
- // for (let k in pv_module_ids) {
169
- // promiseList.push(
170
- // axios.get('/component_library/products/pv_modules/' + pv_module_ids[k])
171
- // )
172
- // }
173
- // for (let k in mounting_system_ids) {
174
- // promiseList.push(
175
- // axios.get(
176
- // '/component_library/products/mounting_systems/' + mounting_system_ids[k]
177
- // )
178
- // )
179
- // }
180
- // const results = await Promise.all(promiseList)
181
- // for (let k in pv_module_ids) {
182
- // const pv_module_id = pv_module_ids[k]
183
- // const pvData = results[k].data
184
- // moduleFields.forEach((m) => {
185
- // if (m.data.component_id_pv_module == pv_module_id) {
186
- // m.pvData = pvData
187
- // }
188
- // })
189
- // }
190
- // for (let k in mounting_system_ids) {
191
- // const mounting_system_id = mounting_system_ids[k]
192
- // const mountingData = results[parseInt(k) + pv_module_ids.length].data
193
- // moduleFields.forEach((m) => {
194
- // if (m.data.component_id_mounting_system == mounting_system_id) {
195
- // m.mountingData = mountingData
196
- // }
197
- // })
198
- // }
168
+
199
169
  state.polygons = [
200
170
  ...roofs,
201
171
  ...obstacles,
@@ -30,7 +30,7 @@ const init_state = {
30
30
  //useless state for viewer
31
31
  pvDataMemo:[],
32
32
  mountingDataMemo:[],
33
- moduleTextureVersionId:0,
33
+ module_texture_version_id:0,
34
34
  selectedMapLayer:null,
35
35
  globalProjectProperties: [],
36
36
  }
@@ -129,8 +129,11 @@ const mutations = {
129
129
  mutate_buildingLocation(state, value) {
130
130
  state.buildingLocation = value
131
131
  },
132
- mutate_moduleTextureVersionId(state,value){
133
- state.moduleTextureVersionId=value
132
+ mutate_module_texture_version_id(state,value){
133
+ state.module_texture_version_id=value
134
+ },
135
+ mutate_module_texture_version_id(state,value){
136
+ state.module_texture_version_id=value
134
137
  },
135
138
  mutate_selectedMapLayer(state,value){
136
139
  state.selectedMapLayer=value