Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animate translation #103

Open
parmonom opened this issue Jan 27, 2024 · 0 comments
Open

Animate translation #103

parmonom opened this issue Jan 27, 2024 · 0 comments

Comments

@parmonom
Copy link

Hi, thank you very much for jupyter-cadquery.

I have problem to animate translation. On the example given, I am able to animate correctly all legs rotation. As I understand, the function add_track with argument "rz" gives the control on angular position vs time. However when I uncomment the line about translation, to lift the hexapod to run on grid, it creates a uniform linear motion in z-direction. It seams to me that add_track with argument "tz" gives the control in translation speed instead of position

t1

animation = Animation()

for name in leg_names:
    # move upper leg
    animation.add_track(f"/bottom/{name}", "rz", *horizontal(4, "middle" in name))

    # move lower leg
    animation.add_track(f"/bottom/{name}/lower", "rz", *vertical(8, 4, 0 if name in leg_group else 4, "left" in name))

    # lift hexapod to run on grid
    animation.add_track(f"bottom", "tz", [0, 4], [61.25] * 2)

animation.animate(speed=3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant