perpendicular_circum_center.py 文件源码

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

项目:mesh_doshape_tools 作者: YHOYO 项目源码 文件源码
def main(self, context):
        obj = bpy.context.object
        me = obj.data
        bm = bmesh.from_edit_mesh(me)

        edges = [e for e in bm.edges if (e.select and not e.hide)]         
        vertices = [v for v in bm.verts if (v.select and not v.hide)]

        listavertices=[]
        if len(edges) !=0:

            print("bordes seleccionados: " +  str(len(edges)))
            for edge in edges:
                listavertices.append(edge.verts[0])
                listavertices.append(edge.verts[1])
                edge.select=False
                print(listavertices)

            contador =  len(listavertices)
            print(contador)
            while contador != 1:
                v1 =  listavertices[contador-1].co
                v2 =  listavertices[contador-2].co
                v3 = (0,0,0)
                print(v1,v2)
                corte(bm, v1, v2, v3) 
                contador = contador - 1

        elif len(edges) ==0 and len(vertices) == 2:
            v1,v2 =[v.co for v in bm.verts if (v.select and not v.hide)]
            v3 = (0,0,0)

            print("seleccionados 2 vertices")
            corte(bm, v1, v2, v3)   
        else:
            print("seleccione minimo 1 borde o 2 vertices")



        bmesh.update_edit_mesh(me, True)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号