@eturnity/eturnity_3d 6.29.0-qa.0 → 6.29.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.
Files changed (43) hide show
  1. package/package.json +6 -6
  2. package/src/components/ThreeCanvasViewer.vue +2 -8
  3. package/src/config.js +0 -1
  4. package/src/helper/DFS.js +80 -0
  5. package/src/helper/clearThreeObjects.js +21 -0
  6. package/src/helper/{render/geometryHandler.js → geometryHandler.js} +1 -1
  7. package/src/helper/graphCreation.js +43 -0
  8. package/src/helper/projectedMaterial.js +502 -0
  9. package/src/helper/renderMixin.js +777 -7
  10. package/src/helper/threeMixin.js +4 -3
  11. package/src/utils/layers.js +1 -1
  12. package/dist/assets/images/panels/longiSolarLR4_60HPH_350M.png +0 -0
  13. package/dist/assets/images/panels/longiSolarLR4_60HPH_370M.png +0 -0
  14. package/dist/assets/images/panels/reneSola_Virtus_2_JC320S_24_Bbw copy.png +0 -0
  15. package/dist/assets/images/panels/reneSola_Virtus_2_JC320S_24_Bbw.png +0 -0
  16. package/dist/assets/images/panels/uv.png +0 -0
  17. package/dist/assets/panels/longiSolarLR4_60HPH_350M.png +0 -0
  18. package/dist/assets/panels/longiSolarLR4_60HPH_370M.png +0 -0
  19. package/dist/assets/panels/reneSola_Virtus_2_JC320S_24_Bbw.png +0 -0
  20. package/dist/assets/panels/uv.png +0 -0
  21. package/dist/assets/theme.js +0 -43
  22. package/dist/assets/vue.svg +0 -1
  23. package/dist/css/main.d97599b7.css +0 -1
  24. package/dist/img/longiSolarLR4_60HPH_350M.85a84b2e.png +0 -0
  25. package/dist/img/longiSolarLR4_60HPH_370M.bf6b1f4e.png +0 -0
  26. package/dist/img/reneSola_Virtus_2_JC320S_24_Bbw.8b1892e0.png +0 -0
  27. package/dist/index.html +0 -26
  28. package/dist/main.js +0 -60562
  29. package/dist/main.js.map +0 -1
  30. package/dist/vite.svg +0 -1
  31. package/src/helper/cameraMixin.js +0 -95
  32. package/src/helper/render/background.js +0 -40
  33. package/src/helper/render/base.js +0 -43
  34. package/src/helper/render/clear.js +0 -93
  35. package/src/helper/render/edge.js +0 -85
  36. package/src/helper/render/index.js +0 -16
  37. package/src/helper/render/loader.js +0 -97
  38. package/src/helper/render/margin.js +0 -72
  39. package/src/helper/render/moduleField.js +0 -27
  40. package/src/helper/render/node.js +0 -47
  41. package/src/helper/render/obstacle.js +0 -61
  42. package/src/helper/render/panel.js +0 -88
  43. package/src/helper/render/roof.js +0 -134
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_3d",
3
3
  "private": false,
4
- "version": "6.29.0-qa.0",
4
+ "version": "6.29.0",
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.28.0-EPDM-7663.0",
11
+ "@eturnity/eturnity_maths": "6.28.0",
12
12
  "axios": "^1.3.2",
13
- "core-js": "^2.6.12",
14
13
  "cors": "^2.8.5",
14
+ "core-js": "^2.6.12",
15
15
  "earcut": "^2.2.4",
16
16
  "express": "^4.18.2",
17
17
  "geo-three": "^0.1.11",
@@ -19,12 +19,12 @@
19
19
  "leaflet.gridlayer.googlemutant": "^0.14.0",
20
20
  "svd-js": "^1.1.1",
21
21
  "three": "^0.149.0",
22
- "three-projected-material": "2.2.1",
23
- "tween": "0.9.0",
24
22
  "uuid": "^9.0.0",
25
23
  "vue": "^2.7.14",
26
24
  "vue-template-compiler": "^2.7.14",
