From 5b2b84dbf0e9f3683ebdfee4e4dce2c68d159edd Mon Sep 17 00:00:00 2001 From: Mika Date: Wed, 1 Nov 2023 15:37:01 +0100 Subject: [PATCH] kleinere Anpassungen --- mustergenerator.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mustergenerator.py b/mustergenerator.py index fd403e3..a905875 100644 --- a/mustergenerator.py +++ b/mustergenerator.py @@ -7,6 +7,7 @@ class Circle: def __init__(self, name: str, filepath: str, length=1000, height=1000, radius=10, distance=60, offset=50): # run validations assert length >= 0, "length can not be negative" + assert height >= 0, "height can not be negative" assert radius >= 0, "radius can not be negative" assert distance >= 2*radius, "distance must be grater den two times the radius" assert offset >= 0, "offset can only be 0 - 100 %" @@ -28,6 +29,7 @@ class Circle: @length.setter def length(self, val): + assert length >= 0, "length can not be negative" self.__length = val @property @@ -36,6 +38,7 @@ class Circle: @height.setter def height(self, val): + assert height >= 0, "height can not be negative" self.__height = val @property @@ -44,6 +47,7 @@ class Circle: @radius.setter def radius(self, val): + assert radius >= 0, "radius can not be negative" self.__radius = val @property def distance(self): @@ -51,6 +55,7 @@ class Circle: @distance.setter def distance(self, val): + assert distance >= 2 * radius, "distance must be grater den two times the radius" self.__distance = val @property @@ -63,9 +68,10 @@ class Circle: @offset.setter def offset(self, val): + assert offset >= 0, "offset can only be 0 - 100 %" + assert offset <= 100, "offset can only be 0 - 100 %" self.__offset = (self.__distance / 100) * val - def circle_generation(self): x1 = 10