Simulate a spiral cable.

Hi! Here’s a video of what I want to achieve: https://www.youtube.com/watch?v=YxPWkxKRL0I&feature=youtu.be

The only thing I really want is the “stretching”/“bouncing” on the z axis.

I have tried to figure out how to best do this but haven’t come up with anything suitable for my needs.

I will animate an object which this cable is connected to. I don’t want to animate the stretching every time I move the object up or down. I want it to be simulated or rigged so that it does something like that automatically.

I would really like to hear how YOU would achieve something like in the video!

I hope I explained it so you will understand, let me know otherwise!

You need to make the curve to represent the spiral first, I take it you want it tighter at the bottom than the top.

  1. Start off by adding a Plane in the top view, go to Edit mode and delete all bar one of the vertices. Move this vertex to X axis.
  2. In the front view, add an Empty at the centre of your spiral, just above the remaining vertex in your mesh.
  3. In the Front view, add a Screw Modifier, set The Empty Object as your Screw Target, Z as the Axis
  4. Set the number of coils (Iterations)
  5. Move the Empty to get the spacing you require. and Apply the Modifier. Set the origin to be the centre of the lowest coil.
  6. This bit is fiddly - select the first coil of the mesh and scale it in Z only. Repeat for subsequent coils until you have the proportional raised effect.
  7. Convert this mesh to a Curve (ALT-C “Curve from Mesh/Text”)
  8. Create a Bezier circle of the required profile diameter of your cable.
  9. On the Curve, go to the Curve panel and set the Bevel Object as your Bezier Circle.

Scale the new mesh in Z for your springy effect! Then let me know how you get on, or if you need any more help.

Cheers, Clock.

Yes this may work. But I still have to figure out how to dynamically make it “bounce” without animating manually.

Maybe let some physics control the z-scaling or something… I will test some things. Thanks!

Edit:

Have been playing with soft bodies a while. This is how I want the spring cable to behave when moving up and down, but I also want it to be streched out on the upper half and more “compressed” at the bottom!

is it possible to do this with only soft bodies or do I have to mix this with something else to stretch it?

You may need to put some hooks on the curve, then move these with drivers to get the effect you require… Or you could convert the curve back into a mesh (ALT-C again) then use a set of bones, strategically placed, to animate the mesh in Z, then control these with drivers. Unfortunately this is not an easy animation in my experience, but I will gladly bow to greater knowledge, if someone else know better!

With drivers, you can use exponential, sine, cosine, etc. functions to simulate bouncing movements, don’t forget you need to check “Auto run python scripts” in user preferences, File tab to get scripted expression to work. Let me know how much you know about drivers before I assume too much. For a sine function you could use a scripted expression like: sin(Frame - 1) * var - where var is some meaningful Z value variable or constant of your choice, this will simulate sinusoidal or “bounce” movement. To make this bounce slower, just divide the (frame-1) bit by another constant.

Cheers, Clock.

Here is a quick example of what I am rambling about:

cable.blend (472 KB)

I have just animated the centreline, rather than make the whole cable thing - it’s perhaps easier to understand this way - don’t forget to enable Auto run Python Scripts" in User Prefs - File tab. And keep my ui so you can see the drivers. Just press Play to see it working.

Cheers, Clock.

Wow, thank you!

I have very little knowledge about drivers (I know how to rotate an object based on another objects position etc).

But I’m a fast learner and this is something that I will look into tomorrow! :slight_smile:

It does look like a solution I could work with. The problem is I want it to react by the whole cables position. So when I move the handle which the cable is connected to I want it to react by that.

If I rig a cable like that, is it possible to make it so that each bone can only stretch a certain amount? So that the highest “curl” will stretch out before the one under etc?

May be hard to understand what I meant there, but just look at the video in the first post and you should get what I mean!

Edit:

Here’s something I tested that looks more like what I want:

https://www.youtube.com/watch?v=dO8UN7qmMt4&feature=youtu.be

The cubes are rigid bodies with generic spring constrants

The bones stretches to their respective cube

And the spring is like pretty much how you set it up with the armature!

Now I have to find a way to make the physics slow down after time. Not sure how I will do that yet!

Edit2: Found it. Now the bouncin slows down pretty fast!

Here it acts pretty good : https://www.youtube.com/watch?v=ytUNy8GgzIo&feature=youtu.be

Just have to reverse it’s stretching down insted of up!

Looks like you are getting there! It’s probably a case of playing with the frame rate in the drivers, so as time goes on, the bouncing action gets to occur over a longer time period and at a smaller amplitude - I think that is what you seemed to have achieved. For stretching down, I think you might need to invert the rig perhaps, so the top is fixed and the bottom is animated? Sorry I cannot spend any time on this just now - keep me informed please.

Cheers, Clock.

I did invert the rig and now it looks really nice! :slight_smile:

Now I have to figure out how to limit the distance between the cubes so they don’t get too close when I stretch it “in”.
So the cables doesn’t get clipped through each other!

I tried enabeling collision for the cubes. I think that would a good solution. However, the forces that pushes the cubes down seems to make them fly like crazy when they are too close.

I will upload a test file so you can see for your self, and maybe fix the problem :wink:

I now have what I want! The only remaining problem is how to make a cable that deforms proporly.

It seems like this would be the easiest thing to do but I can’t quite figure it out! :slight_smile:

Since the spiral is a mesh and vertex groups are connected to the rig, i don’t know how to exchange that to a curve object that does the same thing…

Hope someone knows how to do it!

Edit:

Well I solved that too! Just a bit in the end I need to tweak, it’s a bit jittery!

I will explain what I did so anyone else can replicate it if they want.

Could upload the .blend too if anyone want it!

Thanks for all the help clockmender!

Nice work, glad you got it solved, may I suggest you post a thread in Tutorials & Tips, explaining your overall method. You can also post a blend file there, to help others wanting the same animation. Give your thread a meaningful title that is obvious for others to search on, some title are not too helpful at times!

Cheers, Clock.

Heh, i still have some things to solve, and things to make a bit simpler but I will definately post it when I have something finished!