I am working on a project to simulate a hydraulic cylinder extending and contracting. It is working against a lever on a pivot, which means that one end (the ram) needs to be constrained to the pin on that pivot, while the other end (the cylinder) needs to remain at a fixed location but pivot along with the ram.

I'm sure this can be accomplished with a variety of object modifiers, but I'm having a really hard time working it out.

My object hierarchy, as of right now, looks like this: Object Hierarchy

The cylinder extended looks somewhat like this: Cylinder Extended

And retracted... enter image description here

Notice how the origins for the ram and the cylinder remain in the same general location (cylinder fixed to frame, ram fixed to arm).

I should also mention that this is an approximation of the project I'm actually working on.

Edit: The title is just one idea I have. To create a 2-point path and use the follow path constraint to keep the ram and cylinder aligned to it. The one place where I can't figure out how to make this work though is how to anchor just one path vertex to one end, and the other to the other end, causing it to scale and rotate according to the anchor points, where one anchor point is fixed and the other moves with the arm.


I got it working, finally. The comments provided above by Duarte Farrajota Ramos and Edgel3D gave me the bread crumbs I needed.

The working result

This new model contains a few parts:

  • Frame - Has a Limit Location constraint to keep it in place
  • ArmPivot - Has a Limit Location constraint to keep it in place
  • Arm - Has a Limit Location constraint to keep it in place, Limit Rotation to keep it from going further than the hydraulic cylinder would allow
  • ArmPin - Parented to Arm
  • ArmPin.001 - Parented to Frame
  • Cylinder - Has a Limit Location constraint to keep it in place, Locked Track targeted at ArmPin with To: Z and Lock: X
  • Ram - Has a Copy Rotation with Target: Cylinder, X, Y, and Z

Rotation of Arm causes the cylinder to track perfectly. I was able to implement this in my actual project and complete an animation that was holding me up. Huzzah!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.