I'd like to model a tube with both ends rounded. After that i want to add a colorful gradient to it.

I know a little about building a tube via bezier curves and a cylinder but the tube has open ends.

How would you try to model it?

Attached you find a picture what I would like to build.

enter image description here

  • 6
    $\begingroup$ Related - blender.stackexchange.com/questions/8750/… $\endgroup$ – Mr Zak Apr 26 '16 at 12:44
  • $\begingroup$ Could you please explain me in what way my answer is a duplicate? The OP wanted to have a tube with a gradient applied to it. Gandalf3's answer doesn't show how to do it. Also I've shown a different method of creating it (it doesn't demand creating two separate objects for the start and end caps- it's one solid mesh as in the reference image). I vote to reopen it. $\endgroup$ – Paul Gonet Apr 26 '16 at 21:58
  • $\begingroup$ I think this answer is more helpful than the ones I've read before. Especially the thing with editing the ends is very helpful. Also how to apply the gradient has been answered as I didn't know how to do that. $\endgroup$ – faybn Apr 27 '16 at 5:57

You may achieve it using Curve Modifier for modeling and a Gradient node for material. enter image description here

Add a Curve, subdivide it and make a patern. Then add a Cylinder and subdivide it with Ctrl+R (the more subdivisions the smoother mesh will look). Remember that Curve and a Cylinder have to have the origin points placed in the same position. Apply the Rotation ans Scale to both objects (Ctrl+A). Select the Cylinder, give it a Curve Modifier and set up its settings as pictured below. To make the Cylinder fit the Curve select the Curve, go to the Curve Data header, and check the Stretch and Bounds Clamp checkboxes. enter image description here

Dissolve some of the Cylinder edges (X-->Dissolve Edges). Select the top face and press Ctrl+B to bevel it. Play with its settings for different results. Select the face on the other side of the Cylinder and press Shift+R to repeat the process. enter image description here

Add Subsurf Modifier, then scale some of the Cylinder mesh parts using the proportional editing (Alt+O). enter image description here enter image description here

Set up nodes as pictured below. To recreate the reference image you may need to add some additional color lamps. enter image description here

  • $\begingroup$ Thx Paul, awesome step-by-step! Will try to work my way through it! $\endgroup$ – faybn Apr 26 '16 at 14:57

You are correct; you should model the curvy part using bezier curves. I learned how to do this from this vid/tutorial. It's kind of confusing, but basically, you add loop cuts to a cylinder and then utilize a Curve Deform Object modifier. Googling "Blender Curve Modifier" could also help. After stretching over a bezier curve, you could try a Subdivision Surface Object modifier to round the ends. For the color gradient, look into the ColorRamp node (Colors of the fade), and the Separate XYZ node (direction of the fade). Your node setup might look like this:

enter image description here

  • $\begingroup$ Thx for the answer! Now I have massive problems with adding the start and the end of the tube…cannot get it right. $\endgroup$ – faybn Apr 26 '16 at 14:08
  • $\begingroup$ Ah, ok. What you should do to fix that is delete the loop cuts closest to the end. They are what's obstructing the subsurf. Select just the edge loops of the loop cuts and key x and click on dissolve edges. Also, if this answer helps, you should consider accepting it. $\endgroup$ – Shady Puck Apr 26 '16 at 14:17
  • $\begingroup$ Thx, I’ll try that. I just found another tipp which works with bevel. Here it is. blender.stackexchange.com/questions/38861/… $\endgroup$ – faybn Apr 26 '16 at 14:27
  • $\begingroup$ @Shady Puck +1 from me as you came up with a proper node setup before me. Material settings credits goes to you. $\endgroup$ – Paul Gonet Apr 26 '16 at 15:05

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