maps4fs 1.4.0__py3-none-any.whl → 1.4.2__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.
@@ -259,7 +259,7 @@ class Background(Component):
259
259
  is_preview (bool, optional) -- If True, the preview mesh will be generated.
260
260
  include_zeros (bool, optional) -- If True, the mesh will include the zero height values.
261
261
  """
262
- resize_factor = self.map.background_settings.resize_factor
262
+ resize_factor = 1 / self.map.background_settings.resize_factor
263
263
  dem_data = cv2.resize( # pylint: disable=no-member
264
264
  dem_data, (0, 0), fx=resize_factor, fy=resize_factor
265
265
  )
maps4fs/generator/map.py CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ import json
5
6
  import os
6
7
  import shutil
7
8
  from typing import Any, Generator
@@ -73,12 +74,13 @@ class BackgroundSettings(SettingsModel):
73
74
  Attributes:
74
75
  generate_background (bool): generate obj files for the background terrain.
75
76
  generate_water (bool): generate obj files for the water.
76
- resize_factor (float): resize factor for the background and water.
77
+ resize_factor (int): resize factor for the background terrain and water.
78
+ It will be used as 1 / resize_factor of the original size.
77
79
  """
78
80
 
79
81
  generate_background: bool = True
80
82
  generate_water: bool = True
81
- resize_factor: float = 1 / 8
83
+ resize_factor: int = 8
82
84
 
83
85
 
84
86
  class GRLESettings(SettingsModel):
@@ -140,7 +142,7 @@ class Map:
140
142
  logger (Any): Logger instance
