Skip to content

Is there any way to advance time in offline website viewer, and keep it in one plot #19

Description

@otmanon

Hi, I'm currently interested in having a mesh, and deforming it with time. The examples I've seen (using libigl with meshplot) , seem to not show the mesh object changing with time, but instead show snapshots of the mesh taken at a specific time.

What I'd like to do is have a mesh at the start of the simulation, run the simulation, and be able to see it deform in real time in the viewer. I can't seem to find any functionality for it in the source code, does it exist? Can you think of a workaround I could do instead?
Thanks

Activity

  1. skoch9 commented on Jul 11, 2020

    @skoch9
    Owner

    Hi,
    you can update your plotted objects with the function p.update_object(vertices=new_v). A possible example of a plot that you describe then looks like this

    import meshplot as mp
    import time
    
    p = mp.plot(v, f)
    
    for i in range(100):
        v_new = run_simulation_step(v, f, ...)
        p.update_object(vertices=v_new)
        v = v_new
        time.sleep(0.1) # depending on how long your simulation step takes you want to wait for a little while
  2. bmahlbrand commented on Nov 23, 2020

    @bmahlbrand

    in the same vein, i'm curious about updating the wireframe of the plot for this purpose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions