@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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_3d",
3
3
  "private": false,
4
- "version": "7.10.2-EPDM-10285.0",
4
+ "version": "7.10.2-qa-dev03-7.12.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 +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, holeIndex) => {
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
- const isEdgeConnectedToRoof = !polygon.holes.some((hole, i) => {
177
- return (
178
- holeIndex != i &&
179
- hole.outline.some((p, p_index, outline) => {
180
- let p_next_index = (p_index + 1) % outline.length
181
- return isSameSegment2D([p_up_0, p_up_1], [p, outline[p_next_index]])
182
- })
183
- )
184
- })
185
-
186
- if (isEdgeConnectedToRoof) {
187
- trianglesVertices.push(
188
- ...[
189
- p_up_0.x / 1000,
190
- p_up_0.y / 1000,
191
- p_up_0.z / 1000,
192
- p_up_1.x / 1000,
193
- p_up_1.y / 1000,
194
- p_up_1.z / 1000,
195
- p_bottom_0.x / 1000,
196
- p_bottom_0.y / 1000,
197
- p_bottom_0.z / 1000,
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.map((h) => {
22
- //let's crop obstacle with roof outline
23
- const cropedHoleOutline =
24
- intersectOutlines(h.outline, roofPolygon.outline)[0] || []
25
- const outline = cropedHoleOutline.map((p) => {
26
- return {
27
- x: p.x,
28
- y: p.y,
29
- z: verticalProjectionOnPlane(
30
- p,
31
- roofPolygon.normalVector,
32
- roofPolygon.flatOutline[0]
33
- ).z
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.map((h) => {
51
- //let's crop obstacle with roof outline
52
- const cropedHoleOutline =
53
- intersectOutlines(h.outline, roofPolygon.outline)[0] || []
54
- const outline = cropedHoleOutline.map((p) => {
55
- return {
56
- x: p.x,
57
- y: p.y,
58
- z: verticalProjectionOnPlane(
59
- p,
60
- roofPolygon.normalVector,
61
- roofPolygon.flatOutline[0]
62
- ).z
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.index == null || item.polygon.outline[item.index].hasWarning
63
+ (item) => item.polygon.outline[item.index].hasWarning
66
64
  )
67
65
  node2D.masterHandle.selected = node2D.belongsTo.every(
68
- (item) => item.index == null || item.polygon.outline[item.index].selected
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
- let point0, point1, nextPoint0, nextPoint1
190
- if (array[0].index !== null) {
191
- point0 = outline0[array[0].index]
192
- nextPoint0 = outline0[(array[0].index + 1) % outline0.length]
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],
@@ -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.gridLayer.googleMutant({
7
- type: 'hybrid',
8
- layerTypeAPI: 'googleLayer',
9
- maxNativeZoom: 25,
10
- maxZoom: 25
11
- })
12
- const googleLayerRoadmap = L.gridLayer.googleMutant({
13
- type: 'roadmap',
14
- layerTypeAPI: 'googleLayerRoadmap',
15
- maxNativeZoom: 25,
16
- maxZoom: 25
17
- })
18
- const googleLayerTerrain = L.gridLayer.googleMutant({
19
- type: 'terrain',
20
- layerTypeAPI: 'googleLayerTerrain',
21
- maxNativeZoom: 25,
22
- maxZoom: 25
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',