maps4fs 1.8.197__py3-none-any.whl → 1.8.198__py3-none-any.whl
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.
Potentially problematic release.
This version of maps4fs might be problematic. Click here for more details.
- maps4fs/generator/component/background.py +1 -0
- maps4fs/generator/component/base/component_mesh.py +15 -6
- {maps4fs-1.8.197.dist-info → maps4fs-1.8.198.dist-info}/METADATA +1 -1
- {maps4fs-1.8.197.dist-info → maps4fs-1.8.198.dist-info}/RECORD +7 -7
- {maps4fs-1.8.197.dist-info → maps4fs-1.8.198.dist-info}/LICENSE.md +0 -0
- {maps4fs-1.8.197.dist-info → maps4fs-1.8.198.dist-info}/WHEEL +0 -0
- {maps4fs-1.8.197.dist-info → maps4fs-1.8.198.dist-info}/top_level.txt +0 -0
@@ -84,6 +84,7 @@ class Background(MeshComponent, ImageComponent):
|
|
84
84
|
|
85
85
|
if not self.map.custom_background_path:
|
86
86
|
self.dem.process()
|
87
|
+
self.validate_np_for_mesh(self.dem.dem_path, self.map_size)
|
87
88
|
|
88
89
|
shutil.copyfile(self.dem.dem_path, self.not_substracted_path)
|
89
90
|
self.save_map_dem(self.dem.dem_path, save_path=self.not_resized_path)
|
@@ -1,5 +1,7 @@
|
|
1
1
|
"""Base class for all components that primarily used to work with meshes."""
|
2
2
|
|
3
|
+
import os
|
4
|
+
|
3
5
|
import cv2
|
4
6
|
import numpy as np
|
5
7
|
import trimesh
|
@@ -17,24 +19,31 @@ class MeshComponent(Component):
|
|
17
19
|
"""Checks if the given image is a valid for mesh generation.
|
18
20
|
|
19
21
|
Arguments:
|
20
|
-
image_path (str): The path to the
|
22
|
+
image_path (str): The path to the background image.
|
21
23
|
map_size (int): The size of the map.
|
22
24
|
|
23
25
|
Raises:
|
24
|
-
|
26
|
+
FileNotFoundError: If the background image is not found.
|
27
|
+
ValueError: If the background image does not meet the requirements.
|
25
28
|
"""
|
29
|
+
if not os.path.isfile(image_path):
|
30
|
+
raise FileNotFoundError(f"Can't find the background DEM image at {image_path}.")
|
31
|
+
|
26
32
|
image = cv2.imread(image_path, cv2.IMREAD_UNCHANGED)
|
33
|
+
if image is None:
|
34
|
+
raise ValueError(f"Can't read the background DEM image at {image_path}.")
|
35
|
+
|
27
36
|
if image.shape[0] != image.shape[1]:
|
28
|
-
raise ValueError("The
|
37
|
+
raise ValueError("The background image must be a square.")
|
29
38
|
|
30
39
|
if image.shape[0] != map_size + Parameters.BACKGROUND_DISTANCE * 2:
|
31
|
-
raise ValueError("The
|
40
|
+
raise ValueError("The background image must have the size of the map + 4096.")
|
32
41
|
|
33
42
|
if len(image.shape) != 2:
|
34
|
-
raise ValueError("The
|
43
|
+
raise ValueError("The background image must be a grayscale image.")
|
35
44
|
|
36
45
|
if image.dtype != np.uint16:
|
37
|
-
raise ValueError("The
|
46
|
+
raise ValueError("The background image must be a 16-bit grayscale image.")
|
38
47
|
|
39
48
|
@staticmethod
|
40
49
|
def mesh_to_stl(mesh: trimesh.Trimesh, save_path: str) -> None:
|
@@ -7,7 +7,7 @@ maps4fs/generator/map.py,sha256=FA9ZLpVMS2RLRDgWZdOo-kLzqMUBza3EZ_89-Gfw_s4,1119
|
|
7
7
|
maps4fs/generator/qgis.py,sha256=Es8hLuqN_KH8lDfnJE6He2rWYbAKJ3RGPn-o87S6CPI,6116
|
8
8
|
maps4fs/generator/settings.py,sha256=ZHwLn1ObdOuhyUTzQTYvyDs7YZ0SbVLgTSpoeUtqi0c,6708
|
9
9
|
maps4fs/generator/component/__init__.py,sha256=s01yVVVi8R2xxNvflu2D6wTd9I_g73AMM2x7vAC7GX4,490
|
10
|
-
maps4fs/generator/component/background.py,sha256=
|
10
|
+
maps4fs/generator/component/background.py,sha256=JDprgCieWZXNL0IuVCdl363tjxAX6KEjfxehGXEkADg,18839
|
11
11
|
maps4fs/generator/component/config.py,sha256=RitKgFDZPzjA1fi8GcEi1na75qqaueUvpcITHjBvCXc,3674
|
12
12
|
maps4fs/generator/component/grle.py,sha256=nDA6vjjfWFL0Hkz6aso1aLIwuksbxzZw9syNax1bD04,19134
|
13
13
|
maps4fs/generator/component/i3d.py,sha256=kJ3Th1mSdBC9j8cyWBwIyYm0fKzYJtocI0jYWkVX3AU,19713
|
@@ -17,7 +17,7 @@ maps4fs/generator/component/texture.py,sha256=VqxUmK7HHw-G_C_qS1rb5mSpkzGwI0dAnW
|
|
17
17
|
maps4fs/generator/component/base/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,43
|
18
18
|
maps4fs/generator/component/base/component.py,sha256=apGuQ7TcwqL0neJZiciNLGO22wZwYyqoDZM7aI1RHw8,21273
|
19
19
|
maps4fs/generator/component/base/component_image.py,sha256=2QnJ9xm0D54v4whg7bc1s-kwRVjZHhOo1OR5jHr1Qp0,4786
|
20
|
-
maps4fs/generator/component/base/component_mesh.py,sha256=
|
20
|
+
maps4fs/generator/component/base/component_mesh.py,sha256=zx6TElBBMxo-D5AxqAYemtvkl2k4hHThf0OH7LgNRMY,9159
|
21
21
|
maps4fs/generator/component/base/component_xml.py,sha256=6OO1dKoceO1ACk7-k1oGtnkfNud8ZN3u3ZNjdNMpTqw,3967
|
22
22
|
maps4fs/generator/dtm/__init__.py,sha256=hzKESJm2QhIQnPKxTYCFohpvRWOmLfXZfEnrMbntp1s,1392
|
23
23
|
maps4fs/generator/dtm/arctic.py,sha256=LSivLLjtd6TJUaPYvgSYQ4KalMTaY58zFvwivSh45uM,2587
|
@@ -51,8 +51,8 @@ maps4fs/toolbox/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,4
|
|
51
51
|
maps4fs/toolbox/background.py,sha256=RclEqxEWLbMxuEkkegQP8jybzugwQ1_R3rdfDe0s21U,2104
|
52
52
|
maps4fs/toolbox/custom_osm.py,sha256=X6ZlPqiOhNjkmdD_qVroIfdOl9Rb90cDwVSLDVYgx80,1892
|
53
53
|
maps4fs/toolbox/dem.py,sha256=z9IPFNmYbjiigb3t02ZenI3Mo8odd19c5MZbjDEovTo,3525
|
54
|
-
maps4fs-1.8.
|
55
|
-
maps4fs-1.8.
|
56
|
-
maps4fs-1.8.
|
57
|
-
maps4fs-1.8.
|
58
|
-
maps4fs-1.8.
|
54
|
+
maps4fs-1.8.198.dist-info/LICENSE.md,sha256=pTKD_oUexcn-yccFCTrMeLkZy0ifLRa-VNcDLqLZaIw,10749
|
55
|
+
maps4fs-1.8.198.dist-info/METADATA,sha256=-CVhXGIPXLzKhNjtpqFRWlKiva9eCQps9Ooan2cWdbU,44904
|
56
|
+
maps4fs-1.8.198.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
57
|
+
maps4fs-1.8.198.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
|
58
|
+
maps4fs-1.8.198.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|