kleine Verbesserungen

This commit is contained in:
Mika 2023-11-03 01:54:13 +01:00
parent 4148826c43
commit f4bf49c6d4

View File

@ -72,24 +72,24 @@ class Circle:
self.__offset = (self.__distance / 100) * val self.__offset = (self.__distance / 100) * val
def circle_generation(self): def circle_generation(self):
x = self.__radius
x1 = 10 y = self.__radius
y1 = 10 i = 1
y = y1
v = 1
g = 1
canvas = draw.Drawing(self.__length, self.__height, origin=(0, 0)) canvas = draw.Drawing(self.__length, self.__height, origin=(0, 0))
while y <= self.__height: while y + self.__radius <= self.__height:
x = x1 + self.__offset * v while x + self.__radius <= self.__length:
while x <= self.__length:
canvas.append(draw.Circle(x, y, self.__radius, fill='none', stroke_width=1, stroke='black')) canvas.append(draw.Circle(x, y, self.__radius, fill='none', stroke_width=1, stroke='black'))
x = x + self.__distance x = x + self.__distance
y = y + self.__distance
v = -((1 - g) / 2)
g = -g
if i % 2 == 0:
x = self.__radius
else:
x = self.__radius + self.__offset
y = y + self.__distance
i = i + 1
canvas.save_svg(f'{self.__filepath}/{self.__name}.svg') canvas.save_svg(f'{self.__filepath}/{self.__name}.svg')