Refuse knobs with less than 2 serrations

This commit is contained in:
Florian Festi 2017-10-01 21:01:18 +02:00
parent 98e9f827ec
commit 696307397d
1 changed files with 7 additions and 0 deletions

View File

@ -43,6 +43,10 @@ class Parts:
self.move(size, size, move) self.move(size, size, move)
def waivyKnob(self, diameter, n=20, angle=45, hole=0, callback=None, move=""): def waivyKnob(self, diameter, n=20, angle=45, hole=0, callback=None, move=""):
if n < 2:
return
size = diameter + pi * diameter / n size = diameter + pi * diameter / n
if self.move(size, size, move, before=True): if self.move(size, size, move, before=True):
@ -68,6 +72,9 @@ class Parts:
callback=None, move=""): callback=None, move=""):
size = diameter size = diameter
if n < 2:
return
if self.move(size, size, move, before=True): if self.move(size, size, move, before=True):
return return