11
$\begingroup$

By using a vectorized bezier curve, I have successfully created a tube/pipe in 2D (with sharp corners) that a ball of the same radius can roll through:

enter image description here

However, when trying to achieve the same in 3D, the tube suddenly narrows on sharp corners (everything is still in the same z plane):

enter image description here

Is there any way to make a 3D tube created this way have a uniform radius? Or is there another method that can make me achieve what I want? I need to make a fairly large tube (up to 1000 segnments). It would be preferred if I didn't have to change every segnment manually, but I will do it if there is no other way.

$\endgroup$
  • 1
    $\begingroup$ I think this comes with changing the curve type, can be tweaked manually by scaling the segments with alt s. Any reason you need 3d over 2d? $\endgroup$ – iKlsR Jan 25 '15 at 5:06
  • $\begingroup$ @iKlsR Is it possible to change the curve type, but still keep the sharp corners? AFAIK only vectorized curves can do that. $\endgroup$ – Banana Jan 25 '15 at 15:13
  • $\begingroup$ Not to my knowledge. $\endgroup$ – iKlsR Jan 29 '15 at 19:17
2
+50
$\begingroup$

I believe you may be better off using a Nurbs curve here rather than a Bezier. They behave a bit better and are more intuitively controlled. If you really need sharp turns, you can achieve those by repeating control points at the same locations in the curve. In the diagram below I've duplicated control points on the bottom Nurbs curve to make it similar to the top Bezier curve. Not sure if this helps.

Bezier vs Nurbs

$\endgroup$
  • 1
    $\begingroup$ Which options did you use to make the bottom tube? I didn't know you could make 90° like that with Nurbs. $\endgroup$ – Banana Jan 30 '15 at 1:25
  • $\begingroup$ No joke Chuck, whatever magical settings you used are what this question needs. :) $\endgroup$ – Scalia Jan 30 '15 at 3:38
  • $\begingroup$ Two possible ways to do this. All you have to do is place multiple control points at the same location. This is the same reason that placing mesh edges near each other make for sharp subsurf edges. Nurbs blend adjacent control points to make the curve. If adjacent control points are at the same physical location, the resulting Nurbs curve will come closer to the control points. Depending on the order of the curve you may have to put order-1 (I think) points to make it sharp. The other way is to select a control point and increase the W value in the Transform panel. $\endgroup$ – Chuck Jan 30 '15 at 5:00
  • $\begingroup$ I'll write another answer summarizing how I made the curve. $\endgroup$ – Chuck Jan 30 '15 at 5:09
  • $\begingroup$ @Chuck you can edit answers and put more info in, no need to make duplicate answers.) $\endgroup$ – Jaroslav Jerryno Novotny Jan 30 '15 at 9:13
3
$\begingroup$

This method will only work well for angles less than 90°:

  • Set your curve to 3D and bevel it with circle curve, just as you would normally.
  • Then add solidify modifier, check Even Thickness and High Quality Normals, set thickness to negative value:

    enter image description here

  • Then select that circle, go to editmode, and scale it down as you can, to a point. Stop when the tube starts displacing - that will be floating point limitations

  • You should end up with an ok tube with sharp turns and even thickness, it wont be perfect but I can't think of another way.

    enter image description here

$\endgroup$
3
$\begingroup$

Create a new Nurbs curve. I then click on Endpoint: U so the curve includes the end points.

Endpoint selected

Move the curve so that the first point is in the right place.

Move into place

Get into edit mode and move the 2nd control point into place.

2nd Point

Move the 3rd point to the same location as the 2nd point. Move it close, select both point and type S 0 to make them coincident.

3rd point

Move the 4th point where you want it.

4th point

Now to double the 4th point, type E to extrude and click Enter right away without moving the extruded point to have the 5th extruded point coincident with the 4th point. Look closely to see the curve has been altered by this.

5th point

Now for the rest of the curve extrude and drag the new control point to a new location and then use the Extrude and Enter trick to double up the points.

6th and 7th points

For the last point you do not need to double the point. By clicking on the Endpoint option at the start you are effectively already placing multiple control points at the ends. So extrude once and place the last point:

last point

Then add the bevel object to get:

Final curve

In a real Nurbs tool you would be able to edit the knot vectors or specify replication factors on the vertices (this is different from the W homogeneous coordinate that you can use to pull the curve towards or away from the control point).

I hope this works for you.

$\endgroup$
  • $\begingroup$ Be aware that this does change the parameterization of the curve and may affect things like texturing or path following animations. This can be fixed with a real NURBS tool. I haven't found those options in Blender. $\endgroup$ – Chuck Jan 30 '15 at 5:39
  • $\begingroup$ instead of adding another answer that is an in depth explanation of your first one, please edit the original. You can do multiple answers for different approaches to the same question. $\endgroup$ – cegaton Jan 30 '15 at 15:13
  • $\begingroup$ Sorry. Is there a simple way to merge the answers? It did it separately because of a race condition I experienced the other day when commenting on an answer that someone was editing. $\endgroup$ – Chuck Jan 30 '15 at 15:30
  • 1
    $\begingroup$ You can use the Aligned option, but scale the handles way down too. $\endgroup$ – VRM Jan 30 '15 at 21:25
  • $\begingroup$ HOORAH FOR CHUCK! +1! $\endgroup$ – Scalia Feb 1 '15 at 3:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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