PaintStorage: Add additional_bottom and additional_top option
This commit is contained in:
parent
98d6d949fa
commit
f954e4e857
|
@ -23,6 +23,14 @@ class PaintStorage(Boxes):
|
||||||
webinterface = True
|
webinterface = True
|
||||||
ui_group = "Shelf" # see ./__init__.py for names
|
ui_group = "Shelf" # see ./__init__.py for names
|
||||||
|
|
||||||
|
canheight: int
|
||||||
|
candiameter: int
|
||||||
|
minspace: int
|
||||||
|
additional_bottom: int
|
||||||
|
additional_top: int
|
||||||
|
hexpattern: bool
|
||||||
|
drawer: bool
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
Boxes.__init__(self)
|
Boxes.__init__(self)
|
||||||
|
|
||||||
|
@ -40,6 +48,12 @@ class PaintStorage(Boxes):
|
||||||
self.argparser.add_argument(
|
self.argparser.add_argument(
|
||||||
"--minspace", action="store", type=int, default=10,
|
"--minspace", action="store", type=int, default=10,
|
||||||
help="Minimum space between the paintcans")
|
help="Minimum space between the paintcans")
|
||||||
|
self.argparser.add_argument(
|
||||||
|
"--additional_bottom", action="store", type=boolarg, default=False,
|
||||||
|
help="Additional bottom/floor with holes the paintcans go through")
|
||||||
|
self.argparser.add_argument(
|
||||||
|
"--additional_top", action="store", type=boolarg, default=False,
|
||||||
|
help="Additional top/floor with holes the paintcans go through")
|
||||||
self.argparser.add_argument(
|
self.argparser.add_argument(
|
||||||
"--hexpattern", action="store", type=boolarg, default=False,
|
"--hexpattern", action="store", type=boolarg, default=False,
|
||||||
help="Use hexagonal arrangement for the holes instead of orthogonal")
|
help="Use hexagonal arrangement for the holes instead of orthogonal")
|
||||||
|
@ -74,6 +88,27 @@ class PaintStorage(Boxes):
|
||||||
j * (self.candiameter + spacing_x) + (self.candiameter + spacing_x) / 2,
|
j * (self.candiameter + spacing_x) + (self.candiameter + spacing_x) / 2,
|
||||||
self.candiameter / 2)
|
self.candiameter / 2)
|
||||||
|
|
||||||
|
def sidesCb(self):
|
||||||
|
x, y = self.x, self.y
|
||||||
|
t = self.thickness
|
||||||
|
|
||||||
|
stack = self.edges['s'].settings
|
||||||
|
h = self.canheight - stack.height - stack.holedistance + t
|
||||||
|
hx = 1 / 2. * x
|
||||||
|
hh = h / 4.
|
||||||
|
hr = min(hx, hh) / 2
|
||||||
|
|
||||||
|
if not self.drawer:
|
||||||
|
self.rectangularHole(h / 3, (x / 2.0) - t, hh, hx, r=hr)
|
||||||
|
self.fingerHolesAt(((self.canheight/3)*2)-t*2, -t, x, 90)
|
||||||
|
|
||||||
|
if self.additional_bottom:
|
||||||
|
self.fingerHolesAt((self.canheight / 6) - (t / 2), -t, x, 90)
|
||||||
|
if self.additional_top:
|
||||||
|
self.fingerHolesAt(self.canheight - ((self.canheight / 6) + t), -t, x, 90)
|
||||||
|
else:
|
||||||
|
self.rectangularHole(h / 3, (x / 2.0) - t, hh, hx, r=hr)
|
||||||
|
|
||||||
def render(self):
|
def render(self):
|
||||||
# adjust to the variables you want in the local scope
|
# adjust to the variables you want in the local scope
|
||||||
x, y = self.x, self.y
|
x, y = self.x, self.y
|
||||||
|
@ -82,25 +117,14 @@ class PaintStorage(Boxes):
|
||||||
stack = self.edges['s'].settings
|
stack = self.edges['s'].settings
|
||||||
h = self.canheight - stack.height - stack.holedistance + t
|
h = self.canheight - stack.height - stack.holedistance + t
|
||||||
|
|
||||||
hx = 1/2.*x
|
wall_callbacks = [self.sidesCb]
|
||||||
hh = h/4.
|
|
||||||
hr = min(hx, hh) / 2
|
|
||||||
|
|
||||||
if not self.drawer:
|
if not self.drawer:
|
||||||
wall_keys = "EsES"
|
wall_keys = "EsES"
|
||||||
wall_callbacks = [
|
|
||||||
lambda: self.rectangularHole(h / 3, (x / 2.0) - t, hh, hx, r=hr),
|
|
||||||
lambda: self.fingerHolesAt(0, self.canheight / 3, x, 0),
|
|
||||||
]
|
|
||||||
bottom_keys = "EfEf"
|
bottom_keys = "EfEf"
|
||||||
else:
|
else:
|
||||||
wall_keys = "FsFS"
|
wall_keys = "FsFS"
|
||||||
wall_callbacks = [
|
|
||||||
lambda: self.rectangularHole(h / 3, (x / 2.0) - t, hh, hx, r=hr)
|
|
||||||
]
|
|
||||||
bottom_keys = "FfFf"
|
bottom_keys = "FfFf"
|
||||||
|
|
||||||
|
|
||||||
# Walls
|
# Walls
|
||||||
self.rectangularWall(
|
self.rectangularWall(
|
||||||
h, x - 2 * t, wall_keys,
|
h, x - 2 * t, wall_keys,
|
||||||
|
@ -129,6 +153,10 @@ class PaintStorage(Boxes):
|
||||||
if not self.drawer:
|
if not self.drawer:
|
||||||
# Top
|
# Top
|
||||||
self.rectangularWall(y, x, "efef", callback=[self.paintholes], move="up")
|
self.rectangularWall(y, x, "efef", callback=[self.paintholes], move="up")
|
||||||
|
if self.additional_bottom:
|
||||||
|
self.rectangularWall(y, x, "efef", callback=[self.paintholes], move="up")
|
||||||
|
if self.additional_top:
|
||||||
|
self.rectangularWall(y, x, "efef", callback=[self.paintholes], move="up")
|
||||||
else:
|
else:
|
||||||
# Sides
|
# Sides
|
||||||
self.rectangularWall(y, h, "efff", move="up")
|
self.rectangularWall(y, h, "efff", move="up")
|
||||||
|
|
Loading…
Reference in New Issue