From 95f2fbeb82b1b1262b726e83b2c76215fbefe22e Mon Sep 17 00:00:00 2001 From: Florian Festi Date: Sat, 1 Feb 2020 15:03:49 +0100 Subject: [PATCH] corner(): Make more robust against division by zero --- boxes/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boxes/__init__.py b/boxes/__init__.py index 02206b8..20c6a99 100755 --- a/boxes/__init__.py +++ b/boxes/__init__.py @@ -650,10 +650,10 @@ class Boxes: if tabs and self.tabs: if degrees > 0: r_ = radius + self.burn - tabrad = self.tabs / r_ + tabrad = self.tabs / max(r_, 0.01) else: r_ = radius - self.burn - tabrad = -self.tabs / r_ + tabrad = -self.tabs / max(r_, 0.01) length = abs(r_ * rad) tabs = min(tabs, int(length // (tabs*3*self.tabs)))