49 lines
1.4 KiB
YAML
49 lines
1.4 KiB
YAML
name: chamfer_edge
|
|
category: feature_operation
|
|
description: "对实体指定边做45°等距倒角。可用by_index精确处理孔口或局部边,先inspect_geometry(include_edges=true)获取当前实体边索引。"
|
|
|
|
parameters:
|
|
- name: radius
|
|
type: float
|
|
unit: mm
|
|
range: [0.05, 100]
|
|
required: true
|
|
- name: edge_selector
|
|
type: enum
|
|
options: [outer_top, outer_bottom, all, by_index]
|
|
required: true
|
|
|
|
- name: edge_indices
|
|
type: list_int
|
|
required: false
|
|
description: by_index时必填;只能使用本次target最新inspect_geometry返回的索引,每次几何改变后重新获取。
|
|
schema:
|
|
type: array
|
|
minItems: 1
|
|
maxItems: 100
|
|
items: {type: integer, minimum: 0}
|
|
|
|
preconditions:
|
|
- "radius 必须小于所选边所在面最短边长的一半"
|
|
- "该操作必须在对应实体完成布尔运算(如打孔)之后执行"
|
|
|
|
postconditions:
|
|
- "体积应减小(倒角是去除材料)"
|
|
|
|
# 机器可执行的断言类型,执行器每次操作后无条件核对
|
|
postcondition_check: volume_decrease
|
|
|
|
failure_modes:
|
|
- code: NO_TARGET
|
|
condition: "target 为空"
|
|
message: "chamfer_edge 需要一个实体作为输入"
|
|
- code: RADIUS_TOO_LARGE
|
|
condition: "radius >= min(实体X/Y/Z尺寸)/2"
|
|
message: "倒角半径超出允许范围"
|
|
|
|
implementation: capabilities/impl/chamfer_edge.py
|
|
|
|
examples:
|
|
- text: "外圈顶部倒角1.5mm"
|
|
params: { radius: 1.5, edge_selector: outer_top }
|