Skip to content

Provide a way to clip lines outside the xyz limits #39

Description

@moorepants

Describe the feature you'd like

I created this animation:

Image

If I could clip the ground line at the x limits, then, because I have the animation cyclic, the ground would always look to be moving under the feet.

It turns out that matplotlib3d isn't so easy to clip data outside xyz limits. There was this PR: matplotlib/matplotlib#27349 but if I add axlim_clip=True to the symmeplot line, it works but as expected it removes the whole line.

Maybe if we could set values outside the limits to NaN this would work.

I hit this in this PR: csu-hmc/opty#29

I have faked it with something like:

    scene.add_line([
        origin.locatenew('gl', -0.8*ground.x),
        origin.locatenew('gl', -0.7999*ground.x),
        origin,
        origin.locatenew('gr', 0.7999*ground.x),
        origin.locatenew('gr', 0.8*ground.x),
    ], linestyle='--', axlim_clip=True)

but that does not work either. I want the end points of the line to both move the same way so the dotted aspect of it gives the illusion of the ground moving under the walker.

Image

I struggle to think of a solution for this. I thought I'd share. This has come up with simulating the bicycle too, when you want the scene to move with the bike.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions