@eturnity/eturnity_3d 6.31.1 → 6.32.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 CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_3d",
3
3
  "private": false,
4
- "version": "6.31.1",
4
+ "version": "6.32.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.31.1",
11
+ "@eturnity/eturnity_maths": "6.32.0",
12
12
  "axios": "^1.3.2",
13
13
  "core-js": "^2.6.12",
14
14
  "cors": "^2.8.5",
package/src/config.js CHANGED
@@ -65,7 +65,7 @@ export const maxMargin=2500
65
65
  export const node3DRadius=0.05
66
66
  export const beamColor="#ffffff"
67
67
  export const node3DColor="white"
68
- export const beamOpacity=0.3
68
+ export const beamOpacity=0.4
69
69
  export const node3dOpacity=0.3
70
70
  export const dimMarginColor='#ff000020'
71
71
  export const defaultTextureUrl=require('./assets/images/panels/reneSola_Virtus_2_JC320S_24_Bbw.png')
@@ -1,6 +1,43 @@
1
1
  import * as THREE from 'three'
2
2
  export default {
3
3
  methods:{
4
+ setCylinderPosition(cylinder,edge){
5
+ const point_0 = new THREE.Vector3(
6
+ edge.outline[0].x / 1000,
7
+ edge.outline[0].y / 1000,
8
+ edge.outline[0].z / 1000
9
+ )
10
+ const point_1 = new THREE.Vector3(
11
+ edge.outline[1].x / 1000,
12
+ edge.outline[1].y / 1000,
13
+ edge.outline[1].z / 1000
14
+ )
15
+
16
+ const midPoint = point_0.clone().add(point_1).multiplyScalar(0.5)
17
+ var direction = new THREE.Vector3().subVectors(point_1, point_0)
18
+ let length = direction.length()
19
+
20
+
21
+
22
+
23
+
24
+ //cylinder.rotation.set(arrow.rotation)
25
+ var axis = new THREE.Vector3(0, 1, 0)
26
+ cylinder.quaternion.setFromUnitVectors(
27
+ axis,
28
+ direction.clone().normalize()
29
+ )
30
+ //cylinder.position.set(new THREE.Vector3().addVectors( pointX, direction.multiplyScalar(0.5) ))
31
+ cylinder.position.copy(midPoint.clone())
32
+ let oldLength = cylinder.userData.cylinderLength
33
+ let newLength = length
34
+ if (!oldLength || oldLength != 0) {
35
+ cylinder.scale.set(1, newLength, 1)
36
+ cylinder.userData.cylinderLength = newLength
37
+ }
38
+ cylinder.updateMatrix()
39
+ return cylinder
40
+ },
4
41
  renderEdges() {
5
42
  this.clearEdgesRemovedOnes('edgeMeshes')
6
43
  let cylinder
@@ -14,67 +51,16 @@ export default {
14
51
  cylinder = this.meshes.edgeMeshes[edge.id]
15
52
  if (cylinder) {
16
53
  //update
17
- const point_0 = new THREE.Vector3(
18
- edge.outline[0].x / 1000,
19
- edge.outline[0].y / 1000,
20
- edge.outline[0].z / 1000
21
- )
22
- const point_1 = new THREE.Vector3(
23
- edge.outline[1].x / 1000,
24
- edge.outline[1].y / 1000,
25
- edge.outline[1].z / 1000
26
- )
27
- const midPoint = point_0.clone().add(point_1).multiplyScalar(0.5)
28
- var direction = new THREE.Vector3().subVectors(point_1, point_0)
29
- let length = direction.length()
30
- //cylinder.rotation.set(arrow.rotation)
31
- var axis = new THREE.Vector3(0, 1, 0)
32
- cylinder.quaternion.setFromUnitVectors(
33
- axis,
34
- direction.clone().normalize()
35
- )
36
- //cylinder.position.set(new THREE.Vector3().addVectors( pointX, direction.multiplyScalar(0.5) ))
37
- cylinder.position.copy(midPoint.clone())
38
- let oldLength = cylinder.userData.cylinderLength
39
- let newLength = length
40
- if (oldLength != 0) {
41
- let scaleRatio = newLength / oldLength
42
- //let scaleVector=direction.multiplyScalar(scaleRatio-1)
43
- cylinder.scale.set(1, newLength, 1)
44
- cylinder.userData.cylinderLength = newLength
45
- }
46
- cylinder.updateMatrix()
54
+ this.setCylinderPosition(cylinder,edge)
47
55
  //change cylinder length
48
56
  } else {
49
- const point_0 = new THREE.Vector3(
50
- edge.outline[0].x / 1000,
51
- edge.outline[0].y / 1000,
52
- edge.outline[0].z / 1000
53
- )
54
- const point_1 = new THREE.Vector3(
55
- edge.outline[1].x / 1000,
56
- edge.outline[1].y / 1000,
57
- edge.outline[1].z / 1000
58
- )
59
-
60
- const midPoint = point_0.clone().add(point_1).multiplyScalar(0.5)
61
- var direction = new THREE.Vector3().subVectors(point_1, point_0)
62
- let length = direction.length()
57
+
63
58
  const geometry = new THREE.CylinderGeometry(0.1, 0.1, 1, 6)
64
59
  cylinder = new THREE.Mesh(geometry, material)
65
- cylinder.scale.set(1, length, 1)
66
- cylinder.userData.cylinderLength = length
67
- //cylinder.rotation.set(arrow.rotation)
68
- var axis = new THREE.Vector3(0, 1, 0)
69
- cylinder.quaternion.setFromUnitVectors(
70
- axis,
71
- direction.clone().normalize()
72
- )
73
- //cylinder.position.set(new THREE.Vector3().addVectors( pointX, direction.multiplyScalar(0.5) ))
74
- cylinder.position.copy(midPoint.clone())
75
- //cylinder.position.set(edge.outline[0].x/1000, edge.outline[0].y/1000, edge.outline[0].z/1000);
60
+ cylinder=this.setCylinderPosition(cylinder,edge)
61
+
76
62
  cylinder.userData.edgeId = edge.id
77
- cylinder.matrixAutoUpdate = false
63
+
78
64
  this.meshes.edgeMeshes[edge.id] = cylinder
79
65
  this.scene.add(cylinder)
80
66
 
Binary file
Binary file
@@ -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
@@ -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%}
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>