@eturnity/eturnity_3d 7.20.1 → 7.24.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 +2 -2
- package/src/EventManager/EventManager.js +48 -0
- package/src/Item/Item.js +12 -0
- package/src/Layer/Layer.js +119 -0
- package/src/Overlay/AirTeamOverlay.js +605 -0
- package/src/Overlay/ImageOverlay.js +309 -0
- package/src/Overlay/Overlay.js +255 -0
- package/src/Overlay/OverlayFactory.js +19 -0
- package/src/Overlay/OverlayLayer.js +36 -0
- package/src/components/ThreeCanvasViewer.vue +17 -6
- package/src/config.js +120 -17
- package/src/helper/UpdateRoofModuleFieldRelations.js +65 -25
- package/src/helper/cameraMixin.js +25 -0
- package/src/helper/materialMixin.js +14 -1
- package/src/helper/projectedMaterial.js +662 -0
- package/src/helper/render/base.js +5 -5
- package/src/helper/render/clear.js +0 -17
- package/src/helper/render/edge.js +2 -0
- package/src/helper/render/geometryHandler.js +60 -31
- package/src/helper/render/imageOverlay.js +25 -144
- package/src/helper/render/index.js +2 -0
- package/src/helper/render/mergedGeometry.js +11 -2
- package/src/helper/render/obstacle.js +2 -1
- package/src/helper/render/overlay.js +41 -0
- package/src/helper/render/projectionMaterial.js +17 -19
- package/src/helper/render/roof.js +49 -52
- package/src/helper/render/texture.js +25 -0
- package/src/helper/render/tile.js +84 -24
- package/src/helper/render/tileProjection.js +23 -14
- package/src/helper/renderMixin.js +22 -8
- package/src/helper/threeMixin.js +5 -2
- package/src/store/hydrateData.js +23 -11
- package/src/store/nodesEdgesCreation.js +78 -4
- package/src/store/three-d-module.js +1 -1
- package/dist/css/app.58568098.css +0 -1
- package/dist/img/reneSola_Virtus_2_JC320S_24_Bbw.85a0cb6d.png +0 -0
- package/dist/index.html +0 -15
- package/dist/js/app-legacy.aa792c98.js +0 -2
- package/dist/js/app-legacy.aa792c98.js.map +0 -1
- package/dist/js/chunk-vendors-legacy.9bb3863d.js +0 -41
- package/dist/js/chunk-vendors-legacy.9bb3863d.js.map +0 -1
package/src/config.js
CHANGED
|
@@ -12,19 +12,38 @@ export const layerColors = {
|
|
|
12
12
|
construction: {
|
|
13
13
|
fillColor: 'transparent',
|
|
14
14
|
strokeColor: theme.colors.blueElectric,
|
|
15
|
-
strokeWidth:
|
|
15
|
+
strokeWidth: 2
|
|
16
|
+
},
|
|
17
|
+
obstacleConstruction: {
|
|
18
|
+
fillColor: 'transparent',
|
|
19
|
+
strokeColor: theme.colors.red,
|
|
20
|
+
strokeWidth: 2
|
|
16
21
|
},
|
|
17
22
|
roof: {
|
|
18
23
|
fillColor: 'rgba(255, 255, 255, 0.1)',
|
|
19
24
|
strokeColor: 'white',
|
|
20
25
|
strokeWidth: 0
|
|
21
26
|
},
|
|
27
|
+
hoveredRoof: {
|
|
28
|
+
fillColor: '#0068DE30',
|
|
29
|
+
strokeColor: 'white',
|
|
30
|
+
strokeWidth: 0
|
|
31
|
+
},
|
|
32
|
+
hoveredObstacle: {
|
|
33
|
+
fillColor: theme.colors.transparentRed20,
|
|
34
|
+
strokeColor: theme.colors.red,
|
|
35
|
+
strokeWidth: 0
|
|
36
|
+
},
|
|
22
37
|
roofInside: {
|
|
23
38
|
fillColor: 'rgba(255, 255, 255, 0.1)',
|
|
24
39
|
strokeColor: 'white',
|
|
25
40
|
strokeWidth: 1
|
|
26
41
|
},
|
|
27
|
-
obstacle: {
|
|
42
|
+
obstacle: {
|
|
43
|
+
fillColor: theme.colors.transparentRed10,
|
|
44
|
+
strokeColor: theme.colors.red,
|
|
45
|
+
strokeWidth: 2
|
|
46
|
+
},
|
|
28
47
|
panel: {
|
|
29
48
|
fillColor: 'rgba(115, 115, 229, 0.1)',
|
|
30
49
|
strokeColor: '#ffffff',
|
|
@@ -33,7 +52,7 @@ export const layerColors = {
|
|
|
33
52
|
user_deactivated_panel: {
|
|
34
53
|
fillColor: 'rgba(115, 115, 229, 0.1)',
|
|
35
54
|
strokeColor: 'white',
|
|
36
|
-
strokeWidth:
|
|
55
|
+
strokeWidth: 2
|
|
37
56
|
},
|
|
38
57
|
selectedPanel: {
|
|
39
58
|
fillColor: '#0068DE80',
|
|
@@ -41,21 +60,91 @@ export const layerColors = {
|
|
|
41
60
|
strokeWidth: 1
|
|
42
61
|
},
|
|
43
62
|
snap: { fillColor: 'transparent', strokeColor: 'white' },
|
|
63
|
+
snapTargetObstacle: { fillColor: theme.colors.red },
|
|
64
|
+
snapTarget: { fillColor: theme.colors.blueElectric },
|
|
44
65
|
moduleField: {
|
|
45
|
-
fillColor: 'rgba(255, 255, 255, 0.
|
|
66
|
+
fillColor: 'rgba(255, 255, 255, 0.2)',
|
|
67
|
+
strokeColor: 'transparent',
|
|
68
|
+
strokeWidth: 1
|
|
69
|
+
},
|
|
70
|
+
hoveredModuleFieldEdge: {
|
|
71
|
+
strokeColor: theme.colors.blue,
|
|
72
|
+
strokeWidth: 6
|
|
73
|
+
},
|
|
74
|
+
moduleFieldBaseLineEdge: {
|
|
75
|
+
strokeColor: theme.colors.purple2,
|
|
76
|
+
strokeWidth: 6
|
|
77
|
+
},
|
|
78
|
+
node: {
|
|
46
79
|
strokeColor: 'white',
|
|
47
|
-
|
|
80
|
+
fillColor: 'rgba(255, 255, 255, 0.1)',
|
|
81
|
+
strokeWidth: 2
|
|
82
|
+
},
|
|
83
|
+
obstacleNode: {
|
|
84
|
+
strokeColor: theme.colors.red,
|
|
85
|
+
fillColor: 'rgba(255, 255, 255, 0.1)',
|
|
86
|
+
strokeWidth: 2
|
|
87
|
+
},
|
|
88
|
+
hoveredEdge: { strokeColor: theme.colors.blueElectric, strokeWidth: 3 },
|
|
89
|
+
hoveredNode: {
|
|
90
|
+
strokeColor: theme.colors.blueElectric,
|
|
91
|
+
strokeWidth: 6,
|
|
92
|
+
fillColor: '#48a2d080'
|
|
93
|
+
},
|
|
94
|
+
hoveredObstacleNode: {
|
|
95
|
+
strokeColor: theme.colors.red,
|
|
96
|
+
strokeWidth: 2,
|
|
97
|
+
fillColor: theme.colors.transparentRed50
|
|
98
|
+
},
|
|
99
|
+
hoveredMasterHandle: {
|
|
100
|
+
strokeColor: theme.colors.blueElectric,
|
|
101
|
+
strokeWidth: 3,
|
|
102
|
+
fillColor: 'black'
|
|
103
|
+
},
|
|
104
|
+
subHandleLink: { strokeColor: '#ffffffa0', strokeWidth: 2 },
|
|
105
|
+
selectedEdge: { strokeColor: theme.colors.blue, strokeWidth: 3 },
|
|
106
|
+
selectedEdgeObstacle: {
|
|
107
|
+
strokeColor: theme.colors.darkRed,
|
|
108
|
+
strokeWidth: 4
|
|
109
|
+
},
|
|
110
|
+
hoveredEdgeObstacle: {
|
|
111
|
+
strokeColor: theme.colors.pureRed,
|
|
112
|
+
strokeWidth: 2
|
|
113
|
+
},
|
|
114
|
+
selectedNode: {
|
|
115
|
+
strokeColor: theme.colors.blue,
|
|
116
|
+
strokeWidth: 2,
|
|
117
|
+
fillColor: theme.colors.blue
|
|
118
|
+
},
|
|
119
|
+
selectedObstacleNode: {
|
|
120
|
+
strokeColor: theme.colors.darkRed,
|
|
121
|
+
strokeWidth: 2,
|
|
122
|
+
fillColor: theme.colors.pureRed
|
|
123
|
+
},
|
|
124
|
+
hoveredModuleField: {
|
|
125
|
+
fillColor: '#0068DE30',
|
|
126
|
+
strokeColor: theme.colors.blueElectric,
|
|
127
|
+
strokeWidth: 5
|
|
48
128
|
},
|
|
49
|
-
hoveredModuleFieldEdge: { strokeColor: theme.colors.blue, strokeWidth: 6 },
|
|
50
129
|
tmpModuleField: {
|
|
51
|
-
fillColor: 'rgba(115, 115, 229, 0.
|
|
130
|
+
fillColor: 'rgba(115, 115, 229, 0.2)',
|
|
52
131
|
strokeColor: theme.colors.blue,
|
|
53
|
-
strokeWidth:
|
|
132
|
+
strokeWidth: 1
|
|
54
133
|
},
|
|
55
134
|
selectedModuleField: {
|
|
56
|
-
fillColor: '#
|
|
135
|
+
fillColor: '#0068DEA0',
|
|
57
136
|
strokeColor: theme.colors.blue,
|
|
58
|
-
strokeWidth:
|
|
137
|
+
strokeWidth: 2
|
|
138
|
+
},
|
|
139
|
+
selectableModuleField: {
|
|
140
|
+
fillColor: 'rgba(255, 255, 255, 0.2)',
|
|
141
|
+
strokeColor: 'transparent',
|
|
142
|
+
strokeWidth: 2
|
|
143
|
+
},
|
|
144
|
+
overrideNumberOfPanelsModuleField: {
|
|
145
|
+
fillColor: '#fc8b0080',
|
|
146
|
+
strokeColor: 'transparent',
|
|
147
|
+
strokeWidth: 1
|
|
59
148
|
},
|
|
60
149
|
highlight: {
|
|
61
150
|
fillColor: 'rgba(255, 255, 255, 0.2)',
|
|
@@ -65,23 +154,28 @@ export const layerColors = {
|
|
|
65
154
|
selectedRoof: {
|
|
66
155
|
fillColor: '#0068DE80',
|
|
67
156
|
strokeColor: 'white',
|
|
68
|
-
strokeWidth:
|
|
157
|
+
strokeWidth: 2
|
|
69
158
|
},
|
|
70
159
|
selectedObstacle: {
|
|
71
|
-
fillColor:
|
|
72
|
-
strokeColor: theme.colors.
|
|
73
|
-
strokeWidth:
|
|
160
|
+
fillColor: theme.colors.transparentRed50,
|
|
161
|
+
strokeColor: theme.colors.red,
|
|
162
|
+
strokeWidth: 1
|
|
74
163
|
},
|
|
75
164
|
selectedAndHighlighted: {
|
|
76
165
|
fillColor: '#0068DEA0',
|
|
77
166
|
strokeColor: theme.colors.blue,
|
|
78
|
-
strokeWidth:
|
|
167
|
+
strokeWidth: 2
|
|
79
168
|
},
|
|
80
169
|
flatWarning: {
|
|
81
170
|
fillColor: '#ffff0090',
|
|
82
171
|
strokeColor: 'yellow',
|
|
83
172
|
strokeWidth: 1
|
|
84
173
|
},
|
|
174
|
+
flatSelectedWarning: {
|
|
175
|
+
fillColor: '#a0a00090',
|
|
176
|
+
strokeColor: 'yellow',
|
|
177
|
+
strokeWidth: 1
|
|
178
|
+
},
|
|
85
179
|
customLength: {
|
|
86
180
|
fillColor: 'transparent',
|
|
87
181
|
strokeColor: theme.colors.blueElectric,
|
|
@@ -94,8 +188,8 @@ export const layerColors = {
|
|
|
94
188
|
},
|
|
95
189
|
inclineDirectionArrow: {
|
|
96
190
|
fillColor: 'transparent',
|
|
97
|
-
strokeColor:
|
|
98
|
-
strokeWidth:
|
|
191
|
+
strokeColor: theme.colors.orange,
|
|
192
|
+
strokeWidth: 4
|
|
99
193
|
},
|
|
100
194
|
inclineLabel: {
|
|
101
195
|
fillColor: theme.colors.transparentBlack1,
|
|
@@ -104,6 +198,15 @@ export const layerColors = {
|
|
|
104
198
|
directionLabel: {
|
|
105
199
|
fillColor: theme.colors.transparentBlack1,
|
|
106
200
|
textColor: 'white'
|
|
201
|
+
},
|
|
202
|
+
imageOverlayHandle: {
|
|
203
|
+
fillColor: 'transparent',
|
|
204
|
+
strokeColor: theme.colors.blueElectric,
|
|
205
|
+
strokeWidth: 3
|
|
206
|
+
},
|
|
207
|
+
angleLabelColor: {
|
|
208
|
+
strokeColor: theme.colors.orange,
|
|
209
|
+
fillColor: theme.colors.orange
|
|
107
210
|
}
|
|
108
211
|
}
|
|
109
212
|
|
|
@@ -13,42 +13,80 @@ export function UpdateRoofModuleFieldRelations(state) {
|
|
|
13
13
|
const panelPolygons = state.polygons.filter((poly) =>
|
|
14
14
|
['panel', 'user_deactivated_panel'].includes(poly.layer)
|
|
15
15
|
)
|
|
16
|
+
panelPolygons.forEach((panel) => {
|
|
17
|
+
panel.roof = null
|
|
18
|
+
})
|
|
16
19
|
//let's remove all moduleFields from roofs
|
|
20
|
+
|
|
17
21
|
roofPolygons.forEach((roofPolygon) => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
roofPolygon.moduleFields[k] = null
|
|
22
|
+
if (!roofPolygon.moduleFields) {
|
|
23
|
+
roofPolygon.moduleFields = []
|
|
21
24
|
}
|
|
22
|
-
roofPolygon.moduleFields
|
|
25
|
+
roofPolygon.moduleFields.filter((mf) => {
|
|
26
|
+
moduleFieldPolygons.some((p) => p.id == mf.id)
|
|
27
|
+
})
|
|
23
28
|
})
|
|
24
29
|
moduleFieldPolygons.forEach((moduleFieldPolygon) => {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
if (
|
|
31
|
+
moduleFieldPolygon.roof &&
|
|
32
|
+
!roofPolygons.some((r) => r.id == moduleFieldPolygon.roof.id)
|
|
33
|
+
) {
|
|
34
|
+
moduleFieldPolygon.roof = null
|
|
35
|
+
}
|
|
29
36
|
})
|
|
30
37
|
|
|
31
38
|
for (let k in moduleFieldPolygons) {
|
|
32
39
|
const moduleField = moduleFieldPolygons[k]
|
|
33
|
-
|
|
34
|
-
let roofPolygonCandidates = roofPolygons.filter((roof) => {
|
|
35
|
-
const intersection = intersectOutlines(moduleField.outline, roof.outline)
|
|
36
|
-
if (intersection.length == 0) return false
|
|
37
|
-
const intersectionArea = calculateArea(intersection[0])
|
|
38
|
-
return intersectionArea > 100 && moduleField.area <= roof.area + 0.1
|
|
39
|
-
})
|
|
40
|
-
//roofs on roof can lead to multiple roof under a point. moduleField is on the smallest
|
|
41
|
-
let smallestRoof = null
|
|
42
|
-
for (let roof of roofPolygonCandidates) {
|
|
43
|
-
if (!smallestRoof || smallestRoof.area > roof.area) {
|
|
44
|
-
smallestRoof = roof
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
let roofPolygon = smallestRoof
|
|
40
|
+
let roofPolygon = moduleField.roof
|
|
48
41
|
if (!roofPolygon) {
|
|
49
|
-
|
|
42
|
+
//check if everypoint is in the same roof and if they are not too far from the flat surface.(at least above)
|
|
43
|
+
let roofPolygonCandidates = roofPolygons.map((roof) => {
|
|
44
|
+
const intersection = intersectOutlines(
|
|
45
|
+
moduleField.outline,
|
|
46
|
+
roof.outline
|
|
47
|
+
)
|
|
48
|
+
if (intersection.length == 0) {
|
|
49
|
+
return {
|
|
50
|
+
roof,
|
|
51
|
+
intersectionArea: 0,
|
|
52
|
+
intersectionRatio: 0,
|
|
53
|
+
areaRatio: 0,
|
|
54
|
+
roofBiggerThanModuleField: 1
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const intersectionArea_m2 = calculateArea(intersection[0]) / 1e6
|
|
58
|
+
return {
|
|
59
|
+
roof,
|
|
60
|
+
intersectionArea: intersectionArea_m2,
|
|
61
|
+
intersectionRatio: (intersectionArea_m2 / roof.area).toFixed(3),
|
|
62
|
+
areaRatio: (moduleField.area / roof.area).toFixed(3),
|
|
63
|
+
roofBiggerThanModuleField: roof.area >= moduleField.area ? 1 : -1
|
|
64
|
+
}
|
|
65
|
+
})
|
|
66
|
+
//roofs on roof can lead to multiple roof under a point. moduleField is on the smallest
|
|
67
|
+
|
|
68
|
+
roofPolygonCandidates
|
|
69
|
+
.sort((a, b) => b.roof.area - a.roof.area)
|
|
70
|
+
.sort((a, b) => a.intersectionArea - b.intersectionArea)
|
|
71
|
+
.sort(
|
|
72
|
+
(a, b) => a.roofBiggerThanModuleField - b.roofBiggerThanModuleField
|
|
73
|
+
)
|
|
74
|
+
let polygonCandidate = roofPolygonCandidates.pop()
|
|
75
|
+
if (!polygonCandidate) {
|
|
76
|
+
continue
|
|
77
|
+
}
|
|
78
|
+
roofPolygon = polygonCandidate.roof
|
|
79
|
+
if (!roofPolygon) {
|
|
80
|
+
continue
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
roofPolygon.moduleFields.push(moduleField)
|
|
50
84
|
}
|
|
51
|
-
roofPolygon.
|
|
85
|
+
roofPolygon = roofPolygons.find((r) => r.id == roofPolygon.id)
|
|
86
|
+
roofPolygon.moduleFields = [
|
|
87
|
+
...roofPolygon.moduleFields.filter((mf) => mf.id != moduleField.id),
|
|
88
|
+
moduleField
|
|
89
|
+
]
|
|
52
90
|
moduleField.roof = roofPolygon
|
|
53
91
|
moduleField.panels.forEach((panel) => (panel.roof = roofPolygon))
|
|
54
92
|
panelPolygons.forEach((p) => {
|
|
@@ -72,7 +110,9 @@ export function UpdateRoofModuleFieldRelations(state) {
|
|
|
72
110
|
return panelPolygons.find((panel) => panel.id == p.id)
|
|
73
111
|
})
|
|
74
112
|
state = { ...state, polygons: newPolygons }
|
|
113
|
+
|
|
75
114
|
state = removeModuleFieldAndPanelsOnNoOrMultipleRoofs(state)
|
|
115
|
+
|
|
76
116
|
return state
|
|
77
117
|
}
|
|
78
118
|
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
substractVector
|
|
9
9
|
} from '@eturnity/eturnity_maths'
|
|
10
10
|
import { marginAroundBuildingForCameraViewInMeter } from '../config'
|
|
11
|
+
import OverlayLayer from '../Overlay/OverlayLayer'
|
|
11
12
|
export default {
|
|
12
13
|
data() {
|
|
13
14
|
return {
|
|
@@ -352,6 +353,19 @@ export default {
|
|
|
352
353
|
this.orbitControl.update()
|
|
353
354
|
}
|
|
354
355
|
},
|
|
356
|
+
setCameraToOverlay(overlayId) {
|
|
357
|
+
const overlay = OverlayLayer.findById(overlayId)
|
|
358
|
+
if (overlay) {
|
|
359
|
+
const targetVector = overlay.positionOffset
|
|
360
|
+
const target = [
|
|
361
|
+
targetVector.x / 1000,
|
|
362
|
+
targetVector.y / 1000,
|
|
363
|
+
targetVector.z / 1000
|
|
364
|
+
]
|
|
365
|
+
const position = [target[0], target[1] - 20, target[2] + 50]
|
|
366
|
+
this.setTweenTo({ position, target })
|
|
367
|
+
}
|
|
368
|
+
},
|
|
355
369
|
setCameraGlobalPosition() {
|
|
356
370
|
if (this.roofs.length == 0) return
|
|
357
371
|
if (this.camera.isOrthographicCamera) {
|
|
@@ -597,6 +611,17 @@ export default {
|
|
|
597
611
|
if (!!TWEEN) {
|
|
598
612
|
TWEEN.update()
|
|
599
613
|
}
|
|
614
|
+
let waitingBall = this.scene.getObjectByName('waitingBall')
|
|
615
|
+
if (waitingBall) {
|
|
616
|
+
const time = Date.now() * 0.001 // Get current time in seconds
|
|
617
|
+
const period = 3 // 3 seconds for a full cycle
|
|
618
|
+
const scale =
|
|
619
|
+
4 + 4 * Math.abs(Math.sin(((2 * Math.PI) / period) * time)) // Scale between 5 and 25
|
|
620
|
+
|
|
621
|
+
// Update the sphere's scale
|
|
622
|
+
waitingBall.scale.set(scale, scale, scale)
|
|
623
|
+
this.render()
|
|
624
|
+
}
|
|
600
625
|
this.animationFrameId = requestAnimationFrame(this.animate)
|
|
601
626
|
}
|
|
602
627
|
},
|
|
@@ -24,7 +24,9 @@ export default {
|
|
|
24
24
|
|
|
25
25
|
this.material.wall = new THREE.MeshLambertMaterial({
|
|
26
26
|
color: wallColor,
|
|
27
|
-
side: THREE.DoubleSide
|
|
27
|
+
side: THREE.DoubleSide,
|
|
28
|
+
transparent: true,
|
|
29
|
+
opacity: this.wallColor == '#ffffff00' ? 0.2 : 1
|
|
28
30
|
})
|
|
29
31
|
|
|
30
32
|
this.material.obstacle = new THREE.MeshPhongMaterial({
|
|
@@ -79,7 +81,13 @@ export default {
|
|
|
79
81
|
opacity: 0.2,
|
|
80
82
|
side: THREE.DoubleSide
|
|
81
83
|
})
|
|
84
|
+
this.material.projectionTiles = []
|
|
85
|
+
|
|
82
86
|
this.material.roof = [this.material.wall]
|
|
87
|
+
this.material.selectedRoof = [this.material.wall]
|
|
88
|
+
this.material.hoveredRoof = [this.material.wall]
|
|
89
|
+
this.material.warningRoof = [this.material.wall]
|
|
90
|
+
this.material.selectedWarningRoof = [this.material.wall]
|
|
83
91
|
|
|
84
92
|
this.material.flatRoof = new THREE.MeshPhongMaterial({
|
|
85
93
|
color: 0x00ff00,
|
|
@@ -144,6 +152,11 @@ export default {
|
|
|
144
152
|
wallColor(color) {
|
|
145
153
|
let wallColor = new THREE.Color(color)
|
|
146
154
|
this.material.wall.color.set(wallColor)
|
|
155
|
+
if (color == '#ffffff00') {
|
|
156
|
+
this.material.wall.opacity = 0.2
|
|
157
|
+
} else {
|
|
158
|
+
this.material.wall.opacity = 1
|
|
159
|
+
}
|
|
147
160
|
}
|
|
148
161
|
}
|
|
149
162
|
}
|