CGTalk Helix to cylinder
 01-09-2013, 06:33 PM #1 zoharl A newbie   portfolio Zohar Wellington, New Zealand   Join Date: Mar 2009 Posts: 1,820 Helix to cylinder Hi, I'd like to create a polyCylinder which would be the uncoiled version of some helix. I know that: 1. They should have the same radius, subdivision axis, subdivision caps. 2. cyl_subd_height = coils*subd_coils I'm missing: 3. What should be the cylinder height? share quote
 01-09-2013, 10:58 PM #2 Nyro Lurking   portfolio A. D. Vertex Slinger Munich, Germany   Join Date: Dec 2006 Posts: 1,436 2 * pi * radius * coils ? Just a suggestion, I might not have thought this through to the end, but I think the fact that a helix 'climbs' in height as it winds around its center does not actually add to the length of the coil itself. __________________ aweControlPicker (GUI Picker for Maya) share quote
 01-10-2013, 02:07 AM #3 zoharl A newbie   portfolio Zohar Wellington, New Zealand   Join Date: Mar 2009 Posts: 1,820 You probably meant width*pi*coils, and yes the question is if the pitch/elevation should be considered, since usually (not in maya) I think it does. For example, think about stretching the helix to an arbitrary height, let's say, 1km. The formula says it's possible, even if the actual length is 1 m. Another example, if I take two cylinders with the same radius, but one is twice as high as the other, and I would extract from both, from top to bottom, a helix curve, would the two curves have the same length? I bet on not; is there a way to try this in maya? share quote
 01-10-2013, 03:17 AM #4 zoharl A newbie   portfolio Zohar Wellington, New Zealand   Join Date: Mar 2009 Posts: 1,820 Okay, I got it. If you don't understand my explanation you can go to my source: http://answers.yahoo.com/question/i...25151733AAYAcaW http://answers.yahoo.com/question/i...04040430AAUSsuL http://www.physicsforums.com/showthread.php?t=326321 For example, take a cylinder with radius = 1m, and height = 1km. Wrap a helix of one coil around it, from a point p0 on the bottom of the cylinder, to a point p1 on the top of the cylinder, where p1 is exactly above p0 along the cylinder axis. Meaning pitch = norm(p1-p2)=1km. Surely the helix length is not 2*pi*radius*coils=2*pi meters, because it's more than 1km. Now, if we put the cylinder on the ground, nailing down one end of the helix, and we roll the cylinder on the ground in exactly one cylinder_circumference = 2*pi*radius, then we have straightened the helix on the ground, and now its length is the hypotenuse of a right triangle with one leg = cylinder_circumference, and the other leg = pitch, and thus it is sqrt(pitch^2+cylinder_circumference^2). So for my original question, using the previous notations, we get: pitch = helix_height/coils cyl_height = coils*sqrt((width*pi)^2+pitch^2) Homework: Calculate the length of the helix. share quote
 01-10-2013, 07:23 AM #5 tobbew Know-it-All Torbjörn Sweden   Join Date: Apr 2005 Posts: 434 if you create the helix with a cylinder and a twist deformer and keep history you can easily unwind it (but I understand you are looking for a mathematical solution) share quote
01-10-2013, 08:33 AM   #6
zoharl
A newbie

portfolio
Zohar
Wellington, New Zealand

Join Date: Mar 2009
Posts: 1,820
Quote:
 Originally Posted by tobbew if you create the helix with a cylinder and a twist deformer and keep history you can easily unwind it (but I understand you are looking for a mathematical solution)

It's interesting as well. Unfortunately I tried it, and I just got a mangled helix. Do you have the exact parameters that can create something like this:

Maybe in the example above I can calculate how much to stretch the helix extrude curve to make an isometric cylinder (assuming that the topology is preserved?), but I'm not sure it would be easier than my previous calculation.

 01-10-2013, 01:09 PM #8 tobbew Know-it-All Torbjörn Sweden   Join Date: Apr 2005 Posts: 434 My apologies (that's what you get for posting first, and thinking afterwards). You are right of course. It would get mashed, but if you use a straight line, a twist deformer and then extrudes a circle along the length you should get it right. Of course, that's probably what you are trying to do, thus the need to know the right length. You know there is a "create spiral curve" in the bonus tools, right? share quote
01-10-2013, 05:06 PM   #10
Nyro
Lurking

portfolio
A. D.
Vertex Slinger
Munich, Germany

Join Date: Dec 2006
Posts: 1,436
Quote:
 as in my 1km example there can be a helix with one coil that covers a 1km.

Yep. that Helix has radius r:

r = 1km / (2*pi) = 0.159 km

Now, assuming you already know the radius of your helix and the number of coils in it, this should work. I seriously doubt I'm inventing new math.

Take my initial formula:

length(cyl) = 2 * pi * r(helix) * coils

It seems rather intuitive, the length of the cylinder is proportional to the number of coils in the helix and also to the size of its radius. That doesn't mean its not wrong though:

Quote:
 Surely the helix length is not 2*pi*radius*coils=2*pi meters

No, you're right. That doesn't seem likely. But I'm not discarding my "new math" in that light. Instead, I propose adding the helix' original height to the equation.

Assume the difference in length of a line that goes straight from P0 to P1 and a line that goes from P0 to P1, but passes through P2 which lies at half the height of P1 and on the opposite side of the cylinder. This is essentially your example of a single-coil helix.

Is it sound to assume that the extra length the curve needs to have to wind around the cylinder is exactly the circumeference 2*pi*r(cylinder)? If so, then things become even easier.

Length(unwound helix) = Length(wound helix) + 2*pi*r(cylinder) * coils?

