From fdc93e0cb6b525918d46c0107207cf64e888e586 Mon Sep 17 00:00:00 2001 From: AKreuzer Date: Fri, 14 Jun 2024 03:28:48 +0200 Subject: [PATCH] some comments --- buildings/TODO | 3 ++- main.py | 26 ++++++++++++-------------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/buildings/TODO b/buildings/TODO index 838d7e4..43f622d 100644 --- a/buildings/TODO +++ b/buildings/TODO @@ -16,4 +16,5 @@ facade lisses/ immeubles collés matrices pré-distribués angles 270 bug entrée au milieu du O -bug entrée dans le pillier \ No newline at end of file +bug entrée dans le pillier +center le building dans son area (ou pas) \ No newline at end of file diff --git a/main.py b/main.py index 750e688..059a03a 100644 --- a/main.py +++ b/main.py @@ -9,31 +9,29 @@ from utils.functions import * editor = Editor(buffering=True) +# get every differents buildings shapes f = JsonReader('buildings\shapes.json') shapes = f.data +# get the random data for the buildings y = YamlReader('params.yml') random_data = y.data -# transform = Transform((0,-60,-20),rotation = 0) -# editor.transform.push(transform) -# for i in range(4): -# with editor.pushTransform(Transform(rotation = i)): -# geometry.placeCuboid(editor, (0,0,0), (0,3,5), Block("stone")) - +#move your editor to the position you wanna build on transform = Transform((0,-60,110),rotation = 0) editor.transform.push(transform) -geometry.placeCuboid(editor, (-5,0,-8), (60,10,70), Block("air")) +# clear the area you build on +geometry.placeCuboid(editor, (-5,0,-8), (25,100,25), Block("air")) + +# create a building at the relative position 0,0 with 20 blocks length and 20 blocks width, with a normal shape and 10 floors +building = Building(random_data["buildings"], (0, 0), (20,20), shapes[0]['matrice'], 10) +# build it with your custom materials +building.build(editor, ["stone_bricks","glass_pane","glass","cobblestone_wall","stone_brick_stairs","oak_planks","white_concrete","cobblestone","stone_brick_slab","iron_bars"]) + + -buildings = [] -buildings.append(Building(random_data["buildings"], (0, 0), (20,20), shapes[0]['matrice'], 1)) -buildings.append(Building(random_data["buildings"], (25, 0), (30,30), shapes[5]['matrice'], 1)) -buildings.append(Building(random_data["buildings"], (0, 35), (30,30), shapes[6]['matrice'], 1)) -buildings.append(Building(random_data["buildings"], (35, 35), (20,20), shapes[7]['matrice'], 1)) -for building in buildings : - building.build(editor, ["stone_bricks","glass_pane","glass","cobblestone_wall","stone_brick_stairs","oak_planks","white_concrete","cobblestone","stone_brick_slab","iron_bars"]) # # Get a block