21 lines
514 B
Python
21 lines
514 B
Python
from build123d import loft as _loft
|
|
|
|
|
|
def validate(context, target, params):
|
|
errors = []
|
|
ids = params["profile_ids"]
|
|
|
|
if len(ids) < 2:
|
|
errors.append("NOT_ENOUGH_PROFILES: 放样至少需要2个截面")
|
|
|
|
for pid in ids:
|
|
if pid not in context:
|
|
errors.append(f"UNKNOWN_ID: 上下文中不存在 '{pid}'")
|
|
|
|
return errors
|
|
|
|
|
|
def run(context, target, params):
|
|
profiles = [context[pid] for pid in params["profile_ids"]]
|
|
return _loft(profiles, ruled=params["ruled"])
|