@eturnity/eturnity_3d 6.37.1 → 6.37.2-EPDM-7379.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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eturnity/eturnity_3d",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "6.37.
|
|
4
|
+
"version": "6.37.2-EPDM-7379.0",
|
|
5
5
|
"main": "dist/main.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "vue-cli-service serve --skip-plugins @vue/cli-plugin-eslint",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"prettier": "prettier --write \"**/*.{js,vue}\""
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@eturnity/eturnity_maths": "6.37.0",
|
|
13
|
+
"@eturnity/eturnity_maths": "6.37.0-EPDM-7379.0",
|
|
14
14
|
"axios": "^1.3.2",
|
|
15
15
|
"core-js": "^2.6.12",
|
|
16
16
|
"cors": "^2.8.5",
|
|
@@ -34,6 +34,7 @@ export default {
|
|
|
34
34
|
1,
|
|
35
35
|
1000
|
|
36
36
|
),
|
|
37
|
+
layers:null,
|
|
37
38
|
provider: null,
|
|
38
39
|
cameraProjection: null,
|
|
39
40
|
texture: null,
|
|
@@ -128,7 +129,8 @@ export default {
|
|
|
128
129
|
hydrateData: 'hydrateData'
|
|
129
130
|
}),
|
|
130
131
|
...mapMutations({
|
|
131
|
-
setModuleTextureVersionId: 'mutate_moduleTextureVersionId'
|
|
132
|
+
setModuleTextureVersionId: 'mutate_moduleTextureVersionId',
|
|
133
|
+
setSelectedMapLayer: 'mutate_selectedMapLayer'
|
|
132
134
|
}),
|
|
133
135
|
hideMesh(mesh){
|
|
134
136
|
if(mesh){
|
package/src/helper/threeMixin.js
CHANGED
|
@@ -2,14 +2,37 @@ import * as THREE from 'three'
|
|
|
2
2
|
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls'
|
|
3
3
|
import { Sky } from 'three/examples/jsm/objects/Sky.js'
|
|
4
4
|
import { CustomProvider } from './customProvider'
|
|
5
|
+
import getLayers from '../utils/layers'
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
8
|
methods: {
|
|
8
9
|
initialiseThreeMap() {
|
|
9
10
|
//Extention of the map with geo-map
|
|
11
|
+
if (!this.selectedMapLayer) {
|
|
12
|
+
this.setInitialMapLayer()
|
|
13
|
+
}
|
|
10
14
|
this.provider = new CustomProvider('', this.selectedMapLayer.key)
|
|
11
15
|
this.renderTiles()
|
|
12
16
|
},
|
|
17
|
+
setInitialMapLayer() {
|
|
18
|
+
if (!this.layers || this.layers.length == 0) {
|
|
19
|
+
this.layers = getLayers()
|
|
20
|
+
}
|
|
21
|
+
this.setSelectedMapLayer(null)
|
|
22
|
+
|
|
23
|
+
if (this.selectedMapLayer === null) {
|
|
24
|
+
for (var i in this.layers) {
|
|
25
|
+
if (this.globalProjectProperties && this.layers[i].key === this.globalProjectProperties.map_type) {
|
|
26
|
+
this.setSelectedMapLayer(this.layers[i])
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (this.selectedMapLayer === null) {
|
|
32
|
+
this.setSelectedMapLayer(this.layers[7])
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
|
|
13
36
|
initSky() {
|
|
14
37
|
// Add Sky
|
|
15
38
|
let sky = new Sky()
|
|
@@ -35,7 +58,6 @@ export default {
|
|
|
35
58
|
sun = null
|
|
36
59
|
},
|
|
37
60
|
initialiseThree(isInteractive = true) {
|
|
38
|
-
|
|
39
61
|
this.scene.background = new THREE.Color(0xb0b0b0)
|
|
40
62
|
|
|
41
63
|
this.camera.position.set(0, -100, 50)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Point, Line } from '@eturnity/eturnity_maths'
|
|
2
2
|
import { mmTolerance } from '../config'
|
|
3
3
|
import {
|
|
4
|
-
|
|
4
|
+
isAlmostSamePoint3D,
|
|
5
5
|
isAlmostSameSegment2D,
|
|
6
|
-
|
|
6
|
+
isAlmostSameSegment3D,
|
|
7
7
|
isAlmostSamePoint2D
|
|
8
8
|
} from '@eturnity/eturnity_maths'
|
|
9
9
|
|
|
@@ -74,6 +74,7 @@ export function generateNodes2D(polygons) {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
export function generateNodes3D(polygons) {
|
|
77
|
+
console.log('generate Node 3d')
|
|
77
78
|
let nodes3D = []
|
|
78
79
|
polygons
|
|
79
80
|
.filter((poly) =>
|
|
@@ -83,7 +84,9 @@ export function generateNodes3D(polygons) {
|
|
|
83
84
|
const outline = polygon.outline
|
|
84
85
|
outline.forEach((point, i) => {
|
|
85
86
|
//check if nodes2D already exist
|
|
86
|
-
let node3D = nodes3D.find((node) =>
|
|
87
|
+
let node3D = nodes3D.find((node) =>
|
|
88
|
+
isAlmostSamePoint3D(node, point, mmTolerance)
|
|
89
|
+
)
|
|
87
90
|
if (!node3D) {
|
|
88
91
|
node3D = new Point(point.x, point.y, point.z, polygon.layer)
|
|
89
92
|
node3D.belongsTo = []
|
|
@@ -176,8 +179,11 @@ export function generateEdges3D(polygons) {
|
|
|
176
179
|
//check if edge2D already exist
|
|
177
180
|
const nextPoint = outline[(i + 1) % outline.length]
|
|
178
181
|
let edge3D = edges3D.find((edge) => {
|
|
179
|
-
|
|
180
|
-
|
|
182
|
+
isAlmostSameSegment3D(
|
|
183
|
+
[point, nextPoint],
|
|
184
|
+
edge.outline,
|
|
185
|
+
mmTolerance
|
|
186
|
+
) && edge.layer == polygon.layer
|
|
181
187
|
})
|
|
182
188
|
if (!edge3D) {
|
|
183
189
|
//create an edge at this position
|