Upload files to ""

This commit is contained in:
LukasGro 2023-10-29 13:30:13 +00:00
parent 14c93bf1f5
commit 6c8d43b842
2 changed files with 93 additions and 0 deletions

55
HexagonGen.py Normal file
View File

@ -0,0 +1,55 @@
# -*- coding: utf-8 -*-
"""
Created on Sat Oct 28 16:26:49 2023
@author: Lukas
"""
import drawsvg as draw
import math
# Mittelpunkt X-Koordinate
x1=0
# Mittelpunkt Y-Koordinate
y1=0
# Schlüsselbreite
sb = 50.0000
#Breite Feld
length=10000
#Höhe Feld
height = 10000
#Abstand X
ax= 86.6
#Abstand Y
ay=40
#Versatz der Spalten
versatz= ax/2
#Def
v=0
g=-1
r=1
x=0
y=0
size = sb/math.sqrt(3)
d = draw.Drawing(length, height, origin=(0, 0))
x =x1
y =y1
while y <= height:
x=x1+((versatz)*v)
while x <= length:
d.append(draw.Lines(x-size*0.5, y-size*0.866, x+size-size*0.5, y-size*0.866, x+size * 1.5-size*0.5, y, x+size-size*0.5, y+size * 0.866, x-size*0.5, y+size * 0.866, x-size, y,
fill='red', stroke='black', close='true'))
x =x+ax
y =y+ay
v= -((1-g)/2)
g=-g
d.append(draw.Circle(0, 0, 40))
#plt.show()
d.save_svg('polygon.svg')

38
KreisGen.py Normal file
View File

@ -0,0 +1,38 @@
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 25 16:27:24 2023
@author: Lukas
"""
import drawsvg as draw
length = 1000
height = 1000
x1= 10
y1= 10
r= 10
ax= 60
ay= 60
versatz=30
v=1
g=1
d = draw.Drawing(length, height, origin=(0, 0))
# Draw a circle
#x =x1
y =y1
while y <= height:
x=x1+((versatz)*v)
while x <= length:
d.append(draw.Circle(x, y, r,
fill='red', stroke_width=0, stroke='black'))
x =x+ax
y =y+ay
v= -((1-g)/2)
g=-g
d.save_svg('example.svg')