From 9f3e6349288f6146f64e4043735d1f2b6126e797 Mon Sep 17 00:00:00 2001 From: cjw <792430652@qq.com> Date: Sun, 15 Feb 2026 00:50:22 +0800 Subject: [PATCH] init --- src/api/routes.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/api/routes.py b/src/api/routes.py index b4d090c..24fe28d 100644 --- a/src/api/routes.py +++ b/src/api/routes.py @@ -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_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 = { "metadata": { "file_name": Path(file_path).name, @@ -276,7 +288,12 @@ async def process_file_core( "length": int(mold_length), "width": int(mold_width), "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": { "cavity_count": 1, @@ -284,7 +301,8 @@ async def process_file_core( "geometric_characteristics": { "product_weight": f"{product_weight_g:.2f} g", "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": { "potential_weld_lines": "center",