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.
- {maps4fs-2.1.7 → maps4fs-2.1.9}/PKG-INFO +1 -1
- {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/component/i3d.py +10 -10
- {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs.egg-info/PKG-INFO +1 -1
- {maps4fs-2.1.7 → maps4fs-2.1.9}/pyproject.toml +1 -1
- {maps4fs-2.1.7 → maps4fs-2.1.9}/LICENSE.md +0 -0
- {maps4fs-2.1.7 → maps4fs-2.1.9}/README.md +0 -0
- {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/__init__.py +0 -0
- {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/__init__.py +0 -0
- {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/component/__init__.py +0 -0
- {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/component/background.py +0 -0
- {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/component/base/__init__.py +0 -0
- {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/component/base/component.py +0 -0
- {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/component/base/component_image.py +0 -0
- {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/component/base/component_mesh.py +0 -0
- {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/component/base/component_xml.py +0 -0
- {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/component/config.py +0 -0
- {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/component/dem.py +0 -0
- {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/component/grle.py +0 -0
- {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/component/layer.py +0 -0
- {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/component/satellite.py +0 -0
- {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/component/texture.py +0 -0
- {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/config.py +0 -0
- {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/game.py +0 -0
- {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/map.py +0 -0
- {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/qgis.py +0 -0
- {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/settings.py +0 -0
- {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/generator/statistics.py +0 -0
- {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs/logger.py +0 -0
- {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs.egg-info/SOURCES.txt +0 -0
- {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs.egg-info/dependency_links.txt +0 -0
- {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs.egg-info/requires.txt +0 -0
- {maps4fs-2.1.7 → maps4fs-2.1.9}/maps4fs.egg-info/top_level.txt +0 -0
- {maps4fs-2.1.7 → maps4fs-2.1.9}/setup.cfg +0 -0
- {maps4fs-2.1.7 → maps4fs-2.1.9}/tests/test_generator.py +0 -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],
|
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
|
-
|
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
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "maps4fs"
|
7
|
-
version = "2.1.
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|