Пример #1
0
def flow_trajectories(vertices, triangles, flow_file, steps=10, timestep=5):
    """
    Compute the positive mass stiffness surface flow of a surface mesh.

    Parameters:
    - - - - -
    vertices: float array
        list of vertices in mesh
    triangles: int array
        list of faces in mesh
    flow_file: string
        file (memory map) in which to save flow lines
    steps: int
        number of diffusion steps
    timestep: int
        diffusion time
    """

    # initialize flow object
    tri_mesh_flow = TriMeshFlow_Vtk(triangles, vertices)
    # compute final flow surface
    points = tri_mesh_flow.positive_mass_stiffness_smooth(steps,
                                                          timestep,
                                                          flow_file=flow_file)
    # get flow trajectory for each mesh vertex
    flow_lines = tri_mesh_flow.get_vertices_flow()

    return flow_lines