Änderung paar Umvormulierungen zusatz von paar Kommentarten
This commit is contained in:
@@ -305,7 +305,10 @@ class VarioFoerderer(BaseModel):
|
||||
winkel_VP_offset_vorne = (SP_1_nachbar[0] -VP_1_nachbar[0] ),0,( SP_1_nachbar[2]- VP_1_nachbar[2])
|
||||
|
||||
return winkel_VP_offset_vorne,winkel_VP_offset_hinten
|
||||
|
||||
def horizontale_ausrichtung(x, y, voerder_richtung, rotation, x0_kreisel, y0_kreisel):
|
||||
"""Schaut was für eine Ausrichtung der Horizontale Förder hat"""
|
||||
# mit_horizontal_verbunden None als String für einen späteren vergleich
|
||||
mit_horizontal_verbunden = "None"
|
||||
if voerder_richtung == "Horizontal":
|
||||
if rotation == 0.0:
|
||||
@@ -330,25 +333,27 @@ class VarioFoerderer(BaseModel):
|
||||
mit_horizontal_verbunden = "oben_drehung_-180_or_-270"
|
||||
return mit_horizontal_verbunden
|
||||
def vario_verbuden_am_kreisel(foerderer, block_vario, start, ende, mit_horizontal_verbunden = None,kreisel_verbunden = None,am_kreisel = None,erster_kreisel_höher = None):
|
||||
"""""Methode für Erstellung der Gefällestrecke für Vario Förderrer die direkt am dem Kreisel hängt"""
|
||||
lower_hoehe_vario = foerderer.h0
|
||||
upper_hoehe_vario = foerderer.h1
|
||||
voerder_richtung = foerderer.foerderer_richtung
|
||||
hoehe_vario = foerderer.hight_zwischen
|
||||
x = foerderer.x
|
||||
y = foerderer.y
|
||||
gefaelle_länge = 500
|
||||
if (kreisel_verbunden == 2 or (am_kreisel == 1 and erster_kreisel_höher == True)or (am_kreisel == 2 and erster_kreisel_höher == False))and voerder_richtung != "Horizontal":
|
||||
l = (start[0],start[1],upper_hoehe_vario)
|
||||
# Eine 500 mm gefällestrecke an anfang und am ende reintuen
|
||||
if voerder_richtung =="Auf":
|
||||
m = (start[0],start[1] - 500*math.cos(math.radians(3)),upper_hoehe_vario +500* math.sin(math.radians(3)))
|
||||
m = (start[0],start[1] - gefaelle_länge*math.cos(math.radians(3)),upper_hoehe_vario +gefaelle_länge* math.sin(math.radians(3)))
|
||||
start = m
|
||||
|
||||
elif voerder_richtung == "Ab":
|
||||
m = (start[0],start[1] - 500*math.cos(math.radians(3)),upper_hoehe_vario -500* math.sin(math.radians(3)))
|
||||
m = (start[0],start[1] - gefaelle_länge*math.cos(math.radians(3)),upper_hoehe_vario -gefaelle_länge* math.sin(math.radians(3)))
|
||||
start = m
|
||||
|
||||
else:
|
||||
m = (start[0],start[1] - 500*math.cos(math.radians(3)),upper_hoehe_vario )
|
||||
m = (start[0],start[1] - gefaelle_länge*math.cos(math.radians(3)),upper_hoehe_vario )
|
||||
start = m
|
||||
if kreisel_verbunden == 1:
|
||||
z1 = m[2]
|
||||
@@ -362,14 +367,14 @@ class VarioFoerderer(BaseModel):
|
||||
if (kreisel_verbunden == 2 or (am_kreisel == 1 and erster_kreisel_höher == False)or (am_kreisel == 2 and erster_kreisel_höher == True)) and voerder_richtung != "Horizontal":
|
||||
l = (ende[0],ende[1],lower_hoehe_vario)
|
||||
if voerder_richtung =="Auf":
|
||||
m = (ende[0],ende[1] + 500*math.cos(math.radians(3)) ,lower_hoehe_vario - 500* math.sin(math.radians(3)))
|
||||
m = (ende[0],ende[1] + gefaelle_länge*math.cos(math.radians(3)) ,lower_hoehe_vario - gefaelle_länge* math.sin(math.radians(3)))
|
||||
ende = m
|
||||
|
||||
elif voerder_richtung == "Ab":
|
||||
m = (ende[0],ende[1] + 500*math.cos(math.radians(3)) ,lower_hoehe_vario + 500* math.sin(math.radians(3)))
|
||||
m = (ende[0],ende[1] + gefaelle_länge*math.cos(math.radians(3)) ,lower_hoehe_vario + gefaelle_länge* math.sin(math.radians(3)))
|
||||
ende = m
|
||||
else:
|
||||
m = (ende[0],ende[1] + 500*math.cos(math.radians(3)) ,lower_hoehe_vario )
|
||||
m = (ende[0],ende[1] + gefaelle_länge*math.cos(math.radians(3)) ,lower_hoehe_vario )
|
||||
ende = m
|
||||
line = Line.new(dxfattribs={"start": l,"end":m })
|
||||
line.dxf.layer = "6-SP"
|
||||
@@ -382,7 +387,7 @@ class VarioFoerderer(BaseModel):
|
||||
elif voerder_richtung == "Horizontal":
|
||||
if mit_horizontal_verbunden == "oben_drehung_0_or_-90" or mit_horizontal_verbunden == "unten_drehung_-180_or_-270":
|
||||
l = (start[0],start[1],upper_hoehe_vario)
|
||||
m = (start[0],start[1] - 500*math.cos(math.radians(3)),upper_hoehe_vario)
|
||||
m = (start[0],start[1] - gefaelle_länge*math.cos(math.radians(3)),upper_hoehe_vario)
|
||||
start = m
|
||||
line = Line.new(dxfattribs={"start": l,"end":m })
|
||||
line.dxf.layer = "6-SP"
|
||||
@@ -391,7 +396,7 @@ class VarioFoerderer(BaseModel):
|
||||
block_vario.add_entity(copy)
|
||||
else:
|
||||
end = (ende[0],ende[1],lower_hoehe_vario)
|
||||
en = (ende[0],ende[1] + 500*math.cos(math.radians(3)) ,lower_hoehe_vario )
|
||||
en = (ende[0],ende[1] + gefaelle_länge*math.cos(math.radians(3)) ,lower_hoehe_vario )
|
||||
ende = en
|
||||
line = Line.new(dxfattribs={"start": end,"end":en })
|
||||
line.dxf.layer = "6-SP"
|
||||
@@ -403,6 +408,7 @@ class VarioFoerderer(BaseModel):
|
||||
else:
|
||||
return start, ende
|
||||
def vario_erstellung(foerderer, doc, lib_doc, config, block, block_name_links, start, ende, voerder_richtung, winkel_VP_offset_vorne, winkel_VP_offset_hinten ):
|
||||
"""Erstellung der Vario Blöcke"""
|
||||
# Entnehmen der Motor und Umlenk station um die Gefähle auzurechnen und ob man diese tatsächlich einfügen muss
|
||||
winkel_motor = float(config.get("Ils 2.0 core winkel","winkel_motor"))
|
||||
winkel_umlenk = float(config.get("Ils 2.0 core winkel","winkel_umlenk"))
|
||||
@@ -488,7 +494,7 @@ class VarioFoerderer(BaseModel):
|
||||
block.add_blockref(block_Vario_Motorstation_500mm, (start[0]-x , start[1] - motor_offset_x/2 -y ,start[2] - hoehe_vario +motor_offset_z/2),dxfattribs={"rotation": 90, "layer":layer_motor,"color": color_motor})
|
||||
start = start[0] , start[1] - motor_offset_x,start[2] + motor_offset_z
|
||||
|
||||
# Einfügen der 51 grad Bogen und deren notwendigen Werten von den attributen des bogens in den block
|
||||
# Einfügen der grad Bogen und deren notwendigen Werten von den attributen des bogens in den block
|
||||
winkel_core = int(config.get("Ils 2.0 core winkel","winkel_boegen"))
|
||||
winkel_plus = winkel + winkel_core
|
||||
block_Vario_Bogen_auf = (f"Vario_Bogen_auf_{winkel_plus}°")
|
||||
@@ -501,14 +507,14 @@ class VarioFoerderer(BaseModel):
|
||||
block_Vario_Bogen_auf = block_methoden.dreh_block(block_Vario_Bogen_auf, doc,lib_doc,math.radians(winkel_core))
|
||||
block_Vario_Bogen_ab = block_methoden.dreh_block(block_Vario_Bogen_ab, doc,lib_doc,math.radians(-winkel))
|
||||
|
||||
|
||||
#Entnehmen der Werte von den Attributen
|
||||
Vario_Bogen_auf_Delta_SP_0 = list(float(att)for att in re.split(r"[;,]", auf_attrib["DELTA_SP_0"]))
|
||||
Vario_Bogen_auf_Delta_SP_1 = list(float(att) for att in re.split(r"[;,]", auf_attrib["DELTA_SP_1"]))
|
||||
Vario_Bogen_ab_Delta_SP_0 = list(float(att) for att in re.split(r"[;,]", ab_attrib["DELTA_SP_0"]))
|
||||
Vario_Bogen_ab_Delta_SP_1 = list(float(att) for att in re.split(r"[;,]", ab_attrib["DELTA_SP_1"]))
|
||||
Vario_Bogen_auf_Delta_VP_1 = list(float(att) for att in re.split(r"[;,]", auf_attrib["DELTA_VP_1"]))
|
||||
Vario_Bogen_ab_Delta_VP_0= list(float(att) for att in re.split(r"[;,]", ab_attrib["DELTA_VP_0"]))
|
||||
|
||||
# Werte von den Attributen durch den Winkel ändern wegen der Neugung in 3 Dimensionalen raum
|
||||
Vario_Bogen_auf_Delta_SP_0 = [Vario_Bogen_auf_Delta_SP_0 [0] * math.cos(math.radians(winkel_core))+ Vario_Bogen_auf_Delta_SP_0[2]* math.sin(math.radians(winkel_core)) ,Vario_Bogen_auf_Delta_SP_0[1],-Vario_Bogen_auf_Delta_SP_0[0] * math.sin(math.radians(winkel_core))+ Vario_Bogen_auf_Delta_SP_0[2] * math.cos(math.radians(winkel_core)) ]
|
||||
Vario_Bogen_auf_Delta_SP_1 = [Vario_Bogen_auf_Delta_SP_1 [0] * math.cos(math.radians(winkel_core))+ Vario_Bogen_auf_Delta_SP_1[2]* math.sin(math.radians(winkel_core)) ,Vario_Bogen_auf_Delta_SP_1[1],-Vario_Bogen_auf_Delta_SP_1[0] * math.sin(math.radians(winkel_core))+ Vario_Bogen_auf_Delta_SP_1[2] * math.cos(math.radians(winkel_core)) ]
|
||||
Vario_Bogen_ab_Delta_SP_0 = [Vario_Bogen_ab_Delta_SP_0 [0] * math.cos(math.radians(-winkel))+ Vario_Bogen_ab_Delta_SP_0[2]* math.sin(math.radians(-winkel)) ,Vario_Bogen_ab_Delta_SP_0[1],-Vario_Bogen_ab_Delta_SP_0[0] * math.sin(math.radians(-winkel))+ Vario_Bogen_ab_Delta_SP_0[2] * math.cos(math.radians(-winkel)) ]
|
||||
@@ -656,6 +662,7 @@ class VarioFoerderer(BaseModel):
|
||||
ende = ende[0] , ende[1] + motor_offset_x,ende[2] +motor_offset_z
|
||||
elif winkel == 3:
|
||||
ende_Motor_VP = ende[0] - vario_abstand, ende[1]- winkel_VP_offset_vorne[0] ,ende[2] - winkel_VP_offset_hinten[2]
|
||||
|
||||
if winkel != 3:
|
||||
winkel_core = int(config.get("Ils 2.0 core winkel","winkel_boegen"))
|
||||
winkel_minus = winkel - winkel_core
|
||||
@@ -728,7 +735,7 @@ class VarioFoerderer(BaseModel):
|
||||
copy = line.copy()
|
||||
copy.translate(-x,-y,-hoehe_vario)
|
||||
block.add_entity(copy)
|
||||
|
||||
#Sonderlogik für grad 3, weil es kein bogen braucht
|
||||
elif winkel == 3:
|
||||
# Nur erstellung der zwischen und Vario linie weil der Bogen hier nicht nötig ist
|
||||
line_VP = Line.new(dxfattribs={"start": start_Umlenkstation_VP,"end": ende_Motor_VP})
|
||||
|
||||
Reference in New Issue
Block a user