PDA

View Full Version : Animating a spiral coil spring?



objuan
01-10-2016, 02:05 AM
I'm making some kind of overly mechanical steampunkish gear works clock innards nernies.

I want the whole thing to be powered by a spiral coil spring, similar to this: http://www.vulcanspring.com/sites/default/files/images/SpiralTorsionSpring-2%281%29.jpg

The outer end would be fixed, and the center end would go through a pin, with a gear above the coil. The center pin would get wound up, rotating at least 720 and the center of the spiral would twist around with it. Then the spring would slowly return to normal, spinning the pin and gear the other direction.

How do I rig and animate twisting a spiral spring?

BeeVee
01-11-2016, 05:05 AM
With Bullet constraints?

B

Danner
01-11-2016, 06:13 AM
I don't have time to test it but.. I would try with bones using a weight map.
Make a weight map that goes from the exterior to the interior (UVspider + Uv to weight) then make a circle of bones parented to a centered null. Use the weight on the bones. rotate and scale null.

MonroePoteet
01-11-2016, 08:13 AM
A potential solution would be morphs, but it's a little tricky. Since Morph Mixer moves points linearly between morphs, it can't be simply one "Tight" morph and one "Loose" morph, since the geometry will cross over itself as it moves between them.

Here's a sample object and scene where the spring was coiled 90 additional degrees per morph using Twist (with Radial falloff) and using Pole Evenly Tool to shrink the inner part of the coil 74% per morph. There are four morphs: Tight090, Tight180, Tight270 and Tight360. I didn't do up to 720, but it'd be the same process to produce four more morphs.

Morph Mixer is then used to move between the morphs, using a 0.0 Tension TCB spline with "outlier" keys (some at negative keyframes) to smooth the transition between the morphs. It's still not a totally smooth unwinding, but might be workable.

I used a grid texture on the spring to see how it moves, but a Cold Steel preset (F8) might be nice.

P.S. I forgot to mention: the original Spiral Spring was modeled by having a 200 segment "curve" down the Z axis, using Twist (Linear falloff) to produce a spiral, and then Rail Extrude with 2000 fixed lengths to produce the spiral spring. Then, rotate to be facing down the Z axis.


mTp

objuan
01-11-2016, 11:33 AM
Thanks for all the ideas and efforts guys! Much appreciated as always.

Unfortunately, this being a personal project, it just got but on the back burner for awhile... - but I look forward to trying these out when I get free.

I'm hoping for the radial weight map approach to work. Could I do it with just 1 or 2 bones, not in a chain? 1 bone that runs perpendicular to the spiral right in the center with a radial falloff weight map, and then twist it. Do I need a 2nd bone out at the edge or not?

jeric_synergy
01-11-2016, 12:02 PM
objuan, Bryphii77 showed me a way of 'unwinding' a pie chart using DPKit ROTATION node and a gradient w.map. Although my w.map was a linear gradient (on a Lathe'd mesh), I imagine your more complicated case would work with a double-ended gradient.

Various w.map tools exist to make such a thing.

You might have to synchronize the rotation with a simultaneous scaling to get it to look right.

The other thing you could look at is see if the Layout TWIST deformer can use w.maps.

MonroePoteet
01-11-2016, 04:33 PM
One downside of the Bones approach is the spring doesn't just have to rotate, it should compress down radially while tightening up. This can be done by shrinking the center bone, but that also causes the width of the spring material to reduce accordingly, which isn't how a real spring works. In other words, each subsequent coil of the spring should get closer to the inner ones while being tightened, but the spring itself doesn't get thinner.

In the sample scene attached, I couldn't get the spring to wind more than about 75 degrees before the geometry started overlapping, even with the shrinking. A wider original spacing of the spring coils (as in the original photo) might solve that problem.

BTW, I tried the Layout Twist displacement first. It twists the outside of the geometry rather than the inside, so basically opposite of that required here. No, it doesn't obey weight maps, either.

mTp

jeric_synergy
01-11-2016, 06:38 PM
Thanks for doing that research, Monroe. (I picked a fine day to break my cpu cooler.) I can guarantee the DPKit Rotate node respects w.maps.

Be nice to have nodal equivalents to all the deformers: they are pretty long in the tooth, I'm not surprised TWIST doesn't respect w.maps.

Nodal SCALE should certainly work here.

lertola2
01-11-2016, 10:44 PM
No need for weight maps or bones for this. The bend deformer can animate a spring like that easily.

http://forums.newtek.com/attachment.php?attachmentid=131859&d=1452577553
131859
131858

MonroePoteet
01-12-2016, 07:04 AM
Wow! Nice!

mTp