maps4fs 2.1.7__py3-none-any.whl → 2.1.8__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.
@@ -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.8
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
@@ -12,7 +12,7 @@ maps4fs/generator/component/background.py,sha256=JANbVgcBXpaQ0HB1eeV16KkFgpU-Txj
12
12
  maps4fs/generator/component/config.py,sha256=uL76h9UwyhZKZmbxz0mBmWtEPN6qYay4epTEqqtej60,8601
13
13
  maps4fs/generator/component/dem.py,sha256=mtsdTIcEHmR9mW1LMcCaX4F2OCch9BM_WXHkvJby9ZY,11930
14
14
  maps4fs/generator/component/grle.py,sha256=3BKGlR0q0t0NvmqeT81WieS6MIc_UlMQjIDDZiqTiws,27243
15
- maps4fs/generator/component/i3d.py,sha256=IkhGCXci6TxJPPb_ERe4uiU1nJywHantka4dlueGjbM,26674
15
+ maps4fs/generator/component/i3d.py,sha256=RvpiW9skkZ6McyahC-AeIdPuSQjpXiFs1l0xOioJAu4,26638
16
16
  maps4fs/generator/component/layer.py,sha256=U_DzJTn1m_yGOtwuvbXxr7oL7YHHBGBcK37lyJNnZDk,6508
17
17
  maps4fs/generator/component/satellite.py,sha256=9nKwL8zQ-BB6WFMx2m8zduFn6RaxSNv6Vtpge1-QMYE,5052
18
18
  maps4fs/generator/component/texture.py,sha256=Ngvfe51grb6Ead6WvNjx1Zr0yz65y8y2vY8xUteLoNo,35019
@@ -21,8 +21,8 @@ maps4fs/generator/component/base/component.py,sha256=AP7b6rmYV_HdyyHlCTo9s6fyBXy
21
21
  maps4fs/generator/component/base/component_image.py,sha256=WTGC6v1KuS5sLNCC95Z48nCspvATKKNOuhTNYzTWXr4,8315
22
22
  maps4fs/generator/component/base/component_mesh.py,sha256=3hC-qDT8Vde6SmRMqs9USAkrF-gL2dDTYW71ATpxUS4,9130
23
23
  maps4fs/generator/component/base/component_xml.py,sha256=MT-VhU2dEckLFxAgmxg6V3gnv11di_94Qq6atfpOLdc,5342
24
- maps4fs-2.1.7.dist-info/licenses/LICENSE.md,sha256=pTKD_oUexcn-yccFCTrMeLkZy0ifLRa-VNcDLqLZaIw,10749
25
- maps4fs-2.1.7.dist-info/METADATA,sha256=25mAea17c6kCMCSzbWkPFo2EDiVqrHQcn4fRbmmbh7w,45431
26
- maps4fs-2.1.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
27
- maps4fs-2.1.7.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
28
- maps4fs-2.1.7.dist-info/RECORD,,
24
+ maps4fs-2.1.8.dist-info/licenses/LICENSE.md,sha256=pTKD_oUexcn-yccFCTrMeLkZy0ifLRa-VNcDLqLZaIw,10749
25
+ maps4fs-2.1.8.dist-info/METADATA,sha256=A1yjg3hwPS8EptLoOemoTdMW645MbvQDfAv8aKvRDII,45431
26
+ maps4fs-2.1.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
27
+ maps4fs-2.1.8.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
28
+ maps4fs-2.1.8.dist-info/RECORD,,