@eturnity/eturnity_3d 7.10.2-EPDM-10285.0 → 7.10.2-qa-dev03-7.12.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 +1 -1
- package/src/helper/render/geometryHandler.js +26 -40
- package/src/helper/render/roof.js +36 -32
- package/src/store/nodesEdgesCreation.js +7 -51
- package/src/utils/layers.js +32 -18
package/package.json
CHANGED
|
@@ -8,8 +8,7 @@ import {
|
|
|
8
8
|
getNormalVectorFrom3Points,
|
|
9
9
|
hasNaN,
|
|
10
10
|
getDistanceBetweenPoints,
|
|
11
|
-
intersectOutlines
|
|
12
|
-
isSameSegment2D
|
|
11
|
+
intersectOutlines
|
|
13
12
|
} from '@eturnity/eturnity_maths'
|
|
14
13
|
|
|
15
14
|
export function getTriangleVerticesFromOutline(
|
|
@@ -153,7 +152,7 @@ export function getWallVertices(polygon) {
|
|
|
153
152
|
)
|
|
154
153
|
})
|
|
155
154
|
|
|
156
|
-
polygon.holes.forEach((hole
|
|
155
|
+
polygon.holes.forEach((hole) => {
|
|
157
156
|
let obstacleWallOutline =
|
|
158
157
|
intersectOutlines(hole.outline, polygon.outline)[0] || []
|
|
159
158
|
obstacleWallOutline = obstacleWallOutline.map((p) => {
|
|
@@ -166,47 +165,34 @@ export function getWallVertices(polygon) {
|
|
|
166
165
|
).z
|
|
167
166
|
}
|
|
168
167
|
})
|
|
169
|
-
|
|
170
168
|
const lengthHole = obstacleWallOutline.length
|
|
171
169
|
obstacleWallOutline.forEach((p_up_0, index) => {
|
|
172
170
|
const p_up_1 = obstacleWallOutline[(index + 1) % lengthHole]
|
|
173
171
|
const p_bottom_0 = { ...p_up_0, z: 0 }
|
|
174
172
|
const p_bottom_1 = { ...p_up_1, z: 0 }
|
|
175
173
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
p_up_1.x / 1000,
|
|
199
|
-
p_up_1.y / 1000,
|
|
200
|
-
p_up_1.z / 1000,
|
|
201
|
-
p_bottom_0.x / 1000,
|
|
202
|
-
p_bottom_0.y / 1000,
|
|
203
|
-
p_bottom_0.z / 1000,
|
|
204
|
-
p_bottom_1.x / 1000,
|
|
205
|
-
p_bottom_1.y / 1000,
|
|
206
|
-
p_bottom_1.z / 1000
|
|
207
|
-
]
|
|
208
|
-
)
|
|
209
|
-
}
|
|
174
|
+
trianglesVertices.push(
|
|
175
|
+
...[
|
|
176
|
+
p_up_0.x / 1000,
|
|
177
|
+
p_up_0.y / 1000,
|
|
178
|
+
p_up_0.z / 1000,
|
|
179
|
+
p_up_1.x / 1000,
|
|
180
|
+
p_up_1.y / 1000,
|
|
181
|
+
p_up_1.z / 1000,
|
|
182
|
+
p_bottom_0.x / 1000,
|
|
183
|
+
p_bottom_0.y / 1000,
|
|
184
|
+
p_bottom_0.z / 1000,
|
|
185
|
+
p_up_1.x / 1000,
|
|
186
|
+
p_up_1.y / 1000,
|
|
187
|
+
p_up_1.z / 1000,
|
|
188
|
+
p_bottom_0.x / 1000,
|
|
189
|
+
p_bottom_0.y / 1000,
|
|
190
|
+
p_bottom_0.z / 1000,
|
|
191
|
+
p_bottom_1.x / 1000,
|
|
192
|
+
p_bottom_1.y / 1000,
|
|
193
|
+
p_bottom_1.z / 1000
|
|
194
|
+
]
|
|
195
|
+
)
|
|
210
196
|
})
|
|
211
197
|
})
|
|
212
198
|
if (hasNaN(trianglesVertices)) {
|
|
@@ -578,7 +564,7 @@ export function updateBufferPanelSideGeometry(panelPolygon, geometry) {
|
|
|
578
564
|
panelPolygon.outline,
|
|
579
565
|
panelOutlineTop
|
|
580
566
|
)
|
|
581
|
-
|
|
567
|
+
|
|
582
568
|
if (hasNaN(triangleVertices)) {
|
|
583
569
|
return null
|
|
584
570
|
}
|
|
@@ -601,7 +587,7 @@ export function updateBufferPanelSideGeometry(panelPolygon, geometry) {
|
|
|
601
587
|
geometry.attributes.position.needsUpdate = true
|
|
602
588
|
geometry.computeVertexNormals()
|
|
603
589
|
geometry.needsUpdate = true
|
|
604
|
-
|
|
590
|
+
|
|
605
591
|
return geometry
|
|
606
592
|
}
|
|
607
593
|
export function getBufferPanelSideGeometry(panelPolygon) {
|
|
@@ -18,23 +18,25 @@ export default {
|
|
|
18
18
|
methods: {
|
|
19
19
|
updateRoofGeometry(geometry, roofPolygon) {
|
|
20
20
|
const roofOutline = roofPolygon.outline
|
|
21
|
-
let cropedHolesOutline = roofPolygon.holes
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
p,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
21
|
+
let cropedHolesOutline = roofPolygon.holes
|
|
22
|
+
.filter((h) => h.layer == 'obstacle')
|
|
23
|
+
.map((h) => {
|
|
24
|
+
//let's crop obstacle with roof outline
|
|
25
|
+
const cropedHoleOutline =
|
|
26
|
+
intersectOutlines(h.outline, roofPolygon.outline)[0] || []
|
|
27
|
+
const outline = cropedHoleOutline.map((p) => {
|
|
28
|
+
return {
|
|
29
|
+
x: p.x,
|
|
30
|
+
y: p.y,
|
|
31
|
+
z: verticalProjectionOnPlane(
|
|
32
|
+
p,
|
|
33
|
+
roofPolygon.normalVector,
|
|
34
|
+
roofPolygon.flatOutline[0]
|
|
35
|
+
).z
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
return outline
|
|
35
39
|
})
|
|
36
|
-
return outline
|
|
37
|
-
})
|
|
38
40
|
|
|
39
41
|
cropedHolesOutline = cropedHolesOutline.filter((outline) => !!outline)
|
|
40
42
|
geometry = updateBufferRoofGeometry(
|
|
@@ -47,23 +49,25 @@ export default {
|
|
|
47
49
|
},
|
|
48
50
|
createRoofGeometry(roofPolygon) {
|
|
49
51
|
const roofOutline = roofPolygon.outline
|
|
50
|
-
let cropedHolesOutline = roofPolygon.holes
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
p,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
52
|
+
let cropedHolesOutline = roofPolygon.holes
|
|
53
|
+
.filter((h) => h.layer == 'obstacle')
|
|
54
|
+
.map((h) => {
|
|
55
|
+
//let's crop obstacle with roof outline
|
|
56
|
+
const cropedHoleOutline =
|
|
57
|
+
intersectOutlines(h.outline, roofPolygon.outline)[0] || []
|
|
58
|
+
const outline = cropedHoleOutline.map((p) => {
|
|
59
|
+
return {
|
|
60
|
+
x: p.x,
|
|
61
|
+
y: p.y,
|
|
62
|
+
z: verticalProjectionOnPlane(
|
|
63
|
+
p,
|
|
64
|
+
roofPolygon.normalVector,
|
|
65
|
+
roofPolygon.flatOutline[0]
|
|
66
|
+
).z
|
|
67
|
+
}
|
|
68
|
+
})
|
|
69
|
+
return outline
|
|
64
70
|
})
|
|
65
|
-
return outline
|
|
66
|
-
})
|
|
67
71
|
|
|
68
72
|
cropedHolesOutline = cropedHolesOutline.filter((outline) => !!outline)
|
|
69
73
|
let geometry = getBufferRoofGeometry(roofOutline, cropedHolesOutline)
|
|
@@ -4,8 +4,7 @@ import {
|
|
|
4
4
|
isAlmostSamePoint3D,
|
|
5
5
|
isAlmostSameSegment2D,
|
|
6
6
|
isAlmostSameSegment3D,
|
|
7
|
-
isAlmostSamePoint2D
|
|
8
|
-
verticalProjectionOnPlane
|
|
7
|
+
isAlmostSamePoint2D
|
|
9
8
|
} from '@eturnity/eturnity_maths'
|
|
10
9
|
|
|
11
10
|
export function generateNodes2D(polygons) {
|
|
@@ -57,15 +56,14 @@ export function generateNodes2D(polygons) {
|
|
|
57
56
|
if (node2D.masterHandle) {
|
|
58
57
|
node2D.masterHandle.open = node2D.belongsTo.some(
|
|
59
58
|
(item) =>
|
|
60
|
-
item.index == null ||
|
|
61
59
|
item.polygon.outline[item.index].open ||
|
|
62
60
|
item.polygon.outline[item.index].hasWarning
|
|
63
61
|
)
|
|
64
62
|
node2D.masterHandle.hasWarning = node2D.belongsTo.some(
|
|
65
|
-
(item) => item.
|
|
63
|
+
(item) => item.polygon.outline[item.index].hasWarning
|
|
66
64
|
)
|
|
67
65
|
node2D.masterHandle.selected = node2D.belongsTo.every(
|
|
68
|
-
(item) => item.
|
|
66
|
+
(item) => item.polygon.outline[item.index].selected
|
|
69
67
|
)
|
|
70
68
|
}
|
|
71
69
|
})
|
|
@@ -161,62 +159,20 @@ export function generateEdges2D(polygons, splitEdgesIds = []) {
|
|
|
161
159
|
index: i,
|
|
162
160
|
polygon
|
|
163
161
|
})
|
|
164
|
-
if (polygon.roofs && polygon.roofs.length > 0) {
|
|
165
|
-
polygon.roofs.forEach((supportRoof) => {
|
|
166
|
-
edge2D.belongsTo.push({
|
|
167
|
-
polygonId: supportRoof.id,
|
|
168
|
-
index: null,
|
|
169
|
-
polygon: supportRoof
|
|
170
|
-
})
|
|
171
|
-
})
|
|
172
|
-
}
|
|
173
162
|
edge2D.id += '_' + polygon.id + '_' + i
|
|
174
163
|
})
|
|
175
164
|
})
|
|
176
165
|
edges2D.forEach((edge2D) => {
|
|
177
166
|
edge2D.isSplit = splitEdgesIds.includes(edge2D.id)
|
|
178
|
-
if (edge2D.belongsTo.length > 2) {
|
|
179
|
-
edge2D.belongsTo = edge2D.belongsTo.filter((i) => i.index !== null)
|
|
180
|
-
}
|
|
181
167
|
})
|
|
182
168
|
edges2D.forEach((edge2D) => {
|
|
183
169
|
const isNotSplit = edge2D.belongsTo.every((item, index, array) => {
|
|
184
|
-
if (index == 0) {
|
|
185
|
-
return true
|
|
186
|
-
}
|
|
187
170
|
const outline0 = array[0].polygon.outline
|
|
188
171
|
const outline1 = item.polygon.outline
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
} else {
|
|
194
|
-
point0 = verticalProjectionOnPlane(
|
|
195
|
-
outline1[item.index],
|
|
196
|
-
array[0].polygon.normalVector,
|
|
197
|
-
array[0].polygon.flatOutline[0]
|
|
198
|
-
)
|
|
199
|
-
nextPoint0 = verticalProjectionOnPlane(
|
|
200
|
-
outline1[(item.index + 1) % outline1.length],
|
|
201
|
-
array[0].polygon.normalVector,
|
|
202
|
-
array[0].polygon.flatOutline[0]
|
|
203
|
-
)
|
|
204
|
-
}
|
|
205
|
-
if (item.index !== null) {
|
|
206
|
-
point1 = outline1[item.index]
|
|
207
|
-
nextPoint1 = outline1[(item.index + 1) % outline1.length]
|
|
208
|
-
} else {
|
|
209
|
-
point1 = verticalProjectionOnPlane(
|
|
210
|
-
outline0[array[0].index],
|
|
211
|
-
item.polygon.normalVector,
|
|
212
|
-
item.polygon.flatOutline[0]
|
|
213
|
-
)
|
|
214
|
-
nextPoint1 = verticalProjectionOnPlane(
|
|
215
|
-
outline0[(array[0].index + 1) % outline0.length],
|
|
216
|
-
item.polygon.normalVector,
|
|
217
|
-
item.polygon.flatOutline[0]
|
|
218
|
-
)
|
|
219
|
-
}
|
|
172
|
+
const point0 = outline0[array[0].index]
|
|
173
|
+
const nextPoint0 = outline0[(array[0].index + 1) % outline0.length]
|
|
174
|
+
const point1 = outline1[item.index]
|
|
175
|
+
const nextPoint1 = outline1[(item.index + 1) % outline1.length]
|
|
220
176
|
return isAlmostSameSegment3D(
|
|
221
177
|
[point0, nextPoint0],
|
|
222
178
|
[point1, nextPoint1],
|
package/src/utils/layers.js
CHANGED
|
@@ -3,24 +3,38 @@ import 'leaflet.gridlayer.googlemutant'
|
|
|
3
3
|
import { leafletMapLayersConfig } from './leaflet-config.service'
|
|
4
4
|
|
|
5
5
|
function getLayers() {
|
|
6
|
-
const googleLayer = L.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
6
|
+
const googleLayer = L.tileLayer(
|
|
7
|
+
'http://{s}.google.com/vt/lyrs=s,h&x={x}&y={y}&z={z}',
|
|
8
|
+
{
|
|
9
|
+
subdomains: ['mt0', 'mt1', 'mt2', 'mt3'],
|
|
10
|
+
type: 'hybrid',
|
|
11
|
+
layerTypeAPI: 'googleLayer',
|
|
12
|
+
maxNativeZoom: 21,
|
|
13
|
+
maxZoom: 25
|
|
14
|
+
}
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
const googleLayerRoadmap = L.tileLayer(
|
|
18
|
+
'http://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}',
|
|
19
|
+
{
|
|
20
|
+
subdomains: ['mt0', 'mt1', 'mt2', 'mt3'],
|
|
21
|
+
type: 'roadmap',
|
|
22
|
+
layerTypeAPI: 'googleLayerRoadmap',
|
|
23
|
+
maxNativeZoom: 21,
|
|
24
|
+
maxZoom: 25
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
const googleLayerTerrain = L.tileLayer(
|
|
29
|
+
'http://{s}.google.com/vt/lyrs=p&x={x}&y={y}&z={z}',
|
|
30
|
+
{
|
|
31
|
+
subdomains: ['mt0', 'mt1', 'mt2', 'mt3'],
|
|
32
|
+
type: 'terrain',
|
|
33
|
+
layerTypeAPI: 'googleLayerTerrain',
|
|
34
|
+
maxNativeZoom: 21,
|
|
35
|
+
maxZoom: 25
|
|
36
|
+
}
|
|
37
|
+
)
|
|
24
38
|
// TODO activate for different users
|
|
25
39
|
const baseMapLayer = L.tileLayer(
|
|
26
40
|
'http://{s}.wien.gv.at/basemap/geolandbasemap/normal/google3857/{z}/{y}/{x}.png',
|