Skip to content

Commit

Permalink
AirPurifier: Few more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
florianfesti committed Jan 11, 2024
1 parent 995bb7f commit 4adfe7a
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions boxes/generators/airpurifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ def __init__(self) -> None:
self.argparser.add_argument(
"--fans_bottom", action="store", type=int, default=0,
help="number of fans on the bottom side (-1 for maximal number)")
self.argparser.add_argument(
"--sides_with_fans", action="store", type=int, default=1,
choices=(0, 1, 2, 3, 4),
help="how many side should have fan holes")
self.argparser.add_argument(
"--screw_holes", action="store", type=float, default=2.,
help="diameter of the holes for screwing in the fans (in mm)")
Expand All @@ -94,7 +90,10 @@ def cb():
w = (l-30) / n_
x = 15 + w / 2
delta = self.fan_holes[self.fan_diameter] / 2
posy = h / 2
if self.filters==2:
posy = h / 2
else:
posy = (h + t + fh) / 2

for i in range(n_):
posx = x+i*w
Expand All @@ -112,7 +111,10 @@ def render(self):
fh = self.filter_height
h = d + 2 + self.filters * (fh + t)

edge = edges.CompoundEdge(self, "eFe", (fh + t, d+2, fh + t))
if self.filters==2:
edge = edges.CompoundEdge(self, "eFe", (fh + t, d+2, fh + t))
else:
edge = edges.CompoundEdge(self, "Fe", (d+2, fh + t))

self.rectangularWall(x, d, "ffff", callback=[
self.fanCB(self.fans_top, d, x, False)], label="top", move="up")
Expand All @@ -134,4 +136,4 @@ def render(self):
self.rectangularWall(x, y, "ehhh", callback=[
lambda:self.rectangularHole(x/2, y/2, x - r, y - r, r=10)], move="up")
else:
self.rectangularWall(x, y, "hhhh", move="up")
self.rectangularWall(x, y, "ehhh", move="up")

0 comments on commit 4adfe7a

Please sign in to comment.