At 0 coils, both lengths are identical and the radius of the cylinder is irrelevant. At 1 coil, the difference in length is proportional to radius(cylinder). Sounds about right to me.

01-10-2013, 05:55 PM   #11
zoharl
A newbie

portfolio
Zohar
Wellington, New Zealand

Join Date: Mar 2009
Posts: 1,820
What a mess...

Quote:
 Yep. that Helix has radius r: r = 1km / (2*pi) = 0.159 km

Let's use the same definitions please. The helix has zero thickness, i.e. helix_radius = 0. The helix wire is wrapped around a cylinder with radius r=1m. It means that the coiled helix has the same radius as the cylinder, which maya calls width, and it equals to r=1m. An uncoiled helix, i.e. a line, has no radius and has no width. So what the hell did you mean by r=0.159??

Quote:
 It seems rather intuitive, the length of the cylinder is proportional to the number of coils in the helix and also to the size of its radius. That doesn't mean its not wrong though:

Please don't jump between problems; let's discuss first only the second problem where the helix is wrapped around a cylinder with known height (the height of the cylinder equals the height of the coiled helix). Now the question is what is the length of the helix (coiled or uncoiled, its length is the same).

Quote:
 Assume the difference in length of a line that goes straight from P0 to P1 and a line that goes from P0 to P1, but passes through P2 which lies at half the height of P1 and on the opposite side of the cylinder. This is essentially your example of a single-coil helix.

I think I understand what you mean, but please use line (has a linear equation and goes through two points), curve (some path on a surface, or an arbitrary path in 3D), geodesic (shortest path - curve - on surface between two points).

Quote:
 Length(unwound helix) = Length(wound helix) + 2*pi*r(cylinder) * coils?

(Again you confuse definitions of length and height. Please use my definitions above, or create it in maya, and see the attributes).

Of course not; It's like you are saying, how do I calculate the hypotenuse length in a right triangle: Sum the length of the two legs... See again my formula, and read again my geometric explanation. If you want we can integrate the helix edge length to get the same formula:

01-10-2013, 06:58 PM   #12
Nyro
Lurking

portfolio
A. D.
Vertex Slinger
Munich, Germany

Join Date: Dec 2006
Posts: 1,436
Quote:
 Originally Posted by Zoharl So what the hell did you mean by r=0.159??

I mean the radius of the helix (double the distance between two points on a helix separated by 180 degrees).

Quote:
 Originally Posted by Zoharl I think I understand what you mean, but please use line (has a linear equation and goes through two points)

I did say line:
Quote:
 Originally Posted by Me Assume the difference in length of a line that goes straight from P0 to P1

Quote:
 Originally Posted by Zoharl (Again you confuse definitions of length and height. Please use my definitions above, or create it in maya, and see the attributes).

No. They are the same thing. I'm not going by whatever definitions Maya uses at all, I haven't even opened Maya regarding this problem. A geometric cylinder has a radius and a height. Said height, when transformed to a single-curve helix, can be expressed as the length of the curve. Sorry if my interchangable use of the two has confused you.

I glanced at that thread on the physicsforum. My math skills (and thus my ability to decode that equation offered there) are not up to par to express myself in the same way. Hence I offer a layman's (or clear-text, if you will) version of my theory.

By the way: if pitch is the distance in height between each coil, I still think the solution offered in my last post is valid; just substitute Length(wound helix) with (pitch*coils), to get

length(curve) = pitch * coils + (2*pi*r*coils)

With your example of a helix curve wrapped once (1 coil) around a Cylinder, the latter having a radius of 1 meters and a height of 1000 meters:

Length(helix) = 1000m * 1 + (2 * pi * 1m * 1) = 1006,2 meters

As I mentioned, this is a simple theory. I can't offer a curve function, but you're welcome to field-test my formula in maya and see if you get proper results. If not, I accept that I was wrong and missed something, but until then my intuition tells me I might be on the right path.

Disclaimer:
All mentions of Helix above imply a parametric curve and not a three-dimensional helicoid with any form of 'thickness'.

 01-10-2013, 08:09 PM #13 zoharl A newbie   portfolio Zohar Wellington, New Zealand   Join Date: Mar 2009 Posts: 1,820 Wrong. The length is Length(helix) = sqrt(pi^2 + 1000^2) = 1000.004935 Nyro, I'm not sure where you get your intuition from (and you didn't bother to prove it), but it's wrong. I offered two analytical ways to prove 'my' formula: One geometric which should be easy to understand by a layman, and one differential. But still you persist. Is it becoming a theological discussion? Are you pulling my leg? share quote
 01-10-2013, 09:28 PM #14 Nyro Lurking   portfolio A. D. Vertex Slinger Munich, Germany   Join Date: Dec 2006 Posts: 1,436 You gotta calm down mate You asked a question, I provided an approach, that's all. How am I supposed to know you already figured it all out and answered your own question right after you posted? If I had known, I'd have stopped posting long ago. By the way: no idea why you applied the pythagorean theorem here, but I believe when you say it's right. As I said, I'm no mathematician. That said, you have to agree my solution was very close. __________________ aweControlPicker (GUI Picker for Maya) share quote
01-10-2013, 10:12 PM   #15
zoharl
A newbie

portfolio
Zohar
Wellington, New Zealand

Join Date: Mar 2009
Posts: 1,820
Post #4 starts with:

Quote:
 Okay, I got it.

And yet again I refer you to my explanation in post #4, which you don't need to be a math wiz to understand, and I think it's quite cool (and I would be happy to elaborate/animate).

Okay, now I'm cooling down...