maps4fs 1.8.209__py3-none-any.whl → 1.8.211__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.
- maps4fs/generator/component/background.py +0 -1
- maps4fs/generator/component/base/component_mesh.py +9 -11
- maps4fs/generator/component/grle.py +3 -9
- maps4fs/generator/component/i3d.py +1 -1
- maps4fs/generator/component/satellite.py +0 -1
- maps4fs/generator/component/texture.py +4 -12
- maps4fs/generator/dtm/base/wcs.py +1 -1
- maps4fs/generator/dtm/base/wms.py +1 -1
- maps4fs/generator/dtm/dtm.py +0 -1
- maps4fs/generator/map.py +0 -2
- {maps4fs-1.8.209.dist-info → maps4fs-1.8.211.dist-info}/METADATA +1 -1
- {maps4fs-1.8.209.dist-info → maps4fs-1.8.211.dist-info}/RECORD +15 -15
- {maps4fs-1.8.209.dist-info → maps4fs-1.8.211.dist-info}/LICENSE.md +0 -0
- {maps4fs-1.8.209.dist-info → maps4fs-1.8.211.dist-info}/WHEEL +0 -0
- {maps4fs-1.8.209.dist-info → maps4fs-1.8.211.dist-info}/top_level.txt +0 -0
@@ -245,7 +245,6 @@ class Background(MeshComponent, ImageComponent):
|
|
245
245
|
decimation_agression=self.map.background_settings.decimation_agression,
|
246
246
|
remove_center=remove_center,
|
247
247
|
remove_size=self.map_size,
|
248
|
-
disable_tqdm=self.map.is_public,
|
249
248
|
)
|
250
249
|
|
251
250
|
mesh.export(save_path)
|
@@ -68,7 +68,6 @@ class MeshComponent(Component):
|
|
68
68
|
decimation_agression: int,
|
69
69
|
remove_center: bool,
|
70
70
|
remove_size: int,
|
71
|
-
disable_tqdm: bool = False,
|
72
71
|
) -> trimesh.Trimesh:
|
73
72
|
"""Generates a mesh from the given numpy array.
|
74
73
|
|
@@ -82,7 +81,6 @@ class MeshComponent(Component):
|
|
82
81
|
decimation_agression (int): The agression of the decimation.
|
83
82
|
remove_center (bool): Whether to remove the center from the mesh.
|
84
83
|
remove_size (int): The size of the center to remove.
|
85
|
-
disable_tqdm (bool): Whether to disable the tqdm progress bar.
|
86
84
|
|
87
85
|
Returns:
|
88
86
|
trimesh.Trimesh: The generated mesh.
|
@@ -105,7 +103,7 @@ class MeshComponent(Component):
|
|
105
103
|
|
106
104
|
skipped = 0
|
107
105
|
|
108
|
-
for i in tqdm(range(rows - 1), desc="Generating mesh", unit="row"
|
106
|
+
for i in tqdm(range(rows - 1), desc="Generating mesh", unit="row"):
|
109
107
|
for j in range(cols - 1):
|
110
108
|
top_left = i * cols + j
|
111
109
|
top_right = top_left + 1
|
@@ -124,7 +122,7 @@ class MeshComponent(Component):
|
|
124
122
|
|
125
123
|
faces_np = np.array(faces)
|
126
124
|
mesh = trimesh.Trimesh(vertices=vertices, faces=faces_np)
|
127
|
-
mesh = MeshComponent.rotate_mesh(mesh
|
125
|
+
mesh = MeshComponent.rotate_mesh(mesh)
|
128
126
|
|
129
127
|
if apply_decimation:
|
130
128
|
percent = decimation_percent / 100
|
@@ -134,7 +132,7 @@ class MeshComponent(Component):
|
|
134
132
|
|
135
133
|
try:
|
136
134
|
if not mesh.is_watertight:
|
137
|
-
mesh = MeshComponent.fix_mesh(mesh
|
135
|
+
mesh = MeshComponent.fix_mesh(mesh)
|
138
136
|
except Exception:
|
139
137
|
pass
|
140
138
|
|
@@ -152,12 +150,11 @@ class MeshComponent(Component):
|
|
152
150
|
return mesh
|
153
151
|
|
154
152
|
@staticmethod
|
155
|
-
def rotate_mesh(mesh: trimesh.Trimesh
|
153
|
+
def rotate_mesh(mesh: trimesh.Trimesh) -> trimesh.Trimesh:
|
156
154
|
"""Rotates the given mesh by 180 degrees around the Y-axis and Z-axis.
|
157
155
|
|
158
156
|
Arguments:
|
159
157
|
mesh (trimesh.Trimesh): The mesh to rotate.
|
160
|
-
disable_tqdm (bool): Whether to disable the tqdm progress bar.
|
161
158
|
|
162
159
|
Returns:
|
163
160
|
trimesh.Trimesh: The rotated mesh.
|
@@ -170,20 +167,21 @@ class MeshComponent(Component):
|
|
170
167
|
]
|
171
168
|
|
172
169
|
for rotation_matrix in tqdm(
|
173
|
-
rotation_matrices,
|
170
|
+
rotation_matrices,
|
171
|
+
desc="Rotating mesh",
|
172
|
+
unit="rotation",
|
174
173
|
):
|
175
174
|
mesh_copy.apply_transform(rotation_matrix)
|
176
175
|
|
177
176
|
return mesh_copy
|
178
177
|
|
179
178
|
@staticmethod
|
180
|
-
def fix_mesh(mesh: trimesh.Trimesh
|
179
|
+
def fix_mesh(mesh: trimesh.Trimesh) -> trimesh.Trimesh:
|
181
180
|
"""Fixes the given mesh by filling holes, fixing normals, fixing winding, fixing inversion,
|
182
181
|
fixing broken faces, and stitching.
|
183
182
|
|
184
183
|
Arguments:
|
185
184
|
mesh (trimesh.Trimesh): The mesh to fix.
|
186
|
-
disable_tqdm (bool): Whether to disable the tqdm progress bar.
|
187
185
|
|
188
186
|
Returns:
|
189
187
|
trimesh.Trimesh: The fixed mesh.
|
@@ -199,7 +197,7 @@ class MeshComponent(Component):
|
|
199
197
|
trimesh.repair.stitch,
|
200
198
|
]
|
201
199
|
|
202
|
-
for method in tqdm(fix_methods, desc="Fixing mesh", unit="method"
|
200
|
+
for method in tqdm(fix_methods, desc="Fixing mesh", unit="method"):
|
203
201
|
method(mesh_copy) # type: ignore
|
204
202
|
|
205
203
|
return mesh_copy
|
@@ -79,9 +79,7 @@ class GRLE(ImageComponent, XMLComponent):
|
|
79
79
|
self.logger.debug("GRLE schema is not obtained, skipping the processing.")
|
80
80
|
return
|
81
81
|
|
82
|
-
for info_layer in tqdm(
|
83
|
-
grle_schema, desc="Preparing GRLE files", unit="layer", disable=self.map.is_public
|
84
|
-
):
|
82
|
+
for info_layer in tqdm(grle_schema, desc="Preparing GRLE files", unit="layer"):
|
85
83
|
if isinstance(info_layer, dict):
|
86
84
|
file_path = os.path.join(
|
87
85
|
self.game.weights_dir_path(self.map_directory), info_layer["name"]
|
@@ -210,9 +208,7 @@ class GRLE(ImageComponent, XMLComponent):
|
|
210
208
|
|
211
209
|
farmland_id = 1
|
212
210
|
|
213
|
-
for farmland in tqdm(
|
214
|
-
farmlands, desc="Adding farmlands", unit="farmland", disable=self.map.is_public
|
215
|
-
):
|
211
|
+
for farmland in tqdm(farmlands, desc="Adding farmlands", unit="farmland"):
|
216
212
|
try:
|
217
213
|
fitted_farmland = self.fit_object_into_bounds(
|
218
214
|
polygon_points=farmland,
|
@@ -366,9 +362,7 @@ class GRLE(ImageComponent, XMLComponent):
|
|
366
362
|
# B and G channels remain the same (zeros), while we change the R channel.
|
367
363
|
possible_r_values = [65, 97, 129, 161, 193, 225]
|
368
364
|
|
369
|
-
for _ in tqdm(
|
370
|
-
range(count), desc="Adding islands of plants", unit="island", disable=self.map.is_public
|
371
|
-
):
|
365
|
+
for _ in tqdm(range(count), desc="Adding islands of plants", unit="island"):
|
372
366
|
# Randomly choose the value for the island.
|
373
367
|
plant_value = choice(possible_r_values)
|
374
368
|
# Randomly choose the size of the island.
|
@@ -249,7 +249,7 @@ class I3d(XMLComponent):
|
|
249
249
|
node_id = NODE_ID_STARTING_VALUE
|
250
250
|
field_id = 1
|
251
251
|
|
252
|
-
for field in tqdm(fields, desc="Adding fields", unit="field"
|
252
|
+
for field in tqdm(fields, desc="Adding fields", unit="field"):
|
253
253
|
try:
|
254
254
|
fitted_field = self.fit_object_into_bounds(
|
255
255
|
polygon_points=field, angle=self.rotation, border=border
|
@@ -210,9 +210,7 @@ class Texture(ImageComponent):
|
|
210
210
|
"""Rotates textures of the layers which have tags."""
|
211
211
|
if self.rotation:
|
212
212
|
# Iterate over the layers which have tags and rotate them.
|
213
|
-
for layer in tqdm(
|
214
|
-
self.layers, desc="Rotating textures", unit="layer", disable=self.map.is_public
|
215
|
-
):
|
213
|
+
for layer in tqdm(self.layers, desc="Rotating textures", unit="layer"):
|
216
214
|
if layer.tags:
|
217
215
|
self.logger.debug("Rotating layer %s.", layer.name)
|
218
216
|
layer_paths = layer.paths(self._weights_dir)
|
@@ -254,9 +252,7 @@ class Texture(ImageComponent):
|
|
254
252
|
def _prepare_weights(self):
|
255
253
|
self.logger.debug("Starting preparing weights from %s layers.", len(self.layers))
|
256
254
|
|
257
|
-
for layer in tqdm(
|
258
|
-
self.layers, desc="Preparing weights", unit="layer", disable=self.map.is_public
|
259
|
-
):
|
255
|
+
for layer in tqdm(self.layers, desc="Preparing weights", unit="layer"):
|
260
256
|
self._generate_weights(layer)
|
261
257
|
self.logger.debug("Prepared weights for %s layers.", len(self.layers))
|
262
258
|
|
@@ -328,9 +324,7 @@ class Texture(ImageComponent):
|
|
328
324
|
# Key is a layer.info_layer, value is a list of polygon points as tuples (x, y).
|
329
325
|
info_layer_data: dict[str, list[list[int]]] = defaultdict(list)
|
330
326
|
|
331
|
-
for layer in tqdm(
|
332
|
-
layers, desc="Drawing textures", unit="layer", disable=self.map.is_public
|
333
|
-
):
|
327
|
+
for layer in tqdm(layers, desc="Drawing textures", unit="layer"):
|
334
328
|
if self.map.texture_settings.skip_drains and layer.usage == "drain":
|
335
329
|
self.logger.debug("Skipping layer %s because of the usage.", layer.name)
|
336
330
|
continue
|
@@ -417,9 +411,7 @@ class Texture(ImageComponent):
|
|
417
411
|
contains any non-zero values (255), splits those non-values between different weight
|
418
412
|
files of the corresponding layer and saves the changes to the files.
|
419
413
|
"""
|
420
|
-
for layer in tqdm(
|
421
|
-
self.layers, desc="Dissolving textures", unit="layer", disable=self.map.is_public
|
422
|
-
):
|
414
|
+
for layer in tqdm(self.layers, desc="Dissolving textures", unit="layer"):
|
423
415
|
if not layer.tags:
|
424
416
|
self.logger.debug("Layer %s has no tags, there's nothing to dissolve.", layer.name)
|
425
417
|
continue
|
@@ -68,7 +68,7 @@ class WCSProvider(DTMProvider):
|
|
68
68
|
params = self.get_wcs_instance_parameters()
|
69
69
|
wcs = WebCoverageService(**params)
|
70
70
|
|
71
|
-
for tile in tqdm(tiles, desc="Downloading tiles", unit="tile"
|
71
|
+
for tile in tqdm(tiles, desc="Downloading tiles", unit="tile"):
|
72
72
|
file_name = "_".join(map(str, tile)) + ".tif"
|
73
73
|
file_path = os.path.join(self.shared_tiff_path, file_name)
|
74
74
|
if not os.path.exists(file_path):
|
@@ -59,7 +59,7 @@ class WMSProvider(DTMProvider):
|
|
59
59
|
# auth=Authentication(verify=False),
|
60
60
|
timeout=600,
|
61
61
|
)
|
62
|
-
for tile in tqdm(tiles, desc="Downloading tiles", unit="tile"
|
62
|
+
for tile in tqdm(tiles, desc="Downloading tiles", unit="tile"):
|
63
63
|
file_name = "_".join(map(str, tile)) + ".tif"
|
64
64
|
file_path = os.path.join(self.shared_tiff_path, file_name)
|
65
65
|
if not os.path.exists(file_path):
|
maps4fs/generator/dtm/dtm.py
CHANGED
maps4fs/generator/map.py
CHANGED
@@ -154,8 +154,6 @@ class Map:
|
|
154
154
|
save_path = os.path.join(self.map_directory, "custom_background.png")
|
155
155
|
shutil.copyfile(self.custom_background_path, save_path)
|
156
156
|
|
157
|
-
self.is_public = kwargs.get("is_public", False)
|
158
|
-
|
159
157
|
try:
|
160
158
|
shutil.unpack_archive(game.template_path, self.map_directory)
|
161
159
|
self.logger.debug("Map template unpacked to %s", self.map_directory)
|
@@ -3,21 +3,21 @@ maps4fs/logger.py,sha256=HQrDyj72mUjVYo25aR_-_SxVn2rfFjDCNbj-JKJdSnE,1488
|
|
3
3
|
maps4fs/generator/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,43
|
4
4
|
maps4fs/generator/dem.py,sha256=Nyz64BWM---Vpy1mi8bbhHEfd2Wc2rWw9UqHraqXDJ8,11771
|
5
5
|
maps4fs/generator/game.py,sha256=NZaxj5z7WzMiHzAvQyr-TvVjGoHgqGldM6ZsItuYyzA,11292
|
6
|
-
maps4fs/generator/map.py,sha256=
|
6
|
+
maps4fs/generator/map.py,sha256=1mbnOWXVEDeFHWDBBDX9ugzRtrGBQYrJ5ruKmPUsMe8,11136
|
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=ppxK2RheCYrLRnBkLeZUst6Ciopo9Z_zUyjS-n8YwGE,18794
|
11
11
|
maps4fs/generator/component/config.py,sha256=RitKgFDZPzjA1fi8GcEi1na75qqaueUvpcITHjBvCXc,3674
|
12
|
-
maps4fs/generator/component/grle.py,sha256=
|
13
|
-
maps4fs/generator/component/i3d.py,sha256=
|
12
|
+
maps4fs/generator/component/grle.py,sha256=kCx00SJdYEDr0tcHFvHC99928e9Eke2t_LwNxkqfvBg,18984
|
13
|
+
maps4fs/generator/component/i3d.py,sha256=z2ZkflA5E8FrHcGleXSVKZRWvkqclz_Yh_qxJI86enE,19685
|
14
14
|
maps4fs/generator/component/layer.py,sha256=QPcEzTv_8N9wYvHAZy8OezfATaVLG-YetSfCXf2lnFI,5892
|
15
|
-
maps4fs/generator/component/satellite.py,sha256=
|
16
|
-
maps4fs/generator/component/texture.py,sha256=
|
15
|
+
maps4fs/generator/component/satellite.py,sha256=oZBHjP_QY0ik1-Vk7JqMS__zIG8ffw2voeozB7-HUQc,4946
|
16
|
+
maps4fs/generator/component/texture.py,sha256=UXVzNht5ETO9-wI9cZ-ojXTgkr227B2CDZ5VwXMm_Bc,30818
|
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=pc7UVakZCnJPV-0Ukdsm6aUD3NFZbOUazuEbb44k170,8747
|
21
21
|
maps4fs/generator/component/base/component_xml.py,sha256=6OO1dKoceO1ACk7-k1oGtnkfNud8ZN3u3ZNjdNMpTqw,3967
|
22
22
|
maps4fs/generator/dtm/__init__.py,sha256=VIWcZiMZ0UtnJl7rQL-PVHDivXbZVwrBWumjhTTnnKY,1454
|
23
23
|
maps4fs/generator/dtm/arctic.py,sha256=LSivLLjtd6TJUaPYvgSYQ4KalMTaY58zFvwivSh45uM,2587
|
@@ -26,7 +26,7 @@ maps4fs/generator/dtm/bavaria.py,sha256=nH2wTxiIdQgKotauTqD-zztwFgfZzIdym2sjmSqf
|
|
26
26
|
maps4fs/generator/dtm/canada.py,sha256=XJ_za2LDV9PEV7hmjPnzdwPbpr6ezAR73-HDVaTuKPk,1290
|
27
27
|
maps4fs/generator/dtm/czech.py,sha256=sT0gwbtEnizVNcZeL7kyDdwmKvB3w8m6UgJR7ZTk1to,1058
|
28
28
|
maps4fs/generator/dtm/denmark.py,sha256=JFuBRrCJTMXe_vdO3gRCwsnZ3nZOp_Y6671Kq8aXRGM,1591
|
29
|
-
maps4fs/generator/dtm/dtm.py,sha256=
|
29
|
+
maps4fs/generator/dtm/dtm.py,sha256=dXPQH6eT0InoPtt5ZD8TUS5uhrOSqB_t4UiDjhueZMs,17812
|
30
30
|
maps4fs/generator/dtm/england.py,sha256=3URUm7uLH_RYXcQdDW3Vt09GWKAE8RAy1ZFJB94kXOA,1124
|
31
31
|
maps4fs/generator/dtm/finland.py,sha256=VpXpvCgzbyKA6VGSa7ikSzE4B-cLfR1_2zOHvS8delc,1870
|
32
32
|
maps4fs/generator/dtm/flanders.py,sha256=LltmowbS84_DaBHAS9XYoJPMunX6sWGy6zaVACHj5Ro,1039
|
@@ -46,14 +46,14 @@ maps4fs/generator/dtm/srtm.py,sha256=zeQovZCC6AKzdKAxypKQFuIn1mi2c9EUpRjaA4jSVVs
|
|
46
46
|
maps4fs/generator/dtm/switzerland.py,sha256=Jn3qYVEps_K6cH-9rMfB_zoXMxhzWQKPnlKkSE-TehE,3549
|
47
47
|
maps4fs/generator/dtm/usgs_wcs.py,sha256=X8VxdhyH0-EciGE_X-KgrAM6sVLTGssYIhtebOj8MPI,1021
|
48
48
|
maps4fs/generator/dtm/utils.py,sha256=I-wUSA_J85Xbt8sZCZAVKHSIcrMj5Ng-0adtPVhVmk0,2315
|
49
|
-
maps4fs/generator/dtm/base/wcs.py,sha256=
|
50
|
-
maps4fs/generator/dtm/base/wms.py,sha256=
|
49
|
+
maps4fs/generator/dtm/base/wcs.py,sha256=lQAp_gVz9_XUmtyobJkskiefQpuJH4o1Vwb3CSQ0lQA,2510
|
50
|
+
maps4fs/generator/dtm/base/wms.py,sha256=6Va2UMhg_s0TMOfMhxrPbsiAPiw6-vXBglnaij032I0,2264
|
51
51
|
maps4fs/toolbox/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,43
|
52
52
|
maps4fs/toolbox/background.py,sha256=RclEqxEWLbMxuEkkegQP8jybzugwQ1_R3rdfDe0s21U,2104
|
53
53
|
maps4fs/toolbox/custom_osm.py,sha256=X6ZlPqiOhNjkmdD_qVroIfdOl9Rb90cDwVSLDVYgx80,1892
|
54
54
|
maps4fs/toolbox/dem.py,sha256=z9IPFNmYbjiigb3t02ZenI3Mo8odd19c5MZbjDEovTo,3525
|
55
|
-
maps4fs-1.8.
|
56
|
-
maps4fs-1.8.
|
57
|
-
maps4fs-1.8.
|
58
|
-
maps4fs-1.8.
|
59
|
-
maps4fs-1.8.
|
55
|
+
maps4fs-1.8.211.dist-info/LICENSE.md,sha256=pTKD_oUexcn-yccFCTrMeLkZy0ifLRa-VNcDLqLZaIw,10749
|
56
|
+
maps4fs-1.8.211.dist-info/METADATA,sha256=sgf8q9pnxL8u908MqfLBE3AyVRGyxI8h4WwXNH_g0rs,45409
|
57
|
+
maps4fs-1.8.211.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
58
|
+
maps4fs-1.8.211.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
|
59
|
+
maps4fs-1.8.211.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|