diff --git a/mustergenerator.py b/mustergenerator.py index de427c3..fd403e3 100644 --- a/mustergenerator.py +++ b/mustergenerator.py @@ -4,7 +4,7 @@ import math class Circle: - def __init__(self, name: str, filepath: str, length=1234, height=1234, radius=10, distance=60, offset=50): + 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 radius >= 0, "radius can not be negative" @@ -17,6 +17,7 @@ class Circle: self.__height = height self.__radius = radius self.__distance = distance + self.__offset_percentage = offset self.__offset = (distance / 100) * offset self.__name = name self.__filepath = filepath @@ -52,6 +53,10 @@ class Circle: def distance(self, val): self.__distance = val + @property + def offset_percentage(self): + return self.__offset_percentage + @property def offset(self): return self.__offset @@ -90,14 +95,14 @@ if __name__ == '__main__': if path == "0": path = os.getcwd() - shape = int(input("Form (1: Kreis, 2: Hexagon, 3: Dreieck)")) + shape = int(input("Form (1: Kreis, 2: Hexagon, 3: Dreieck):")) if shape == 1: circle = Circle(name, path) - + print(f"\nStandardwerte\nHöhe: {circle.height} px\nLänge: {circle.length} px\nRadius: {circle.radius} px\nAbstand: {circle.distance} px\nOffset: {circle.offset_percentage} %\n") selection_flag = True while selection_flag: - parameter_selection = int(input("Parameter wählen (0: keinen Parameter ändern, 1: Höhe, 2: Länge, 3: Radius, 4: Abstand, 5: Offste):")) + parameter_selection = int(input("Parameter ändern (0: keinen Parameter ändern, 1: Höhe, 2: Länge, 3: Radius, 4: Abstand, 5: Offste):")) if parameter_selection == 0: selection_flag = False elif parameter_selection == 1: