Dynamic Components - Door Animation with Moving Gas Struts

Hi,

Wondering if someone can help me please? I have a trailer door that I have animated, and I want the gas struts to move as they would when the door opens. Is this possible to do in one action?
Please see below image for your reference. (I have a gif but it wont upload for some reason)

It should be possible, but not simple.

You’ll need to model the cylinder and plunger of the struts separately. Cylinder as a subcomponent of the frame and plunger as a subcomponent of the door.

Component heirarchy:
Top Level: Frame

Frame has 2 subcomponents: Cylinder and Door.

Door has 1 subcomponents: Plunger

This is just 1 side. You can probably have the gas strut pieces as components with “COPIES=1” with COPY=1 having a horizontal offset AND a 180 degree rotation about the axis of the strut.

Tricky things:

Component Axis Placement

Keeping cylinders and plungers coaxial throughout the movement.

While I’m not going to do this fully to confirm all of this, a few things come to mind:

Do the struts FIRST as a single component, with subcomponents for the cylinder and the strut. This will allow you to easily create them as coaxial. THEN, once you are confident.

Model the frame and the door - with the door as a subcomponent of the frame.

Position the strut correctly.

Using the Outliner, move the cylinder (which is now a subcomponent of the strut) to become a subcomponent of the Frame, and move the plunger (still a subcomponent of the strut) to become a subcomponent of the Door. Strut component should now be empty - delete it!

THINK ABOUT YOUR COMPENENT AXES AGAIN! One axis needs to be the along the center of the cylinder/plunger (for the the rotation needs for COPY=0 vs COPY=1), Another axis needs to be placed to rotate correctly as the door moves.

Create a custom DC attribute in the outermost component for the open angle of the door. THIS is what will be animated.

Rotation of the cylinder will be computed - with a lot of trigonometry - as a function of the open angle “parent!door_angle”, as will the rotation of the door in relation to the frame. Rotation of the plunger will be computer - with a lot of trigonometry - as a function (again with a lot of trigonometry) of the door open angle of the door - but in relation to the door, not the frame!

The result will let you design an “onclick” action of one of the “animate” functions when any part is clicked. If you want it to work only when the door is clicked, then the strut cylinder will have to become a sub-component of the door, not the entire trailer - and force you to add computations for the the position of axis origin of the cylinder.

See what I mean by not simple?

And I make to claim to have, in the brief time I’ve written this, covered all the details that might rear their ugly heads!

On re-reading the above before posting, one possible simplification occurs to me. If struts exists where each end is a loop rotating about a pin, then the rotation of the strut pieces when calculation COPY=0 vs COPY = 1 goes away - if you use that style of gas strut!

Wow! Haha I think I will have to read that several times to fully understand it. Thanks @sjdorst, really appreciate your help.

Are you saying that they need to be ‘components’, as opposed to being just ‘groups’, because at the moment I have everything as groups?

Yes. Only components work with Dynamic Components.

And your asking this question suggests that you don’t have an understanding of Dynamic Components. To correct that, I suggest you watch the entire series beginning with this video:

As well as this single video:

100% Correct. First time I’ve used Dynamic Components. I managed to animate the door and the slide out drawers just as groups but when it came to the struts, I struggled. Thanks for those videos, I’ll have a look at them.

The math for the movement:

gas strut movement.skp (26.7 KB)

that is polar coordinates on the arc at position on the door.

1 Like

to continue,the gas strut: create a basic expanding inner rod, all on same axis, then place and rotate this DC to the line representing the strut, then either move in outliner or cut and open and paste in place
Bracket and attachment maybe mostly on door or support, even some of the strut … hopefully you will sort it out, other wise post the door, bracket and strut groups here
gas strut movement.skp (80.4 KB)

Thanks for that @pcmoor.

Yes no problem, will do.