Skip to content

Commit

Permalink
CanStorage: Make sure the cans can get out
Browse files Browse the repository at this point in the history
Limit the barrier height for very flat chute angles.

Thanks to Sniplow <https://github.com/Sniplow> for pointing this out.

Resolves: #650
  • Loading branch information
florianfesti committed Mar 27, 2024
1 parent 645a9f3 commit dda804c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion boxes/generators/can_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,9 @@ def render(self):
self.top_chute_depth = (self.depth - 1.1 * self.canDiameter) / math.cos(math.radians(self.chuteAngle))
self.bottom_chute_height = max((self.depth - 1.1 * self.canDiameter) * math.sin(math.radians(self.chuteAngle)), 0.1 * self.canDiameter)
self.bottom_chute_depth = self.depth / math.cos(math.radians(self.chuteAngle))
self.barrier_height = 0.25 * self.canDiameter
self.barrier_height = min(
0.25 * self.canDiameter,
self.bottom_chute_height + self.top_chute_height - self.thickness)

if (self.top_chute_depth + self.bottom_chute_height - self.thickness) < (self.barrier_height + self.canDiameter * 0.1):
self.bottom_chute_height = self.barrier_height + self.canDiameter * 0.1 + self.thickness - self.top_chute_depth
Expand Down

0 comments on commit dda804c

Please sign in to comment.