From 6cd1bab14f59e66462b5759713b13f9ff3c8923a Mon Sep 17 00:00:00 2001 From: Eclairsombre Date: Wed, 12 Jun 2024 13:10:59 +0200 Subject: [PATCH] adding entrance --- House.py | 149 +++++++++++++++++++++++++++++++++++- temp.py | 227 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 372 insertions(+), 4 deletions(-) create mode 100644 temp.py diff --git a/House.py b/House.py index 2376ac4..257a33d 100644 --- a/House.py +++ b/House.py @@ -8,7 +8,7 @@ import math import matplotlib.pyplot as plt class House: - def __init__(self, editor, coordinates_min, coordinates_max): + def __init__(self, editor, coordinates_min, coordinates_max, direction): self.editor = editor self.coordinates_min = coordinates_min self.coordinates_max = coordinates_max @@ -17,11 +17,12 @@ class House: size = [(coordinates_max[i] - coordinates_min[i]) + 10 for i in range(3)] - # Créer le tableau self.grid3d = np.zeros(size, dtype=[('bool', bool), ('int', int)]) self.nbEtage = (coordinates_max[1] - coordinates_min[1]) // 5 + self.direction = direction + def createHouseSkeleton(self): self.delete() @@ -143,6 +144,7 @@ class House: def getAdjacentWalls(self): + main_rect = self.skeleton[0] x_main, z_main, width_main, depth_main, heigt_main = main_rect adjacent_walls = [] @@ -236,6 +238,33 @@ class House: x_plan3d = x - self.coordinates_min[0] z_plan3d = z - self.coordinates_min[2] + + print(width, depth, n) + + if width < depth: + if n==1: + for i in range(-1,depth+1): + self.editor.placeBlock((x+width//2, self.coordinates_max[1], z+i), Block("blackstone")) + else: + for k in range(n): + for i in range(-1, width+1): + for y in range(-1, depth//2+1): + self.editor.placeBlock((x + i, self.coordinates_max[1]+k, z+y+k+2), Block("blackstone")) + self.editor.placeBlock((x + i, self.coordinates_max[1]+k, z+depth-y-3-k), Block("blackstone")) + else: + if n==1: + for i in range(-1,width+1): + self.editor.placeBlock((x+i, self.coordinates_max[1], z+depth//2), Block("blackstone")) + else: + for k in range(n-1): + for i in range(-1, width+1): + for y in range(-1, depth//2+1): + self.editor.placeBlock((x + i, self.coordinates_max[1]+k, z+y+k+2), Block("blackstone")) + self.editor.placeBlock((x + i, self.coordinates_max[1]+k, z+depth-y-3-k), Block("blackstone")) + + + print('-----------------------------------') + for i in range(-1, width+1): for j in range(-1, depth+1): if width