53 lines
1.4 KiB
YAML
53 lines
1.4 KiB
YAML
name: linear_hole_pattern
|
|
category: feature_operation
|
|
description: "在实体上按矩形网格阵列打通孔"
|
|
|
|
parameters:
|
|
- name: diameter
|
|
type: float
|
|
unit: mm
|
|
range: [0.1, 500]
|
|
required: true
|
|
- name: rows
|
|
type: int
|
|
range: [1, 100]
|
|
required: true
|
|
- name: cols
|
|
type: int
|
|
range: [1, 100]
|
|
required: true
|
|
- name: row_spacing
|
|
type: float
|
|
unit: mm
|
|
range: [0.1, 5000]
|
|
required: true
|
|
- name: col_spacing
|
|
type: float
|
|
unit: mm
|
|
range: [0.1, 5000]
|
|
required: true
|
|
|
|
preconditions:
|
|
- "target 必须是一个实体(Part)"
|
|
- "网格阵列的总跨度不能超出实体的XY包围盒"
|
|
|
|
postconditions:
|
|
- "体积应减小(打孔是去除材料)"
|
|
|
|
# 机器可执行的断言类型,执行器每次操作后无条件核对
|
|
postcondition_check: volume_decrease
|
|
|
|
failure_modes:
|
|
- code: NO_TARGET
|
|
condition: "target 为空"
|
|
message: "linear_hole_pattern 需要一个实体作为输入"
|
|
- code: PATTERN_OUT_OF_BOUNDS
|
|
condition: "网格阵列跨度超出实体的包围盒范围"
|
|
message: "孔阵列超出零件边界,请检查 rows/cols/spacing 与零件尺寸"
|
|
|
|
implementation: capabilities/impl/linear_hole_pattern.py
|
|
|
|
examples:
|
|
- text: "在这块板上打3x4的孔阵列,孔径5mm,行间距20mm,列间距25mm"
|
|
params: { diameter: 5, rows: 3, cols: 4, row_spacing: 20, col_spacing: 25 }
|