27
- "vuex": "^3.0.1"
25
+ "vuex": "^3.0.1",
26
+ "three-projected-material": "2.2.1",
27
+ "tween": "0.9.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@babel/core": "^7.21.0",
@@ -110,6 +110,8 @@ export default {
110
110
  let margin=0.2
111
111
  if (!polygon || view_mode == 'global') {
112
112
  let roofsBounds = this.roofsBounds
113
+ //let distance = 5 + objectRadius / Math.sin(((this.orthographicCamera.fov / 2) * Math.PI) / 180)
114
+ //console.log('distance:',distance)
113
115
  const position = [0, 0, 100]
114
116
  const target = [0, 0, 0]
115
117
  this.orthographicCamera.position.set(...position)
@@ -238,14 +240,6 @@ export default {
238
240
  },
239
241
  render() {
240
242
  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
243
  if (['top', 'global'].includes(this.view_mode)) {
250
244
  this.renderer.render(this.scene, this.orthographicCamera)
251
245
  } else {
package/src/config.js CHANGED
@@ -75,7 +75,6 @@ export const defaultTextureUrls = [
75
75
  textureImageDomain+'textures/longiSolarLR4_60HPH_370M.png',
76
76
  textureImageDomain+'textures/longiSolarLR4_60HPH_350M.png',
77
77
  ]
78
-
79
78
  export const hitOption = {
80
79
  segments: true,
81
80
  stroke: true,
@@ -0,0 +1,80 @@
1
+
2
+ // Javascript program to print DFS
3
+ // traversal from a given
4
+ // graph
5
+
6
+ // This class represents a
7
+ // directed graph using adjacency
8
+ // list representation
9
+ export class Graph
10
+ {
11
+
12
+ // Constructor
13
+ //v=number of vertices
14
+ constructor()
15
+ {
16
+ this.visited=[]
17
+ this.dict= []
18
+ this.adj = []
19
+
20
+ }
21
+
22
+ // Function to add an edge into the graph
23
+ addEdge(uuid1, uuid2)
24
+ {
25
+ let v=this.dict.indexOf(uuid1)
26
+ let length
27
+ if(v==-1){
28
+ length=this.dict.length
29
+ this.dict[length]=uuid1
30
+ this.adj[length]=[]
31
+ v=length
32
+ }
33
+ let w=this.dict.indexOf(uuid2)
34
+ if(w==-1){
35
+ length=this.dict.length
36
+ this.dict[length]=uuid2
37
+ this.adj[length]=[]
38
+ w=length
39
+ }
40
+ // Add w to v's list.
41
+ if(!this.adj[v]){this.adj[v]=[]}
42
+ this.adj[v].push(w);
43
+ if(!this.adj[w]){this.adj[w]=[]}
44
+ this.adj[w].push(v);
45
+ }
46
+
47
+ // A function used by DFS
48
+ DFSUtil(v, visited)
49
+ {
50
+
51
+ // Mark the current node as visited and print it
52
+ visited[v] = true;
53
+ this.visited.push(v)
54
+
55
+ // Recur for all the vertices adjacent to this
56
+ // vertex
57
+ for(let i in this.adj[v])
58
+ {
59
+ let n = this.adj[v][i]
60
+ if (!visited[n])
61
+ this.DFSUtil(n, visited);
62
+ }
63
+ }
64
+
65
+ // The function to do DFS traversal.
66
+ // It uses recursive
67
+ // DFSUtil()
68
+ DFS(uuidStart){
69
+ let v=this.dict.indexOf(uuidStart)
70
+ // Mark all the vertices as
71
+ // not visited(set as
72
+ // false by default in java)
73
+ let visited = [];
74
+ // Call the recursive helper
75
+ // function to print DFS
76
+ // traversal
77
+ this.DFSUtil(v, visited);
78
+ return [...new Set(this.visited.map((i)=>{return this.dict[i]}))]
79
+ }
80
+ }
@@ -0,0 +1,21 @@
1
+ export default function clearThreeObject(obj) {
2
+ while (obj.children.length > 0) {
3
+ clearThreeObject(obj.children[0])
4
+ obj.remove(obj.children[0])
5
+ }
6
+ if (obj.geometry) obj.geometry.dispose()
7
+ if (obj.texture) obj.texture.dispose()
8
+
9
+ if (obj.material) {
10
+ //in case of map, bumpMap, normalMap, envMap ...
11
+ Object.keys(obj.material).forEach((prop) => {
12
+ if (!obj.material[prop]) return
13
+ if (
14
+ obj.material[prop] !== null &&
15
+ typeof obj.material[prop].dispose === 'function'
16
+ )
17
+ obj.material[prop].dispose()
18
+ })
19
+ obj.material.dispose()
20
+ }
21
+ }
@@ -1,5 +1,5 @@
1
1
  import * as THREE from 'three'
2
- import { defaultBaseHeight } from '../../config'
2
+ import { defaultBaseHeight } from '../config'
3
3
  import earcut from 'earcut'
4
4
  import {
5
5
  verticalProjectionOnPlane,
@@ -0,0 +1,43 @@
1
+ import {Graph} from './DFS'
2
+ import {
3
+ isSameSegment2D,
4
+ } from '@eturnity/eturnity_maths'
5
+ export function generateGraph(polygons){
6
+ const edges2D=[]
7
+ const g=new Graph()
8
+ polygons
9
+ .filter((poly) => poly.layer=='roof')
10
+ .forEach((polygon,index) => {
11
+ g.dict.push(polygon.id)
12
+ const outline = polygon.outline
13
+ outline.forEach((point, i) => {
14
+ //check if edge2D already exist
15
+ const nextPoint = outline[(i + 1) % outline.length]
16
+ let edge2D = edges2D.find((edge) => {
17
+ return (
18
+ isSameSegment2D([point, nextPoint], edge.outline)
19
+ )
20
+ })
21
+ if (!edge2D) {
22
+ //create an edge at this position
23
+ edge2D = {}
24
+ edge2D.outline=[point, nextPoint]
25
+ edge2D.belongsTo = []
26
+ edges2D.push(edge2D)
27
+ }
28
+ //add BelongToPolygon
29
+ edge2D.belongsTo.push({
30
+ polygonId: polygon.id,
31
+ index: i,
32
+ polygon
33
+ })
34
+ })
35
+ })
36
+ for(let k in edges2D){
37
+ let edge=edges2D[k]
38
+ if(edge.belongsTo.length==2){
39
+ g.addEdge(edge.belongsTo[0].polygonId,edge.belongsTo[1].polygonId)
40
+ }
41
+ }
42
+ return g
43
+ }