Hinzufügung von rotation in test_ils.csv
rotation system für kurven hinzugefügt, und rotation probleme für Linean behoben
This commit is contained in:
+20
-6
@@ -150,7 +150,7 @@ def handle_ils_2_0_kreisel(msp, teileid, merkmale, x, y, doc, lib_doc, verbose,
|
||||
if i < len(positions):
|
||||
pos = (positions[i][0] + offset[0], positions[i][1] + offset[1])
|
||||
import_block(blockname, lib_doc, doc)
|
||||
bref = msp.add_blockref(blockname, pos, dxfattribs={"rotation": rotation})
|
||||
bref = msp.add_blockref(blockname, pos, dxfattribs={"rotation": merkmale.get("Drehung")})
|
||||
bref.add_auto_attribs({ATTR_TAG: teileid})
|
||||
if verbose:
|
||||
print(f"[INFO] Block '{blockname}' (Kreisel) → {teileid} "
|
||||
@@ -236,6 +236,7 @@ def handle_standard(msp, blocknames, teileid, x, y, lib_doc, doc, verbose):
|
||||
print(f"[INFO] Block '{blockname}' (Standard) → {teileid} "
|
||||
f"({x:.1f}, {y:.1f})")
|
||||
|
||||
|
||||
def handle_ils_2_0_gefaellestrecke(msp, teileid, merkmale, x, y, doc, lib_doc, verbose, symbols):
|
||||
# blocks: [block1, block2], offsets: [(ox1, oy1), (ox2, oy2)]
|
||||
# Länge der Strecke (in Meter, Standard 10)
|
||||
@@ -292,17 +293,25 @@ def handle_omniflo(msp, teileid, merkmale, x, y, doc, lib_doc, verbose, symbols)
|
||||
winkel = float(merkmale.get("Drehung", 0))
|
||||
except Exception:
|
||||
winkel = 0.0
|
||||
|
||||
winkel_rad = math.radians(winkel)
|
||||
halbe_laenge = laenge / 2
|
||||
dx = halbe_laenge * math.cos(winkel_rad)
|
||||
dy = halbe_laenge * math.sin(winkel_rad)
|
||||
start = (x - dx, y - dy)
|
||||
ende = (x + dx, y + dy)
|
||||
|
||||
dx = halbe_laenge * math.sin(winkel_rad)
|
||||
dy = halbe_laenge * math.cos(winkel_rad)
|
||||
|
||||
start = (x + dx, y + dy)
|
||||
ende = (x - dx, y - dy)
|
||||
msp.add_line(start, ende)
|
||||
|
||||
if verbose:
|
||||
print(f"[INFO] Omniflo Gerade → {teileid} Linie von ({start[0]:.1f}, {start[1]:.1f}) nach ({ende[0]:.1f}, {ende[1]:.1f})")
|
||||
return
|
||||
# Sonst wie gehabt: Block mit SivasNummer
|
||||
if merkmale.get("Radius") is not None:
|
||||
r= float(merkmale.get("Radius"))
|
||||
|
||||
|
||||
if not lib_doc:
|
||||
print("[WARN] lib_doc nicht verfügbar, Block wird nicht eingefügt.")
|
||||
return
|
||||
@@ -314,7 +323,12 @@ def handle_omniflo(msp, teileid, merkmale, x, y, doc, lib_doc, verbose, symbols)
|
||||
print(f"[WARN] Omniflo-Block '{blockname}' nicht in Bibliothek {lib_doc.filename}. Überspringe {teileid}.")
|
||||
return
|
||||
import_block(blockname, lib_doc, doc)
|
||||
bref = msp.add_blockref(blockname, (x, y))
|
||||
if merkmale.get("Drehung")== 0:
|
||||
bref = msp.add_blockref(blockname, (x, y), dxfattribs={"xscale": 1.0, "yscale":1.0,"rotation": merkmale.get("Drehung")})
|
||||
|
||||
else:
|
||||
bref = msp.add_blockref(blockname, (x, y), dxfattribs={"xscale": 1.0, "yscale":1.0,"rotation": merkmale.get("Drehung")+180})
|
||||
|
||||
bref.add_auto_attribs({ATTR_TAG: teileid})
|
||||
if verbose:
|
||||
print(f"[INFO] Block '{blockname}' (Omniflo) → {teileid} ({x:.1f}, {y:.1f})")
|
||||
|
||||
Reference in New Issue
Block a user