some critical fixes on balcony
This commit is contained in:
@@ -20,8 +20,8 @@ class Balcony:
|
|||||||
|
|
||||||
def get_structures(self) -> list[Vertice]:
|
def get_structures(self) -> list[Vertice]:
|
||||||
attach_points = self.get_attach_points()
|
attach_points = self.get_attach_points()
|
||||||
len_attach_points = len(attach_points)
|
len_attach_points = len(attach_points)-1
|
||||||
min_wid = self.rdata["size"]["min_width"] -1
|
min_wid = self.rdata["size"]["min_width"]
|
||||||
min_gap = self.rdata["multiple"]["min_gap"]
|
min_gap = self.rdata["multiple"]["min_gap"]
|
||||||
growth_chance = self.rdata["growth"]
|
growth_chance = self.rdata["growth"]
|
||||||
midpoint = len_attach_points//2
|
midpoint = len_attach_points//2
|
||||||
@@ -32,6 +32,7 @@ class Balcony:
|
|||||||
while True:
|
while True:
|
||||||
x1 -= 1
|
x1 -= 1
|
||||||
x2 += 1 if centered else 0
|
x2 += 1 if centered else 0
|
||||||
|
print(x1,x2, attach_points)
|
||||||
leng = attach_points[x2] - attach_points[x1] - 1
|
leng = attach_points[x2] - attach_points[x1] - 1
|
||||||
|
|
||||||
if x1 == 0:
|
if x1 == 0:
|
||||||
@@ -46,6 +47,7 @@ class Balcony:
|
|||||||
|
|
||||||
if not self.has_multiple: break
|
if not self.has_multiple: break
|
||||||
else:
|
else:
|
||||||
|
print(x1,min_wid, min_gap)
|
||||||
if x1-min_wid < min_gap: break
|
if x1-min_wid < min_gap: break
|
||||||
gap = rd.randint(min_gap, x1-min_wid)
|
gap = rd.randint(min_gap, x1-min_wid)
|
||||||
x2 = x1-gap
|
x2 = x1-gap
|
||||||
@@ -64,7 +66,7 @@ class Balcony:
|
|||||||
return points
|
return points
|
||||||
|
|
||||||
def create_structure(self, x1 : int, x2 : int) -> Vertice:
|
def create_structure(self, x1 : int, x2 : int) -> Vertice:
|
||||||
return Vertice(Point(x1,0,0), Point(x2,0,self.length-1))
|
return Vertice(Point(x1,0,0), Point(x2,0,-self.length+1))
|
||||||
|
|
||||||
def follow_window(self) -> bool:
|
def follow_window(self) -> bool:
|
||||||
return self.windows.ypadding > 3
|
return self.windows.ypadding > 3
|
||||||
|
|||||||
2
main.py
2
main.py
@@ -24,7 +24,7 @@ random_data = y.data
|
|||||||
transform = Transform((0,-60,-5),rotation = 0)
|
transform = Transform((0,-60,-5),rotation = 0)
|
||||||
editor.transform.push(transform)
|
editor.transform.push(transform)
|
||||||
|
|
||||||
geometry.placeCuboid(editor, (0,0,-1), (100,15,1), Block("air"))
|
geometry.placeCuboid(editor, (0,0,-3), (100,15,1), Block("air"))
|
||||||
|
|
||||||
|
|
||||||
x = 0
|
x = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user