From d2d97b01c9cfb82c660b0a5216d6e98264710c60 Mon Sep 17 00:00:00 2001 From: Florian Festi Date: Fri, 22 Nov 2019 16:26:38 +0100 Subject: [PATCH] grip(): Prevent division by zero --- boxes/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boxes/__init__.py b/boxes/__init__.py index f9ce456..6153e0e 100755 --- a/boxes/__init__.py +++ b/boxes/__init__.py @@ -881,7 +881,7 @@ class Boxes: :param depth: depth of the grooves """ - grooves = int(length // (depth * 2.0)) + 1 + grooves = max(int(length // (depth * 2.0)) + 1, 1) depth = length / grooves / 4.0 for groove in range(grooves): self.corner(90, depth)