Skip to content

Commit

Permalink
Ignore height scale multiplier while placing trees.
Browse files Browse the repository at this point in the history
  • Loading branch information
iwatkot committed Feb 16, 2025
1 parent 2beff58 commit 42ab576
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions maps4fs/generator/component/base/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ def interpolate_points(

return interpolated_polyline

def get_z_scaling_factor(self) -> float:
def get_z_scaling_factor(self, ignore_height_scale_multiplier: bool = False) -> float:
"""Calculates the scaling factor for the Z axis based on the map settings.
Returns:
Expand All @@ -560,7 +560,7 @@ def get_z_scaling_factor(self) -> float:

scaling_factor = 1 / self.map.dem_settings.multiplier

if self.map.shared_settings.height_scale_multiplier:
if self.map.shared_settings.height_scale_multiplier and not ignore_height_scale_multiplier:
scaling_factor *= self.map.shared_settings.height_scale_multiplier
if self.map.shared_settings.mesh_z_scaling_factor:
scaling_factor *= 1 / self.map.shared_settings.mesh_z_scaling_factor
Expand Down
2 changes: 1 addition & 1 deletion maps4fs/generator/component/i3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,6 @@ def get_z_coordinate_from_dem(self, not_resized_dem: np.ndarray, x: int, y: int)
y = int(max(0, min(y, dem_y_size - 1)))

z = not_resized_dem[y, x]
z *= self.get_z_scaling_factor()
z *= self.get_z_scaling_factor(ignore_height_scale_multiplier=True)

return z
1 change: 0 additions & 1 deletion maps4fs/generator/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ def __init__(
"custom_osm": bool(custom_osm),
"is_public": kwargs.get("is_public", False),
}
print(main_settings)
send_main_settings(main_settings)
except Exception as e:
self.logger.error("Error sending main settings: %s", e)
Expand Down

0 comments on commit 42ab576

Please sign in to comment.