einige Fehler für cps wurden korrigiert.

This commit is contained in:
2025-09-30 13:17:12 +02:00
parent 1c7f8c28d2
commit 29b4a96365
18 changed files with 94 additions and 94 deletions
@@ -217,7 +217,7 @@ def process_doppelweiche_items(data, BogenProfileWidth, WeichenGerade):
item["OFWeiche_CP1_y_mm"] = round(item["Objekt_height_mm"], 4)
item["OFWeiche_CP2_x_mm"] = round(round(BogenProfileWidth/2,7) * cos_value, 4)
if item["KurvenWinkel"] == 22.5:
item["OFWeiche_CP2_y_mm"] =20
item["OFWeiche_CP2_y_mm"] =round(round(BogenProfileWidth/2,7) * sin_value, 4)
else:
item["OFWeiche_CP2_y_mm"] = round(round(BogenProfileWidth/2,7) * sin_value, 4)
item["OFWeiche_CP3_x_mm"] = round(round(BogenProfileWidth/2,7) * cos_value + item["OFWeiche_center_line_width_mm"], 4)
@@ -237,8 +237,8 @@ def process_json_file(input_file, output_file):
cp4_y = round(item["OFWeiche_CP4_y_mm"] * scale*scale_RD_H, 3)
cp1_dir = 180
cp2_dir = round(360 - kurven_winkel, 1)
cp3_dir = round(kurven_winkel, 1)
cp2_dir = 270
cp3_dir = 90
cp4_dir = 0
connection_points.extend([
@@ -69,8 +69,8 @@ def process_lr_file(filepath, filename, stats):
# Print all straight paths
print("\n 🔍 All straight path details:")
for line in straight_lines:
print(f" Path{line['index']}: ({line['p1'][0]:.2f},{line['p1'][1]:.2f})→"
f"({line['p2'][0]:.2f},{line['p2'][1]:.2f}) length={line['length']:.4f}mm")
print(f" Path{line['index']}: ({line['p1'][0]:.3f},{line['p1'][1]:.3f})→"
f"({line['p2'][0]:.3f},{line['p2'][1]:.3f}) length={line['length']:.4f}mm")
# Group by length
length_groups = group_lines_by_length(straight_lines)
@@ -81,8 +81,8 @@ def process_lr_file(filepath, filename, stats):
for group in perfect_pairs:
print(f" ┌ Length group ({group[0]['length']:.4f}mm, 2 paths)")
for line in group:
print(f" │ Path{line['index']}: ({line['p1'][0]:.2f},{line['p1'][1]:.2f})→"
f"({line['p2'][0]:.2f},{line['p2'][1]:.2f})")
print(f" │ Path{line['index']}: ({line['p1'][0]:.3f},{line['p1'][1]:.3f})→"
f"({line['p2'][0]:.3f},{line['p2'][1]:.3f})")
print("" + "" * 40)
if len(perfect_pairs) == 1:
@@ -130,8 +130,8 @@ def process_delta_file(filepath, filename, stats):
# Print all straight paths
print("\n 🔍 All straight path details:")
for line in straight_lines:
print(f" Path{line['index']}: ({line['p1'][0]:.2f},{line['p1'][1]:.2f})→"
f"({line['p2'][0]:.2f},{line['p2'][1]:.2f}) length={line['length']:.4f}mm")
print(f" Path{line['index']}: ({line['p1'][0]:.3f},{line['p1'][1]:.3f})→"
f"({line['p2'][0]:.3f},{line['p2'][1]:.3f}) length={line['length']:.4f}mm")
# Group by length
length_groups = group_lines_by_length(straight_lines)
@@ -142,8 +142,8 @@ def process_delta_file(filepath, filename, stats):
for group in perfect_triples:
print(f" ┌ Length group ({group[0]['length']:.4f}mm, 3 paths)")
for line in group:
print(f" │ Path{line['index']}: ({line['p1'][0]:.2f},{line['p1'][1]:.2f})→"
f"({line['p2'][0]:.2f},{line['p2'][1]:.2f})")
print(f" │ Path{line['index']}: ({line['p1'][0]:.3f},{line['p1'][1]:.3f})→"
f"({line['p2'][0]:.3f},{line['p2'][1]:.3f})")
print("" + "" * 40)
if len(perfect_triples) == 1:
@@ -202,8 +202,8 @@ def find_straight_lines(root):
'index': i,
'element': path,
'length': round(length, 4), # Keep 4 decimal places
'p1': (round(p1[0], 2), round(p1[1], 2)), # Coordinates rounded to 2 decimals
'p2': (round(p2[0], 2), round(p2[1], 2))
'p1': (round(p1[0], 3), round(p1[1], 3)), # Coordinates rounded to 2 decimals
'p2': (round(p2[0], 3), round(p2[1], 3))
})
return lines
@@ -1203,9 +1203,9 @@
"OFWeiche_CP1_x_mm": 120.9385,
"OFWeiche_CP1_y_mm": 348.0517,
"OFWeiche_CP2_x_mm": 19.4385,
"OFWeiche_CP2_y_mm": 20,
"OFWeiche_CP2_y_mm": 8.0517,
"OFWeiche_CP3_x_mm": 222.4385,
"OFWeiche_CP3_y_mm": 20
"OFWeiche_CP3_y_mm": 8.0517
},
{
"Sivasnr": "OFWeichenkoerperDoppel",
@@ -1222,9 +1222,9 @@
"OFWeiche_CP1_x_mm": 120.9385,
"OFWeiche_CP1_y_mm": 348.0517,
"OFWeiche_CP2_x_mm": 19.4385,
"OFWeiche_CP2_y_mm": 20,
"OFWeiche_CP2_y_mm": 8.0517,
"OFWeiche_CP3_x_mm": 222.4385,
"OFWeiche_CP3_y_mm": 20
"OFWeiche_CP3_y_mm": 8.0517
},
{
"Sivasnr": 834342101,
@@ -1241,9 +1241,9 @@
"OFWeiche_CP1_x_mm": 120.9385,
"OFWeiche_CP1_y_mm": 348.0517,
"OFWeiche_CP2_x_mm": 19.4385,
"OFWeiche_CP2_y_mm": 20,
"OFWeiche_CP2_y_mm": 8.0517,
"OFWeiche_CP3_x_mm": 222.4385,
"OFWeiche_CP3_y_mm": 20
"OFWeiche_CP3_y_mm": 8.0517
},
{
"Sivasnr": 834342200,
@@ -2625,13 +2625,13 @@
"id": "cp2",
"x": 0.0,
"y": 500.0,
"direction": 360
"direction": 270
},
{
"id": "cp3",
"x": 1000.0,
"y": 500.0,
"direction": 0
"direction": 90
},
{
"id": "cp4",
@@ -2679,13 +2679,13 @@
"id": "cp2",
"x": 0.0,
"y": 500.0,
"direction": 360
"direction": 270
},
{
"id": "cp3",
"x": 1000.0,
"y": 500.0,
"direction": 0
"direction": 90
},
{
"id": "cp4",
@@ -2940,9 +2940,9 @@
"OFWeiche_CP1_x_mm": 120.9385,
"OFWeiche_CP1_y_mm": 348.0517,
"OFWeiche_CP2_x_mm": 19.4385,
"OFWeiche_CP2_y_mm": 20,
"OFWeiche_CP2_y_mm": 8.0517,
"OFWeiche_CP3_x_mm": 222.4385,
"OFWeiche_CP3_y_mm": 20,
"OFWeiche_CP3_y_mm": 8.0517,
"Objekt_width_px": 914.1804,
"Objekt_height_px": 1315.471,
"calculated_SVG_width_px": 694.9453257,
@@ -2960,13 +2960,13 @@
{
"id": "cp2",
"x": 80.365,
"y": 57.463,
"y": 23.134,
"direction": 337.5
},
{
"id": "cp3",
"x": 919.635,
"y": 57.463,
"y": 23.134,
"direction": 22.5
}
]
@@ -2986,9 +2986,9 @@
"OFWeiche_CP1_x_mm": 120.9385,
"OFWeiche_CP1_y_mm": 348.0517,
"OFWeiche_CP2_x_mm": 19.4385,
"OFWeiche_CP2_y_mm": 20,
"OFWeiche_CP2_y_mm": 8.0517,
"OFWeiche_CP3_x_mm": 222.4385,
"OFWeiche_CP3_y_mm": 20,
"OFWeiche_CP3_y_mm": 8.0517,
"Objekt_width_px": 914.1804,
"Objekt_height_px": 1315.471,
"calculated_SVG_width_px": 694.9453257,
@@ -3006,13 +3006,13 @@
{
"id": "cp2",
"x": 80.365,
"y": 57.463,
"y": 23.134,
"direction": 337.5
},
{
"id": "cp3",
"x": 919.635,
"y": 57.463,
"y": 23.134,
"direction": 22.5
}
]
@@ -3032,9 +3032,9 @@
"OFWeiche_CP1_x_mm": 120.9385,
"OFWeiche_CP1_y_mm": 348.0517,
"OFWeiche_CP2_x_mm": 19.4385,
"OFWeiche_CP2_y_mm": 20,
"OFWeiche_CP2_y_mm": 8.0517,
"OFWeiche_CP3_x_mm": 222.4385,
"OFWeiche_CP3_y_mm": 20,
"OFWeiche_CP3_y_mm": 8.0517,
"Objekt_width_px": 914.1804,
"Objekt_height_px": 1315.471,
"calculated_SVG_width_px": 694.9453257,
@@ -3052,13 +3052,13 @@
{
"id": "cp2",
"x": 80.365,
"y": 57.463,
"y": 23.134,
"direction": 337.5
},
{
"id": "cp3",
"x": 919.635,
"y": 57.463,
"y": 23.134,
"direction": 22.5
}
]