Try to fix skeleton parsing

This commit is contained in:
2024-06-24 04:47:29 +02:00
parent 5fdfa9e6b9
commit 107b3e08c4
23 changed files with 19 additions and 14 deletions

View File

@@ -87,6 +87,7 @@ def draw_rectangles(rectangles, grid, heightmap):
image.putpixel((x, y), round(height_average))
return image
def area_of_rectangles(rectangles):
area = 0
for rectangle in rectangles:
@@ -95,7 +96,6 @@ def area_of_rectangles(rectangles):
return area
def generate_building(image: str | Image.Image, heightmap: str | Image.Image, output: str = './world_maker/data/building.png',
number_of_try: int = 3, min_width: int = 10, max_width: int = 25):
print("[Building] Start generating building position...")
@@ -111,5 +111,3 @@ def generate_building(image: str | Image.Image, heightmap: str | Image.Image, ou
rectangles_output = rectangles
draw_rectangles(rectangles_output, grid, heightmap).save(output)
return rectangles_output