@eturnity/eturnity_3d 6.29.0-qa.1 → 6.29.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 +2 -2
- package/src/components/ThreeCanvasViewer.vue +0 -8
- package/src/helper/renderMixin.js +154 -0
- package/src/store/hydrateData.js +1 -0
- package/dist/assets/images/panels/longiSolarLR4_60HPH_350M.png +0 -0
- package/dist/assets/images/panels/longiSolarLR4_60HPH_370M.png +0 -0
- package/dist/assets/images/panels/reneSola_Virtus_2_JC320S_24_Bbw copy.png +0 -0
- package/dist/assets/images/panels/reneSola_Virtus_2_JC320S_24_Bbw.png +0 -0
- package/dist/assets/images/panels/uv.png +0 -0
- package/dist/assets/panels/longiSolarLR4_60HPH_350M.png +0 -0
- package/dist/assets/panels/longiSolarLR4_60HPH_370M.png +0 -0
- package/dist/assets/panels/reneSola_Virtus_2_JC320S_24_Bbw.png +0 -0
- package/dist/assets/panels/uv.png +0 -0
- package/dist/assets/theme.js +0 -43
- package/dist/assets/vue.svg +0 -1
- package/dist/css/main.d97599b7.css +0 -1
- package/dist/img/longiSolarLR4_60HPH_350M.85a84b2e.png +0 -0
- package/dist/img/longiSolarLR4_60HPH_370M.bf6b1f4e.png +0 -0
- package/dist/img/reneSola_Virtus_2_JC320S_24_Bbw.8b1892e0.png +0 -0
- package/dist/index.html +0 -26
- package/dist/main.js +0 -60562
- package/dist/main.js.map +0 -1
- package/dist/vite.svg +0 -1
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eturnity/eturnity_3d",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "6.29.
|
|
4
|
+
"version": "6.29.1",
|
|
5
5
|
"main": "dist/main.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "vue-cli-service serve --skip-plugins @vue/cli-plugin-eslint",
|
|
8
8
|
"build": "vue-cli-service build --skip-plugins @vue/cli-plugin-eslint"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@eturnity/eturnity_maths": "6.
|
|
11
|
+
"@eturnity/eturnity_maths": "6.29.0",
|
|
12
12
|
"axios": "^1.3.2",
|
|
13
13
|
"core-js": "^2.6.12",
|
|
14
14
|
"cors": "^2.8.5",
|
|
@@ -238,14 +238,6 @@ export default {
|
|
|
238
238
|
},
|
|
239
239
|
render() {
|
|
240
240
|
this.renderer.clear()
|
|
241
|
-
if (this.orbitControl) {
|
|
242
|
-
this.orbitControl.target.set(
|
|
243
|
-
this.orbitControl.target.x,
|
|
244
|
-
this.orbitControl.target.y,
|
|
245
|
-
2
|
|
246
|
-
)
|
|
247
|
-
this.orbitControl.update()
|
|
248
|
-
}
|
|
249
241
|
if (['top', 'global'].includes(this.view_mode)) {
|
|
250
242
|
this.renderer.render(this.scene, this.orthographicCamera)
|
|
251
243
|
} else {
|
|
@@ -262,7 +262,161 @@ export default {
|
|
|
262
262
|
this.applyTextureOnRoofs()
|
|
263
263
|
this.renderBackground()
|
|
264
264
|
},
|
|
265
|
+
<<<<<<< HEAD
|
|
266
|
+
async loadProjectionMaterial() {
|
|
267
|
+
const _this=this
|
|
268
|
+
if(!this.layoutSettings.base64_image_url)
|
|
269
|
+
{
|
|
270
|
+
this.loader.load(require("../assets/images/white_tile.png"),(texture)=>{
|
|
271
|
+
let projectionMaterial = new ProjectedMaterial({
|
|
272
|
+
camera: _this.cameraprojection,
|
|
273
|
+
texture: texture
|
|
274
|
+
})
|
|
275
|
+
this.material.roof = projectionMaterial
|
|
276
|
+
})
|
|
277
|
+
return
|
|
278
|
+
}
|
|
279
|
+
let projectedMaterialLoaded= await new Promise((resolve,reject) => {
|
|
280
|
+
this.loader.load(this.layoutSettings.base64_image_url,(texture)=>{
|
|
281
|
+
let backgroundImageZoomLvl=_this.layoutSettings.map_zoom
|
|
282
|
+
let backgroundImageCenter={
|
|
283
|
+
lat:_this.layoutSettings.layout_latitude,
|
|
284
|
+
lng:_this.layoutSettings.layout_longitude
|
|
285
|
+
}
|
|
286
|
+
if(_this.layoutSettings.background_map_settings){
|
|
287
|
+
backgroundImageZoomLvl=_this.layoutSettings.background_map_settings.zoom_lvl
|
|
288
|
+
backgroundImageCenter={
|
|
289
|
+
lat:_this.layoutSettings.background_map_settings.lat,
|
|
290
|
+
lng:_this.layoutSettings.background_map_settings.lng
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
_this.backgroundImagesizeInMm=_this.layoutSettings.background_map_settings.sizeInMm
|
|
294
|
+
if (_this.backgroundImagesizeInMm) {
|
|
295
|
+
_this.cameraprojection.aspect =
|
|
296
|
+
_this.backgroundImagesizeInMm.width / _this.backgroundImagesizeInMm.height
|
|
297
|
+
let projectionAltitude =
|
|
298
|
+
_this.backgroundImagesizeInMm.height /
|
|
299
|
+
(2 * Math.tan((_this.cameraprojection.fov * Math.PI) / 360))
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
//set projection camera over background_map_center
|
|
303
|
+
let cameraProjectionPosition={x:0,y:0,z:projectionAltitude / 1000}
|
|
304
|
+
if(_this.layoutSettings.background_map_settings && _this.layoutSettings.background_map_settings.positionInMm){
|
|
305
|
+
// let averageLat=(_this.layoutSettings.layout_latitude+_this.layoutSettings.background_map_settings.lat)/2
|
|
306
|
+
// let deltaLat=_this.layoutSettings.background_map_settings.lat-_this.layoutSettings.layout_latitude
|
|
307
|
+
// let deltaLng=_this.layoutSettings.background_map_settings.lng-_this.layoutSettings.layout_longitude
|
|
308
|
+
// let {x:x_mm,y:y_mm}=deltaLatLngToDistance(deltaLat,deltaLng,averageLat)
|
|
309
|
+
let positionInMm=this.layoutSettings.background_map_settings.positionInMm
|
|
310
|
+
cameraProjectionPosition.x=positionInMm.x/1000
|
|
311
|
+
cameraProjectionPosition.y=positionInMm.y/1000
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
_this.cameraprojection.position.set(cameraProjectionPosition.x, cameraProjectionPosition.y, projectionAltitude / 1000)
|
|
315
|
+
_this.cameraprojection.far = projectionAltitude * 16
|
|
316
|
+
_this.cameraprojection.updateProjectionMatrix()
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
let projectionMaterial = new ProjectedMaterial({
|
|
320
|
+
camera: _this.cameraprojection,
|
|
321
|
+
texture: texture
|
|
322
|
+
})
|
|
323
|
+
resolve(projectionMaterial)
|
|
324
|
+
})
|
|
325
|
+
})
|
|
326
|
+
this.material.roof =projectedMaterialLoaded
|
|
327
|
+
},
|
|
328
|
+
setCameraGlobalPosition() {
|
|
329
|
+
if(this.roofs.length==0)return
|
|
330
|
+
let bounds=this.roofsBounds
|
|
331
|
+
let targetVector={x:(bounds.xMax+bounds.xMin)/2000,y:(bounds.yMax+bounds.yMin)/2000,z:0}
|
|
332
|
+
let objectRadius_m=Math.max((bounds.xMax-bounds.xMin)/2000,(bounds.yMax-bounds.yMin)/2000)
|
|
333
|
+
let distance =
|
|
334
|
+
5 + objectRadius_m / Math.sin(((this.camera.fov / 2) * Math.PI) / 180)
|
|
335
|
+
let cameraMoveVector = { x: 0, y: 0, z: distance }
|
|
336
|
+
const positionVector = addVector(targetVector, cameraMoveVector)
|
|
337
|
+
const position = [
|
|
338
|
+
positionVector.x,
|
|
339
|
+
positionVector.y - distance,
|
|
340
|
+
positionVector.z
|
|
341
|
+
]
|
|
342
|
+
let target=[
|
|
343
|
+
targetVector.x,
|
|
344
|
+
targetVector.y,
|
|
345
|
+
targetVector.z
|
|
346
|
+
]
|
|
347
|
+
|
|
348
|
+
this.setTweenTo(position,target)
|
|
349
|
+
},
|
|
350
|
+
setCameraOrthogonalTo(polygon) {
|
|
351
|
+
if (polygon) {
|
|
352
|
+
let polygonRef = polygon
|
|
353
|
+
const targetVector = polygonRef.meanPoint
|
|
354
|
+
const target = [
|
|
355
|
+
targetVector.x / 1000,
|
|
356
|
+
targetVector.y / 1000,
|
|
357
|
+
targetVector.z / 1000
|
|
358
|
+
]
|
|
359
|
+
const positionVector = addVector(
|
|
360
|
+
polygonRef.meanPoint,
|
|
361
|
+
multiplyVector(45000, polygonRef.normalVector)
|
|
362
|
+
)
|
|
363
|
+
const position = [
|
|
364
|
+
positionVector.x / 1000,
|
|
365
|
+
positionVector.y / 1000 - 1,
|
|
366
|
+
positionVector.z / 1000
|
|
367
|
+
]
|
|
368
|
+
this.setTweenTo(position,target)
|
|
369
|
+
}
|
|
370
|
+
},
|
|
371
|
+
setCameraSideTo(polygon) {
|
|
372
|
+
if (polygon) {
|
|
373
|
+
let polygonRef = polygon
|
|
374
|
+
const targetVector = polygonRef.meanPoint
|
|
375
|
+
const target = [
|
|
376
|
+
targetVector.x / 1000,
|
|
377
|
+
targetVector.y / 1000,
|
|
378
|
+
targetVector.z / 1000
|
|
379
|
+
]
|
|
380
|
+
let sideVector={x:-Math.cos((polygonRef.direction+45)*Math.PI/180),y:Math.sin((polygonRef.direction+45)*Math.PI/180),z: 0}
|
|
381
|
+
const positionVector = addVector(
|
|
382
|
+
polygonRef.meanPoint,
|
|
383
|
+
multiplyVector(45000, sideVector)
|
|
384
|
+
)
|
|
385
|
+
const position = [
|
|
386
|
+
positionVector.x / 1000,
|
|
387
|
+
positionVector.y / 1000,
|
|
388
|
+
positionVector.z / 1000 +5
|
|
389
|
+
]
|
|
390
|
+
this.setTweenTo(position,target)
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
setTweenTo(position,target){
|
|
394
|
+
if (this.orbitControl) {
|
|
395
|
+
this.tweenOrbit = new TWEEN.Tween(this.orbitControl.target)
|
|
396
|
+
.to({ x: target[0], y: target[1], z: target[2] }, 2000)
|
|
397
|
+
.easing(TWEEN.Easing.Sinusoidal.Out)
|
|
398
|
+
.onUpdate(() => {
|
|
399
|
+
if(this.orbitControl){
|
|
400
|
+
this.orbitControl.update()
|
|
401
|
+
}
|
|
402
|
+
})
|
|
403
|
+
.start()
|
|
404
|
+
}
|
|
405
|
+
if (this.camera) {
|
|
406
|
+
this.tweenCamera = new TWEEN.Tween(this.camera.position)
|
|
407
|
+
.to({ x: position[0], y: position[1], z: position[2] }, 2000)
|
|
408
|
+
.easing(TWEEN.Easing.Sinusoidal.Out)
|
|
409
|
+
.onUpdate(() => {
|
|
410
|
+
if(this.orbitControl){
|
|
411
|
+
this.orbitControl.update()
|
|
412
|
+
}
|
|
413
|
+
})
|
|
414
|
+
.start()
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
=======
|
|
265
418
|
|
|
419
|
+
>>>>>>> origin/EPDM-7663
|
|
266
420
|
getCanvasOffset() {
|
|
267
421
|
if (!this.$refs.canvas3DContainer) return { top: 0, left: 0 }
|
|
268
422
|
var box = this.$refs.canvas3DContainer.getBoundingClientRect()
|
package/src/store/hydrateData.js
CHANGED
|
@@ -31,6 +31,7 @@ export async function hydrateData({ state, commit }, data) {
|
|
|
31
31
|
|
|
32
32
|
if (!!layoutSettingResponse) {
|
|
33
33
|
const layoutSetting = layoutSettingResponse
|
|
34
|
+
console.log(layoutSetting)
|
|
34
35
|
const moduleTextureVersionId=layoutSetting.module_texture_version_id || 0
|
|
35
36
|
commit('mutate_layoutSettings', layoutSetting)
|
|
36
37
|
commit('mutate_moduleTextureVersionId',moduleTextureVersionId)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/assets/theme.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
const theme = {
|
|
2
|
-
colors: {
|
|
3
|
-
primary: '#282387',
|
|
4
|
-
secondary: '#818181',
|
|
5
|
-
tertiary: '#d5d5d5',
|
|
6
|
-
black: '#263238',
|
|
7
|
-
yellow: '#fdb813',
|
|
8
|
-
darkGray: '#818181',
|
|
9
|
-
mediumGray: '#d5d5d5',
|
|
10
|
-
lightGray: '#f2f2f2',
|
|
11
|
-
white: '#fff',
|
|
12
|
-
blue: '#48a2d0',
|
|
13
|
-
red: '#FF5656',
|
|
14
|
-
blue1: '#e4efff',
|
|
15
|
-
blue2: '#F6FAFF',
|
|
16
|
-
grey1: '#666',
|
|
17
|
-
grey2: '#c4c4c4',
|
|
18
|
-
grey3: '#b2b9c5',
|
|
19
|
-
grey4: '#dee2eb',
|
|
20
|
-
grey5: '#fafafa',
|
|
21
|
-
grey6: '#555d61',
|
|
22
|
-
turquoise:'#20A4CA',
|
|
23
|
-
green: '#99db0c',
|
|
24
|
-
purple: '#505ca6',
|
|
25
|
-
disabled: '#dfe1e1',
|
|
26
|
-
transparentWhite1: '#ffffff32',
|
|
27
|
-
transparentBlack1: '#263238e6',
|
|
28
|
-
transparentBlue1:'#20a4cae6',
|
|
29
|
-
blueElectric:'#66dffa',
|
|
30
|
-
eturnityGrey: '#263238'
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
screen: {
|
|
34
|
-
mobileSmall: '345px',
|
|
35
|
-
mobile: '425px',
|
|
36
|
-
mobileLarge: '530px',
|
|
37
|
-
tablet: '768px',
|
|
38
|
-
tabletLarge: '950px'
|
|
39
|
-
},
|
|
40
|
-
borderRadius: '4px'
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export default theme
|
package/dist/assets/vue.svg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
#canvas3DContainer,#canvas3DContainer>canvas,.frame[data-v-49199ef8]{width:100%;height:100%}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/index.html
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<link href="/css/main.d97599b7.css" rel="stylesheet"><script type="text/javascript" src="/main.js"></script></head>
|
|
7
|
-
<body>
|
|
8
|
-
<div id="app"></div>
|
|
9
|
-
<div id="app2"></div>
|
|
10
|
-
<div id="app3"></div>
|
|
11
|
-
|
|
12
|
-
<script>
|
|
13
|
-
console.log(ThreeDLayoutView)
|
|
14
|
-
const base_url='http://localhost:8080'
|
|
15
|
-
const geometry={roofs:[],obstacles:[],moduleFields:[],layoutSettings:{}}
|
|
16
|
-
const specificData={uuid:"d5774a28-d71c-4b1d-81bd-5bb4b57d82b6",view_mode:"top",base_url}
|
|
17
|
-
new ThreeDLayoutView().mount("#app",geometry,specificData)
|
|
18
|
-
|
|
19
|
-
const specificData2={uuid:"9cc4d524-a5d3-45f5-9247-8995363cecee",view_mode:"street",base_url}
|
|
20
|
-
new ThreeDLayoutView().mount("#app2",geometry,specificData2)
|
|
21
|
-
|
|
22
|
-
const specificData3={uuid:"5b043153-3b34-4fd2-a247-d2816f3d5e6e",view_mode:"ortho",base_url}
|
|
23
|
-
new ThreeDLayoutView().mount("#app3",geometry,specificData3)
|
|
24
|
-
</script>
|
|
25
|
-
</body>
|
|
26
|
-
</html>
|