archipack_roof.py 文件源码

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

项目:archipack 作者: s-leger 项目源码 文件源码
def relocate_child(self, context, o, g, child):

        d = archipack_roof.datablock(child)

        if d is not None and d.t_part - 1 < len(g.segs):
            # print("relocate_child(%s)" % (child.name))

            seg = g.segs[d.t_part]
            # adjust T part matrix_world from parent
            # T part origin located on parent axis
            # with y in parent direction
            t = (d.t_dist_x / seg.length)
            x, y, z = seg.lerp(t).to_3d()
            dy = -seg.v.normalized()
            child.matrix_world = o.matrix_world * Matrix([
                [dy.x, -dy.y, 0, x],
                [dy.y, dy.x, 0, y],
                [0, 0, 1, z],
                [0, 0, 0, 1]
            ])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号