Roller Chain animation

Hi all,

this is my entry into the clandestine roller chain animation challenge. It’s as precise as I could manage against the backdrop of my finite command of math and an already unreasonable amount of time which I’ve dedicated to this project. Yet you may (will) detect some “glitches” when investigating at ultra-slomo and deeply zoomed in - oh well … :innocent:
The lower chord is modeled as a Catenary, the very name of which is derived from “chain line”. So, I didn’t really have a choice …
Enjoy!

8 Likes

Beautiful! Is the catenoid / alysoid setup to “droop” more or less if the distance between shafts is lessened or greatened?

1 Like

I would have loved to add this feature, but had to bow to my limitations :smirking_face:

I’ve modelled the full chain line (not just the lower chord catenary) as four segments:

  • circular wrap around the small sprocket
  • true catenary between small and large sprocket
  • circular wrap of large sprocket
  • linear transition between large and small sprocket.

For the tangent transition between small sprocket and catenary I had to employ a type of numerical approximation already, to get the transition point sufficiently precise. While I had already adjusted the parameters of the catenary to have a mathematically perfect horizontal transition into the circular wrap around the large sprocket.

Changing the distance between sprockets while keeping the length of the full chain constant would have yielded two unknown transition points at unknown positions/angles, which is - alas - beyond my mathematical skills … :face_with_bags_under_eyes:

1 Like

Would be a great feature, I may try a version with this rope mass sim I made a while ago…

https://codepen.io/forerunrun/pen/yLmLMWZ

Great work, it’s really clean, well calculated and presents great visually!

4 Likes

I love this showcase. :handshake: :fire: This is simply cool!

I played with CatenaryCurve once upon a time :slight_smile: :

4 Likes

Yes, that’s a cool standalone simulation - as long as you know(!) the height of each catenary’s endpoint beforehand. When fitting a catenary simultaneously at two points of unknown heights, you’re dealing with two moving targets at the same time :wink:

Feel free to grab my code from my website - it’s not obfuscated and has a wild mixture of German and English comments already.

1 Like

Thanks, Paul :blush:

Again, your sample is a use case where you know position and heights of both endpoints of the catenary beforehand.

Fitting a catenary to transition tangentionally into two circular paths (of varying distance) simultaneously [EDIT: while keeping the chain’s overall length constant!] has at least one additional level of complexity, imo.

If we pool our resources, we might get it done, though :wink:

I’ll be happy to publish my current code on CodePen, but be warned! This is more complex than it seems …

1 Like

Cool, a lot to do. Your work is wonderful. Especially, the movement control is excellent.
But I have some advice for you.
You can use InstanceMesh for performance optimization because you have many small sprockets.
Thank you

1 Like

Thanks for your feedback :folded_hands:

I am in fact using an InstancedMesh for the 108 rollers :thinking:. The sprockets go back to the work I showcased below, including CodePens. I don’t see, how sprockets could benefit from the usage of InstancedMeshes, too? But I’ll be happy to learn more …

As far as performance is concerned: I’m getting full 120 fps both in Safari and Firefox, albeit on a beefy MacBook Pro M4 Max - so performance was not my prime concern.

2 Likes

In replying to myself, I’d like to alert you to a piece on my blog, where I give an in-depth view into the making of this roller chain animation. Including a possibly surprising explanation for the occasional “flashes”, which my animation is plagued with. Hint: those are a delayed manifestations of previous inaccuracies, in conjunction with a fixed count of InstancedMeshes.

This piece is - alas - in german language only, and can be digested with the help of a translation service like deepl.com or a helpful native speaker …

1 Like