def edges_matrix(vertices, edges, orientation): '''Matrix aligned with edge.''' origin, track, up = orientation normal = edges_direction(vertices, edges, out_numpy=False) normal_v = [Vector(n) for n in normal] center = edge_vertex(vertices, edges, origin) vals = matrix_normal([center, normal_v], track, up) return vals
def vertex_matrix(vertices, edges, faces, orientation): track, up = orientation bm = bmesh_from_pydata(vertices, edges, faces, normal_update=True) loc = [Vector(v) for v in vertices] normal = [v.normal for v in bm.verts] vals = matrix_normal([loc, normal], track, up) bm.free() return vals
def vertex_matrix(vertices, edges, faces, orientation): ''' orientation: contains origin track and up origin: String that can be First, Center, Last track: String that can be X, Y, Z, -X, -Y or -Z up: String that can be X, Y, Z, -X, -Y or -Z outputs each vertex matrix [matrix, matrix, matrix] ''' track, up = orientation bm = bmesh_from_pydata(vertices, edges, faces, normal_update=True) loc = [Vector(v) for v in vertices] normal = [v.normal for v in bm.verts] vals = matrix_normal([loc, normal], track, up) bm.free() return vals
def edges_matrix(vertices, edges, orientation): ''' Matrix aligned with edge. vertices: list as [vertex, vertex, ...], being each vertex [float, float, float]. edges: list with edges [[int, int], [int,int]...] orientation: contains origin track and up_axis origin: String that can be First, Center, Last track: String that can be X, Y, Z, -X, -Y or -Z up_axis: String that can be X, Y, Z, -X, -Y or -Z outputs each edge matrix [matrix, matrix, matrix] ''' origin, track, up_axis = orientation normal = edges_direction(vertices, edges, out_numpy=False) normal_v = [Vector(n) for n in normal] center = edge_vertex(vertices, edges, origin) vals = matrix_normal([center, normal_v], track, up_axis) return vals