【CSEN012】Write the Offset function in script



If you want to achieve the direction x,y,z offset based a current reference point, you can write the function Offset

Note: In python, if a= [0, 1, 2, 3] b=a, then if change the b value, a value will also be changed. Recommend use copy function.

def Offs(p,x,y,z):
    out = p.copy()
    out[0] =  out[0]+x
    out[1] =  out[1]+y
    out[2] =  out[2]+z
    return out


点击显示全文
赞同0
发表评论
分享

手机扫码分享
0
144
收藏
举报
收起
登录
  • 密码登录
  • 验证码登录
还没有账号,立即注册
还没有账号,立即注册
注册
已有账号,立即登录
选择发帖板块
举报
请选择举报理由
举报
举报说明