maps4fs 2.1.7__tar.gz → 2.1.9__tar.gz

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.
Files changed (34) hide show
  1. {maps4fs-2.1.7 → maps4fs-2.1.9}/PKG-INFO +1 -1
  2. {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/component/i3d.py +10 -10
  3. {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs.egg-info/PKG-INFO +1 -1
  4. {maps4fs-2.1.7 → maps4fs-2.1.9}/pyproject.toml +1 -1
  5. {maps4fs-2.1.7 → maps4fs-2.1.9}/LICENSE.md +0 -0
  6. {maps4fs-2.1.7 → maps4fs-2.1.9}/README.md +0 -0
  7. {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/__init__.py +0 -0
  8. {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/__init__.py +0 -0
  9. {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/component/__init__.py +0 -0
  10. {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/component/background.py +0 -0
  11. {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/component/base/__init__.py +0 -0
  12. {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/component/base/component.py +0 -0
  13. {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/component/base/component_image.py +0 -0
  14. {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/component/base/component_mesh.py +0 -0
  15. {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/component/base/component_xml.py +0 -0
  16. {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/component/config.py +0 -0
  17. {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/component/dem.py +0 -0
  18. {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/component/grle.py +0 -0
  19. {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/component/layer.py +0 -0
  20. {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/component/satellite.py +0 -0
  21. {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/component/texture.py +0 -0
  22. {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/config.py +0 -0
  23. {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/game.py +0 -0
  24. {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/map.py +0 -0
  25. {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/qgis.py +0 -0
  26. {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/settings.py +0 -0
  27. {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/statistics.py +0 -0
  28. {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/logger.py +0 -0
  29. {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs.egg-info/SOURCES.txt +0 -0
  30. {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs.egg-info/dependency_links.txt +0 -0
  31. {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs.egg-info/requires.txt +0 -0
  32. {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs.egg-info/top_level.txt +0 -0
  33. {maps4fs-2.1.7 → maps4fs-2.1.9}/setup.cfg +0 -0
  34. {maps4fs-2.1.7 → maps4fs-2.1.9}/tests/test_generator.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maps4fs
3
- Version: 2.1.7
3
+ Version: 2.1.9
4
4
  Summary: Generate map templates for Farming Simulator from real places.
5
5
  Author-email: iwatkot <iwatkot@gmail.com>
6
6
  License: Apache License 2.0
@@ -562,12 +562,14 @@ class I3d(XMLComponent):
562
562
  self.map.i3d_settings.forest_density,
563
563
  )
564
564
 
565
+ shift = (
566
+ self.map.i3d_settings.forest_density
567
+ * self.map.i3d_settings.trees_relative_shift
568
+ / 100
569
+ )
570
+
565
571
  for x, y in self.non_empty_pixels(forest_image, step=step): # type: ignore
566
- shifted_x, shifted_y = self.randomize_coordinates(
567
- (x, y),
568
- step,
569
- self.map.i3d_settings.trees_relative_shift,
570
- )
572
+ shifted_x, shifted_y = self.randomize_coordinates((x, y), shift)
571
573
 
572
574
  shifted_x, shifted_y = int(shifted_x), int(shifted_y)
573
575
 
@@ -600,25 +602,23 @@ class I3d(XMLComponent):
600
602
  self.forest_info["tree_limit"] = self.map.i3d_settings.tree_limit
601
603
  self.forest_info["initial_step"] = self.map.i3d_settings.forest_density
602
604
  self.forest_info["actual_step"] = step
605
+ self.forest_info["shift"] = shift
603
606
 
604
607
  self.assets.forests = self.xml_path
605
608
 
606
609
  @staticmethod
607
610
  def randomize_coordinates(
608
- coordinates: tuple[int, int], density: int, shift_percent: int
611
+ coordinates: tuple[int, int], shift_range: float
609
612
  ) -> tuple[float, float]:
610
613
  """Randomizes the coordinates of the point with the given density.
611
614
 
612
615
  Arguments:
613
616
  coordinates (tuple[int, int]): The coordinates of the point.
614
- density (int): The density of the randomization.
615
- shift_percent (int): Maximum relative shift in percent.
617
+ shift_range (float): Maximum absolute shift in pixels.
616
618
 
617
619
  Returns:
618
620
  tuple[float, float]: The randomized coordinates of the point.
619
621
  """
620
- shift_range = density * shift_percent / 100
621
-
622
622
  x_shift = uniform(-shift_range, shift_range)
623
623
  y_shift = uniform(-shift_range, shift_range)
624
624
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maps4fs
3
- Version: 2.1.7
3
+ Version: 2.1.9
4
4
  Summary: Generate map templates for Farming Simulator from real places.
5
5
  Author-email: iwatkot <iwatkot@gmail.com>
6
6
  License: Apache License 2.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "maps4fs"
7
- version = "2.1.7"
7
+ version = "2.1.9"
8
8
  description = "Generate map templates for Farming Simulator from real places."
9
9
  authors = [{name = "iwatkot", email = "iwatkot@gmail.com"}]
10
10
  license = {text = "Apache License 2.0"}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes