feat: 完善参数化编辑和孔修改稳定性
This commit is contained in:
@@ -94,7 +94,7 @@ class TransformMixin:
|
||||
risk = readiness["translate_risk"]
|
||||
status = readiness["translate_status"]
|
||||
if part_solid_count <= 1 and status != "blocked":
|
||||
warnings = _join_nonempty(warnings, "当前Part只有一个Solid,平移Solid实际会移动整个Part shape。")
|
||||
warnings = _join_nonempty(warnings, "当前零件只有一个Solid,平移Solid实际会移动整个零件 shape。")
|
||||
if risk == "low":
|
||||
risk = "medium"
|
||||
status = "caution"
|
||||
@@ -119,12 +119,12 @@ class TransformMixin:
|
||||
raise ValueError(str(plan["message"]))
|
||||
part = self.part_by_id(part_id)
|
||||
if part is None:
|
||||
raise ValueError(f"Unknown part id {part_id}")
|
||||
raise ValueError(f"未知零件 ID {part_id}")
|
||||
part.shape = _translated_shape_by_vector(part.shape, vector)
|
||||
_ensure_valid_shape(part.shape)
|
||||
self.refresh_topology()
|
||||
return (
|
||||
f"Part translated: part {part_id}, vector={_format_tuple(vector)}, "
|
||||
f"零件已平移: 零件 {part_id}, vector={_format_tuple(vector)}, "
|
||||
f"distance={float(plan['translation_distance']):g}, risk={plan['risk']}."
|
||||
)
|
||||
|
||||
@@ -192,7 +192,7 @@ class TransformMixin:
|
||||
risk = readiness["rotate_risk"]
|
||||
status = readiness["rotate_status"]
|
||||
if part_solid_count <= 1 and status != "blocked":
|
||||
warnings = _join_nonempty(warnings, "当前Part只有一个Solid,旋转Solid实际会旋转整个Part shape。")
|
||||
warnings = _join_nonempty(warnings, "当前零件只有一个Solid,旋转Solid实际会旋转整个零件 shape。")
|
||||
if risk == "low":
|
||||
risk = "medium"
|
||||
status = "caution"
|
||||
@@ -218,12 +218,12 @@ class TransformMixin:
|
||||
raise ValueError(str(plan["message"]))
|
||||
part = self.part_by_id(part_id)
|
||||
if part is None:
|
||||
raise ValueError(f"Unknown part id {part_id}")
|
||||
raise ValueError(f"未知零件 ID {part_id}")
|
||||
part.shape = _rotated_shape(part.shape, str(plan["rotation_axis"]), float(plan["rotation_angle_degrees"]), plan["rotation_center"])
|
||||
_ensure_valid_shape(part.shape)
|
||||
self.refresh_topology()
|
||||
return (
|
||||
f"Part rotated: part {part_id}, axis={plan['rotation_axis']}, "
|
||||
f"零件已旋转: 零件 {part_id}, axis={plan['rotation_axis']}, "
|
||||
f"angle={float(plan['rotation_angle_degrees']):g}, center={_format_tuple(plan['rotation_center'])}, "
|
||||
f"risk={plan['risk']}."
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user