This commit is contained in:
cjw
2026-02-15 00:50:22 +08:00
parent 632335dd66
commit 9f3e634928
+20 -2
View File
@@ -257,6 +257,18 @@ async def process_file_core(
mold_width = max(bbox_dims[1] if len(bbox_dims) > 1 else 100, 100) + 40 mold_width = max(bbox_dims[1] if len(bbox_dims) > 1 else 100, 100) + 40
mold_height = max(bbox_dims[2] if len(bbox_dims) > 2 else 60, 60) + 50 mold_height = max(bbox_dims[2] if len(bbox_dims) > 2 else 60, 60) + 50
# 计算分型线长度(基于产品周长)
if len(bbox_dims) >= 2:
parting_line_length = 2 * (bbox_dims[0] + bbox_dims[1])
else:
parting_line_length = 0
# 估算成型周期(基于体积)
# 周期 = 冷却时间 + 注塑时间 + 开合模时间
cooling_time = (wall_thickness_max ** 2) * 5 # 简化公式
injection_time = max(5, volume_cm3 / 50) # 注塑时间
cycle_time = cooling_time + injection_time + 8 # 开合模约8秒
detailed_cavity_json = { detailed_cavity_json = {
"metadata": { "metadata": {
"file_name": Path(file_path).name, "file_name": Path(file_path).name,
@@ -276,7 +288,12 @@ async def process_file_core(
"length": int(mold_length), "length": int(mold_length),
"width": int(mold_width), "width": int(mold_width),
"height": int(mold_height) "height": int(mold_height)
} },
"mold_material": "Aluminum Alloy 7075",
"mold_hardness": "HB 150-170",
"surface_finish": "Ra 0.8 μm",
"parting_line_length": f"{parting_line_length:.2f} mm",
"estimated_cycle_time": f"{int(cycle_time)} 秒"
}, },
"mold_cavities": { "mold_cavities": {
"cavity_count": 1, "cavity_count": 1,
@@ -284,7 +301,8 @@ async def process_file_core(
"geometric_characteristics": { "geometric_characteristics": {
"product_weight": f"{product_weight_g:.2f} g", "product_weight": f"{product_weight_g:.2f} g",
"wall_thickness_range": f"{wall_thickness_min:.2f} - {wall_thickness_max:.2f} mm", "wall_thickness_range": f"{wall_thickness_min:.2f} - {wall_thickness_max:.2f} mm",
"complexity_score": round(complexity_score, 2) "complexity_score": round(complexity_score, 2),
"product_volume": f"{volume_cm3:.2f} cm³"
}, },
"quality_considerations": { "quality_considerations": {
"potential_weld_lines": "center", "potential_weld_lines": "center",