Files
2026-09-24 10:40:57 +08:00

19 lines
520 B
Python

def validate(context, target, params):
errors = []
if target is None:
errors.append("NO_TARGET: linear_pattern_body 需要一个实体作为输入")
return errors
def run(context, target, params):
count = params["count"]
spacing = params["spacing"]
axis = params["direction"]
result = target
for i in range(1, count):
offset = spacing * i
vec = (offset, 0, 0) if axis == "X" else (0, offset, 0)
result = result + target.translate(vec)
return result