141
143
  """
142
144
 
143
- def __init__( # pylint: disable=R0917
145
+ def __init__( # pylint: disable=R0917, R0915
144
146
  self,
145
147
  game: Game,
146
148
  coordinates: tuple[float, float],
@@ -204,7 +206,18 @@ class Map:
204
206
  self.logger.debug("Map directory created: %s", self.map_directory)
205
207
 
206
208
  self.texture_custom_schema = kwargs.get("texture_custom_schema", None)
209
+ if self.texture_custom_schema:
210
+ save_path = os.path.join(self.map_directory, "texture_custom_schema.json")
211
+ with open(save_path, "w", encoding="utf-8") as file:
212
+ json.dump(self.texture_custom_schema, file, indent=4)
213
+ self.logger.debug("Texture custom schema saved to %s", save_path)
214
+
207
215
  self.tree_custom_schema = kwargs.get("tree_custom_schema", None)
216
+ if self.tree_custom_schema:
217
+ save_path = os.path.join(self.map_directory, "tree_custom_schema.json")
218
+ with open(save_path, "w", encoding="utf-8") as file:
219
+ json.dump(self.tree_custom_schema, file, indent=4)
220
+ self.logger.debug("Tree custom schema saved to %s", save_path)
208
221
 
209
222
  try:
210
223
  shutil.unpack_archive(game.template_path, self.map_directory)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: maps4fs
3
- Version: 1.4.0
3
+ Version: 1.4.2
4
4
  Summary: Generate map templates for Farming Simulator from real places.
5
5
  Author-email: iwatkot <iwatkot@gmail.com>
6
6
  License: MIT License
@@ -61,7 +61,8 @@ Requires-Dist: pydantic
61
61
  [![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)
62
62
  [![Build Status](https://github.com/iwatkot/maps4fs/actions/workflows/checks.yml/badge.svg)](https://github.com/iwatkot/maps4fs/actions)
63
63
  [![Test Coverage](https://api.codeclimate.com/v1/badges/b922fd0a7188d37e61de/test_coverage)](https://codeclimate.com/github/iwatkot/maps4fs/test_coverage)
64
- [![GitHub Repo stars](https://img.shields.io/github/stars/iwatkot/maps4fs)](https://github.com/iwatkot/maps4fs/stargazers)
64
+ [![GitHub Repo stars](https://img.shields.io/github/stars/iwatkot/maps4fs)](https://github.com/iwatkot/maps4fs/stargazers)<br>
65
+ [![Lines of code](https://tokei.rs/b1/github/iwatkot/maps4fs)](https://github.com/iwatkot/maps4fs)
65
66
 
66
67
  </div>
67
68
 
@@ -82,7 +83,6 @@ Requires-Dist: pydantic
82
83
  📄 Generates scripts to download high-resolution satellite images from [QGIS](https://qgis.org/download/) in one click<br>
83
84
  📕 Detailed [documentation](/docs) and tutorials <br>
84
85
  🧰 Modder Toolbox to help you with various tasks <br>
85
-
86
86
  <p align="center">
87
87
  <img src="https://github.com/user-attachments/assets/cf8f5752-9c69-4018-bead-290f59ba6976"><br>
88
88
  🌎 Detailed terrain based on real-world data.<br><br>
@@ -506,7 +506,7 @@ You can also apply some advanced settings to the map generation process. Note th
506
506
 
507
507
  - Generate water - if enabled, the water planes obj files will be generated. You can turn it off if you already have those files or don't need them. By default, it's set to True.
508
508
 
509
- - Resize factor - the factor by which the background terrain will be resized. In UI it sets as an integer number (default 8), will be converted to 1/8 (0.125). In expert mode use the float number. The higher the value, the smaller the background terrain will be. Warning: higher terrain will result long processing time and enormous file size.
509
+ - Resize factor - the factor by which the background terrain will be resized. It will be used as 1 / resize_factor while generating the models. Which means that the larger the value the more the terrain will be resized. The lowest value is 1, in this case background terrain will not be resized. Note, than low values will lead to long processing and enormous size of the obj files.
510
510
 
511
511
  ## Splines Advanced settings
512
512
 
@@ -540,3 +540,4 @@ But also, I want to thank the people who helped me with the project in some way,
540
540
  - [gamerdesigns](https://github.com/gamerdesigns) - for the manual tests of the app.
541
541
  - [Tox3](https://github.com/Tox3) - for the manual tests of the app.
542
542
  - [Lucandia](https://github.com/Lucandia) - for the awesome StreamLit [widget to preview STL files](https://github.com/Lucandia/streamlit_stl).
543
+ - [H4rdB4se](https://github.com/H4rdB4se) - for investigating the issue with custom OSM files and finding a proper way to work with the files in JOSM.
@@ -1,21 +1,21 @@
1
1
  maps4fs/__init__.py,sha256=LMzzORK3Q3OjXmmRJ03CpS2SMP6zTwKNnUUei3P7s40,300
2
2
  maps4fs/logger.py,sha256=B-NEYpMjPAAqlV4VpfTi6nbBFnEABVtQOaYe6nMpidg,1489
3
3
  maps4fs/generator/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,43
4
- maps4fs/generator/background.py,sha256=-fQsrJogSZitxQ4tTDN4xLgaNrOVsXFS1bFfPkpktFE,22832
4
+ maps4fs/generator/background.py,sha256=ySABP9HLji8R0aXi1BwjUQtP2uDqZPkrlmugowa9Gkk,22836
5
5
  maps4fs/generator/component.py,sha256=58UQgdR-7KlWHTfwLesNNK76BTRsiVngRa6B64OKjhc,20065
6
6
  maps4fs/generator/config.py,sha256=0QmK052B8bxyHVhg3jzCORLfOBMMmqVfhhbqXKf6OMk,4383
7
7
  maps4fs/generator/dem.py,sha256=MZf3ZjawJ977TxqB1q9nNpvPZUNwfmm2EaJDtVU-eCU,15939
8
8
  maps4fs/generator/game.py,sha256=jjo7CTwHHSkRpeD_QgRXkhR_NxI09C4kMxz-nYOTM4A,7931
9
9
  maps4fs/generator/grle.py,sha256=onhZovvRtireDfw7wEOL0CZmOmoVzRPY-R4TlvbOUMI,17561
10
10
  maps4fs/generator/i3d.py,sha256=vbH7G0kDOGC6gbNDE-QYxMnKOMJ-vCGYdaKhWwci4ZU,23748
11
- maps4fs/generator/map.py,sha256=bs3V5-E9hF77I_v8yanL--6oc5MgTcfrdTQrIAziqq8,10964
11
+ maps4fs/generator/map.py,sha256=JwrlUdjyvSYB82HfseJ6w2-ZDFwplyfPCn84Z5awdCY,11721
12
12
  maps4fs/generator/qgis.py,sha256=Es8hLuqN_KH8lDfnJE6He2rWYbAKJ3RGPn-o87S6CPI,6116
13
13
  maps4fs/generator/texture.py,sha256=fZN0soGWk8-f3GuQWiwJ2yQTsmL9fLWVlgqeLI6ePi4,30648
14
14
  maps4fs/toolbox/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,43
15
15
  maps4fs/toolbox/background.py,sha256=9BXWNqs_n3HgqDiPztWylgYk_QM4YgBpe6_ZNQAWtSc,2154
16
16
  maps4fs/toolbox/dem.py,sha256=z9IPFNmYbjiigb3t02ZenI3Mo8odd19c5MZbjDEovTo,3525
17
- maps4fs-1.4.0.dist-info/LICENSE.md,sha256=pTKD_oUexcn-yccFCTrMeLkZy0ifLRa-VNcDLqLZaIw,10749
18
- maps4fs-1.4.0.dist-info/METADATA,sha256=2JDjj8W5wFy15bzL0FrN98l7axPgvYHtsmvWPEYPObY,32129
19
- maps4fs-1.4.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
20
- maps4fs-1.4.0.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
21
- maps4fs-1.4.0.dist-info/RECORD,,
17
+ maps4fs-1.4.2.dist-info/LICENSE.md,sha256=pTKD_oUexcn-yccFCTrMeLkZy0ifLRa-VNcDLqLZaIw,10749
18
+ maps4fs-1.4.2.dist-info/METADATA,sha256=gjkLf8rPgWWXAF6ZI3LNjLpyRbZl-xusHgoXISNCPqM,32421
19
+ maps4fs-1.4.2.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
20
+ maps4fs-1.4.2.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
21
+ maps4fs-1.4.2.dist-info/RECORD,,