Die Alte TEFID sind gelöscht und die Neue TEFID sind hinzugefügt.

This commit is contained in:
2025-09-17 12:52:20 +02:00
parent 64858e8a50
commit b2609f6570
107 changed files with 448 additions and 1637 deletions
@@ -51,8 +51,8 @@ def calculate_attributes(item):
# Calculate new dimensions with 3 decimal places precision
if processed_item["Winkel"]!=180:
calculated_width = processed_item["center_line_width_mm"] + sin_value * 21.040
calculated_height = processed_item["center_line_height_mm"] + 21.040 + cos_value * 21.040
calculated_width = processed_item["center_line_width_mm"]
calculated_height = processed_item["center_line_height_mm"] + 21.040*2
else:
calculated_width = processed_item["center_line_width_mm"]+21.040
calculated_height = processed_item["center_line_height_mm"]+ 21.040 + 21.040
@@ -26,8 +26,8 @@ def process_json_item(item):
item["calculated_objekt_height_mm"] = float(item["calculated_objekt_height_mm"])
# Calculate the direct mm to px conversions (requested additions)
item["Objekt_width_px"] = round(item["Objekt_width_mm"] * 3.7795, 3)
item["Objekt_height_px"] = round(item["Objekt_height_mm"] * 3.7795, 3)
item["Objekt_width_px"] = round((item["Objekt_width_mm"] * 3.779527592),4)
item["Objekt_height_px"] = round((item["Objekt_height_mm"] * 3.779527592),4)
winkel_rad = math.radians(item["Winkel"])
sin_value = math.sin(winkel_rad)
@@ -59,7 +59,7 @@ def process_json_item(item):
if item["Winkel"]==180:
item["calculated_SVG_width_px"] = round(item["Objekt_width_mm"] * scale+3.7795/2, 3)
else:
item["calculated_SVG_width_px"] = round(item["Objekt_width_mm"] * scale+3.7795/2/cos_value, 3)
item["calculated_SVG_width_px"] = round(item["Objekt_width_mm"] * scale+3.7795/2/sin_value, 3)
scale_RD_W = round(1000 / item["calculated_SVG_width_px"], 6)
scale_RD_H = 1
@@ -74,7 +74,7 @@ def process_json_item(item):
if item["Winkel"]==180:
cp2_x = 0
else:
cp2_x = round((item["center_line_width_mm"] * scale) * scale_RD_W, 3)
cp2_x = round((1000/item["Objekt_width_mm"]*item["center_line_width_mm"]), 3)
cp2_y = round(((21.040 + item["center_line_height_mm"]) * scale) * scale_RD_H, 3)
else:
cp2_x = round((item["center_line_width_mm"] * scale) * scale_RD_W, 3)
@@ -68,8 +68,8 @@ def process_files(json_file_path, txt_files_dir):
for cp in txt_content["connectionPoints"]}
# Update width and height
new_width = round(json_item["Objekt_width_mm"] * 3.7795, 3)
new_height = round(json_item["Objekt_height_mm"] * 3.7795, 3)
new_width = json_item["Objekt_width_px"]
new_height = json_item["Objekt_width_px"]
txt_content["width"] = new_width
txt_content["height"] = new_height
@@ -160,6 +160,8 @@ def process_files(json_file_path, txt_files_dir):
if __name__ == "__main__":
json_path = os.environ.get("JSON_PATH", "JSON")
json_file_path = os.path.join(json_path, "2_calculated_px_cps_output.json")
txt_files_dir = os.environ.get("PROPS_PATH", "props")
txt_files_dir = r"C:\Program Files\RuleDesigner\RDConfigurator Fusion\WebApi\Editor2D\SSG\shapes\props"
# 确保目录存在
os.makedirs(txt_files_dir, exist_ok=True)
process_files(json_file_path, txt_files_dir)
print("\nProcessing complete!")
@@ -247,9 +247,9 @@
"Winkel": 180.0,
"center_line_width_mm": 800.0,
"center_line_height_mm": 1300.0,
"Objekt_width_mm": 821.04,
"Objekt_width_mm": 800.0,
"Objekt_height_mm": 1342.08,
"calculated_objekt_width_mm": 821.04,
"calculated_objekt_width_mm": 800.0,
"calculated_objekt_height_mm": 1342.08
},
{
@@ -9,8 +9,8 @@
"Objekt_height_mm": 435.421,
"calculated_objekt_width_mm": 684.369,
"calculated_objekt_height_mm": 435.423,
"Objekt_width_px": 2586.565,
"Objekt_height_px": 1645.674,
"Objekt_width_px": 2586.584,
"Objekt_height_px": 1645.6857,
"calculated_SVG_width_px": 1000,
"calculated_SVG_height_px": 638.912,
"scale_factor": 1.4612043,
@@ -39,8 +39,8 @@
"Objekt_height_mm": 368.405,
"calculated_objekt_width_mm": 527.258,
"calculated_objekt_height_mm": 368.407,
"Objekt_width_px": 1992.772,
"Objekt_height_px": 1392.387,
"Objekt_width_px": 1992.7862,
"Objekt_height_px": 1392.3969,
"calculated_SVG_width_px": 1000,
"calculated_SVG_height_px": 700.764,
"scale_factor": 1.8966047,
@@ -69,8 +69,8 @@
"Objekt_height_mm": 521.04,
"calculated_objekt_width_mm": 521.04,
"calculated_objekt_height_mm": 521.04,
"Objekt_width_px": 1969.271,
"Objekt_height_px": 1969.271,
"Objekt_width_px": 1969.2851,
"Objekt_height_px": 1969.2851,
"calculated_SVG_width_px": 1000,
"calculated_SVG_height_px": 1000.0,
"scale_factor": 1.919238,
@@ -99,8 +99,8 @@
"Objekt_height_mm": 571.04,
"calculated_objekt_width_mm": 571.04,
"calculated_objekt_height_mm": 571.04,
"Objekt_width_px": 2158.246,
"Objekt_height_px": 2158.246,
"Objekt_width_px": 2158.2614,
"Objekt_height_px": 2158.2614,
"calculated_SVG_width_px": 1000,
"calculated_SVG_height_px": 1000.0,
"scale_factor": 1.751191,
@@ -129,8 +129,8 @@
"Objekt_height_mm": 162.707,
"calculated_objekt_width_mm": 522.543,
"calculated_objekt_height_mm": 162.708,
"Objekt_width_px": 1974.947,
"Objekt_height_px": 614.951,
"Objekt_width_px": 1974.9619,
"Objekt_height_px": 614.9556,
"calculated_SVG_width_px": 1000,
"calculated_SVG_height_px": 316.314,
"scale_factor": 1.9137218,
@@ -159,8 +159,8 @@
"Objekt_height_mm": 162.707,
"calculated_objekt_width_mm": 522.543,
"calculated_objekt_height_mm": 162.708,
"Objekt_width_px": 1974.947,
"Objekt_height_px": 614.951,
"Objekt_width_px": 1974.9619,
"Objekt_height_px": 614.9556,
"calculated_SVG_width_px": 1000,
"calculated_SVG_height_px": 316.314,
"scale_factor": 1.9137218,
@@ -189,8 +189,8 @@
"Objekt_height_mm": 226.709,
"calculated_objekt_width_mm": 566.484,
"calculated_objekt_height_mm": 226.71,
"Objekt_width_px": 2141.022,
"Objekt_height_px": 856.847,
"Objekt_width_px": 2141.0381,
"Objekt_height_px": 856.8529,
"calculated_SVG_width_px": 1000,
"calculated_SVG_height_px": 402.877,
"scale_factor": 1.765278,
@@ -219,8 +219,8 @@
"Objekt_height_mm": 240.849,
"calculated_objekt_width_mm": 552.127,
"calculated_objekt_height_mm": 240.85,
"Objekt_width_px": 2086.76,
"Objekt_height_px": 910.289,
"Objekt_width_px": 2086.7755,
"Objekt_height_px": 910.2954,
"calculated_SVG_width_px": 1000,
"calculated_SVG_height_px": 438.894,
"scale_factor": 1.8111808,
@@ -249,8 +249,8 @@
"Objekt_height_mm": 301.914,
"calculated_objekt_width_mm": 610.143,
"calculated_objekt_height_mm": 301.916,
"Objekt_width_px": 2306.032,
"Objekt_height_px": 1141.084,
"Objekt_width_px": 2306.0485,
"Objekt_height_px": 1141.0923,
"calculated_SVG_width_px": 1000,
"calculated_SVG_height_px": 497.498,
"scale_factor": 1.6389627,
@@ -279,8 +279,8 @@
"Objekt_height_mm": 448.992,
"calculated_objekt_width_mm": 601.865,
"calculated_objekt_height_mm": 448.994,
"Objekt_width_px": 2274.749,
"Objekt_height_px": 1696.965,
"Objekt_width_px": 2274.7654,
"Objekt_height_px": 1696.9777,
"calculated_SVG_width_px": 1000,
"calculated_SVG_height_px": 748.047,
"scale_factor": 1.6615022,
@@ -309,8 +309,8 @@
"Objekt_height_mm": 559.396,
"calculated_objekt_width_mm": 768.096,
"calculated_objekt_height_mm": 559.397,
"Objekt_width_px": 2903.015,
"Objekt_height_px": 2114.237,
"Objekt_width_px": 2903.0362,
"Objekt_height_px": 2114.2526,
"calculated_SVG_width_px": 1000,
"calculated_SVG_height_px": 730.336,
"scale_factor": 1.3019223,
@@ -339,8 +339,8 @@
"Objekt_height_mm": 559.396,
"calculated_objekt_width_mm": 768.096,
"calculated_objekt_height_mm": 559.397,
"Objekt_width_px": 2903.015,
"Objekt_height_px": 2114.237,
"Objekt_width_px": 2903.0362,
"Objekt_height_px": 2114.2526,
"calculated_SVG_width_px": 1000,
"calculated_SVG_height_px": 730.336,
"scale_factor": 1.3019223,
@@ -369,8 +369,8 @@
"Objekt_height_mm": 525.674,
"calculated_objekt_width_mm": 777.628,
"calculated_objekt_height_mm": 525.676,
"Objekt_width_px": 2939.045,
"Objekt_height_px": 1986.785,
"Objekt_width_px": 2939.0665,
"Objekt_height_px": 1986.7994,
"calculated_SVG_width_px": 1000,
"calculated_SVG_height_px": 678.042,
"scale_factor": 1.2859619,
@@ -399,8 +399,8 @@
"Objekt_height_mm": 626.04,
"calculated_objekt_width_mm": 921.04,
"calculated_objekt_height_mm": 626.04,
"Objekt_width_px": 3481.071,
"Objekt_height_px": 2366.118,
"Objekt_width_px": 3481.0961,
"Objekt_height_px": 2366.1355,
"calculated_SVG_width_px": 1000,
"calculated_SVG_height_px": 681.6,
"scale_factor": 1.0857292,
@@ -429,8 +429,8 @@
"Objekt_height_mm": 336.475,
"calculated_objekt_width_mm": 880.491,
"calculated_objekt_height_mm": 336.477,
"Objekt_width_px": 3327.816,
"Objekt_height_px": 1271.707,
"Objekt_width_px": 3327.84,
"Objekt_height_px": 1271.7165,
"calculated_SVG_width_px": 1000,
"calculated_SVG_height_px": 384.817,
"scale_factor": 1.13573,
@@ -459,8 +459,8 @@
"Objekt_height_mm": 336.475,
"calculated_objekt_width_mm": 880.491,
"calculated_objekt_height_mm": 336.477,
"Objekt_width_px": 3327.816,
"Objekt_height_px": 1271.707,
"Objekt_width_px": 3327.84,
"Objekt_height_px": 1271.7165,
"calculated_SVG_width_px": 1000,
"calculated_SVG_height_px": 384.817,
"scale_factor": 1.13573,
@@ -489,8 +489,8 @@
"Objekt_height_mm": 821.04,
"calculated_objekt_width_mm": 821.04,
"calculated_objekt_height_mm": 821.04,
"Objekt_width_px": 3103.121,
"Objekt_height_px": 3103.121,
"Objekt_width_px": 3103.1433,
"Objekt_height_px": 3103.1433,
"calculated_SVG_width_px": 1000,
"calculated_SVG_height_px": 1000.0,
"scale_factor": 1.217967,
@@ -519,8 +519,8 @@
"Objekt_height_mm": 821.04,
"calculated_objekt_width_mm": 821.04,
"calculated_objekt_height_mm": 821.04,
"Objekt_width_px": 3103.121,
"Objekt_height_px": 3103.121,
"Objekt_width_px": 3103.1433,
"Objekt_height_px": 3103.1433,
"calculated_SVG_width_px": 1000,
"calculated_SVG_height_px": 1000.0,
"scale_factor": 1.217967,
@@ -549,10 +549,10 @@
"Objekt_height_mm": 871.04,
"calculated_objekt_width_mm": 711.04,
"calculated_objekt_height_mm": 871.04,
"Objekt_width_px": 2687.376,
"Objekt_height_px": 3292.096,
"Objekt_width_px": 2687.3953,
"Objekt_height_px": 3292.1197,
"calculated_SVG_height_px": 1000,
"calculated_SVG_width_px":816.312,
"calculated_SVG_width_px": 818.201,
"scale_factor": 1.1480529,
"connectionPoints": [
{
@@ -563,7 +563,7 @@
},
{
"id": "cp2",
"x": 0.0,
"x": 970.41,
"y": 1000.0,
"direction": 180.0
}
@@ -579,10 +579,10 @@
"Objekt_height_mm": 891.04,
"calculated_objekt_width_mm": 871.04,
"calculated_objekt_height_mm": 891.04,
"Objekt_width_px": 3292.096,
"Objekt_height_px": 3367.686,
"Objekt_width_px": 3292.1197,
"Objekt_height_px": 3367.7103,
"calculated_SVG_height_px": 1000,
"calculated_SVG_width_px": 977.554,
"calculated_SVG_width_px": 979.444,
"scale_factor": 1.1222841,
"connectionPoints": [
{
@@ -593,7 +593,7 @@
},
{
"id": "cp2",
"x": 0.0,
"x": 975.845,
"y": 1000.0,
"direction": 180.0
}
@@ -609,8 +609,8 @@
"Objekt_height_mm": 871.04,
"calculated_objekt_width_mm": 911.04,
"calculated_objekt_height_mm": 871.04,
"Objekt_width_px": 3443.276,
"Objekt_height_px": 3292.096,
"Objekt_width_px": 3443.3008,
"Objekt_height_px": 3292.1197,
"calculated_SVG_width_px": 1000,
"calculated_SVG_height_px": 957.984,
"scale_factor": 1.0976466,
@@ -635,14 +635,14 @@
"Winkel": 180.0,
"center_line_width_mm": 800.0,
"center_line_height_mm": 1300.0,
"Objekt_width_mm": 800,
"Objekt_width_mm": 800.0,
"Objekt_height_mm": 1342.08,
"calculated_objekt_width_mm": 800,
"calculated_objekt_width_mm": 800.0,
"calculated_objekt_height_mm": 1342.08,
"Objekt_width_px": 3023.5998,
"Objekt_height_px": 5072.391,
"Objekt_width_px": 3023.6221,
"Objekt_height_px": 5072.4284,
"calculated_SVG_height_px": 1000,
"calculated_SVG_width_px": 596.0897,
"calculated_SVG_width_px": 597.979,
"scale_factor": 0.7451121,
"connectionPoints": [
{
@@ -665,14 +665,14 @@
"Winkel": 180.0,
"center_line_width_mm": 800.0,
"center_line_height_mm": 1300.0,
"Objekt_width_mm": 821.04,
"Objekt_width_mm": 800.0,
"Objekt_height_mm": 1342.08,
"calculated_objekt_width_mm": 821.04,
"calculated_objekt_width_mm": 800.0,
"calculated_objekt_height_mm": 1342.08,
"Objekt_width_px": 3103.121,
"Objekt_height_px": 5072.391,
"Objekt_width_px": 3023.6221,
"Objekt_height_px": 5072.4284,
"calculated_SVG_height_px": 1000,
"calculated_SVG_width_px": 613.657,
"calculated_SVG_width_px": 597.979,
"scale_factor": 0.7451121,
"connectionPoints": [
{
@@ -699,8 +699,8 @@
"Objekt_height_mm": 671.04,
"calculated_objekt_width_mm": 671.04,
"calculated_objekt_height_mm": 671.04,
"Objekt_width_px": 2536.196,
"Objekt_height_px": 2536.196,
"Objekt_width_px": 2536.2142,
"Objekt_height_px": 2536.2142,
"calculated_SVG_width_px": 1000,
"calculated_SVG_height_px": 1000.0,
"scale_factor": 1.490224,
@@ -729,8 +729,8 @@
"Objekt_height_mm": 831.04,
"calculated_objekt_width_mm": 831.04,
"calculated_objekt_height_mm": 831.04,
"Objekt_width_px": 3140.916,
"Objekt_height_px": 3140.916,
"Objekt_width_px": 3140.9386,
"Objekt_height_px": 3140.9386,
"calculated_SVG_width_px": 1000,
"calculated_SVG_height_px": 1000.0,
"scale_factor": 1.203312,