15 lines
358 B
Python
15 lines
358 B
Python
from build123d import Axis
|
|
|
|
_AXES = {"X": Axis.X, "Y": Axis.Y, "Z": Axis.Z}
|
|
|
|
|
|
def validate(context, target, params):
|
|
errors = []
|
|
if target is None:
|
|
errors.append("NO_TARGET: rotate 需要一个草图或实体作为输入")
|
|
return errors
|
|
|
|
|
|
def run(context, target, params):
|
|
return target.rotate(_AXES[params["axis"]], params["angle"])
|