Fix arg from building

This commit is contained in:
NichiHachi
2024-06-15 21:50:28 +02:00
parent 388a5c778c
commit f53d0d7402
9 changed files with 7 additions and 7 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 969 B

After

Width:  |  Height:  |  Size: 696 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -278,15 +278,15 @@ def detect_mountain(image: Union[str, Image] = './world_maker/data/sobelmap.png'
def rectangle_2D_to_3D(rectangle: list[tuple[tuple[int, int], tuple[int, int]]], def rectangle_2D_to_3D(rectangle: list[tuple[tuple[int, int], tuple[int, int]]],
height_min: int = 6, height_max: int = 10) \ height_min: int = 6, height_max: int = 10) \
-> list[tuple[tuple[int, int, int], tuple[int, int, int]]]: -> list[tuple[tuple[int, int, int], tuple[int, int, int]]]:
image = handle_import_image('./world_maker/data/heightmap.png') image = handle_import_image('./world_maker/data/heightmap.png').convert('L')
new_rectangle = [] new_rectangle = []
for rect in rectangle: for rect in rectangle:
start, end = rect start, end = rect
avg_height = 0 avg_height = 0
for x in range(start[0], end[0]): for x in range(start[0], end[0]):
for y in range(start[1], end[1]): for y in range(start[1], end[1]):
avg_height += np.array(image.getpixel((x, y))) avg_height += image.getpixel((x, y))
avg_height = int(avg_height / ((end[0] - start[0]) * (end[1] - start[1]))) avg_height = int(avg_height / ((end[0] - start[0]) * (end[1] - start[1])))
new_rectangle.append(((start[0], avg_height, start[1]), (end[0], avg_height + randint(height_min, height_max), end[1]))) new_rectangle.append(
((start[0], avg_height, start[1]), (end[0], avg_height + randint(height_min, height_max), end[1])))
return new_rectangle return new_rectangle