stitches.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:mayakit 作者: danbradham 项目源码 文件源码
def cross_stitch(stitches=108, stitch_points=8, u_offset=0, tangent_offset=0, normal_fn=None):
    '''Create cross stitching between two curves'''

    a, b = cmds.ls(sl=True, dag=True, leaf=True)

    if not normal_fn:
        normal_fn = partial(sphere_normal, center=MVector(0, 0, 0))

    half_stitches = int(stitches * 0.5)
    u_offset_a = u_offset
    u_offset_b = u_offset + 1.0 / (half_stitches * 2)
    a0, a1 = MVector(*point_at_parameter(a, 0)), MVector(*point_at_parameter(a, u_offset_b))
    tangent_offset += (a0-a1).length() * 0.3
    print tangent_offset

    points = stitch_curves(a, b, half_stitches, stitch_points, u_offset_a, tangent_offset, normal_fn)
    cmds.curve(point=points)

    points = stitch_curves(a, b, half_stitches, stitch_points, u_offset_b, tangent_offset, normal_fn)
    cmds.curve(point=points)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号