kleinere Anpassungen

This commit is contained in:
Mika 2023-11-01 15:37:01 +01:00
parent 978a85713d
commit 5b2b84dbf0

View File

@ -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