01 January 2013  #1 
A newbie
portfolio
Zohar
Wellington,
New Zealand
Join Date: Mar 2009
Posts: 1,825

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? 
01 January 2013  #2 
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) 
01 January 2013  #3 
A newbie
portfolio
Zohar
Wellington,
New Zealand
Join Date: Mar 2009
Posts: 1,825

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?

01 January 2013  #4 
A newbie
portfolio
Zohar
Wellington,
New Zealand
Join Date: Mar 2009
Posts: 1,825

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(p1p2)=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. 
01 January 2013  #6 
A newbie
portfolio
Zohar
Wellington,
New Zealand
Join Date: Mar 2009
Posts: 1,825

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: https://www.youtube.com/watch?v=spECnuJApzY 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 January 2013  #7 
Lurking
portfolio
A. D.
Vertex Slinger
Munich,
Germany
Join Date: Dec 2006
Posts: 1,436

When I say radius, I mean the half the diameter that the helix revolves around: radius(helix). I do not mean the radius of the cylinder that it unwinds into (the geometrical shape: radius(cylinder)). For this purpose, I propose you simply solve the problem not using a cylinder as base shape, but a curve (i.e. 2D parametrical, as opposed to 3D geometrical).
So your example would read 2*pi*radius(helix)*coils = 1 km Think about an actual spring, like the ones used as bindings in some notebooks. If you pull at both ends with enough force, you will end up with something approximating a straight cylinder with a certain height (or length). If you reverse the process, you create a helix which you can then compress to a certain minimum height by a) decreasing the height each coil covers and b) increasing the number of coils. You can leave a) at a constant if you like. The key fact here is that you 'shorten' they helix by adding coils. A coil can have a minimum height of 2*radius(cylinder) or else the beginning and the end would intersect given a constant radius(helix). Since each coil takes up 2*pi*radius(helix) (lets call this L(helix))of the cylinders original length, you can wind it into max. Length(cylinder)/L(helix) coils. Now just reverse the math __________________
aweControlPicker (GUI Picker for Maya) 
01 January 2013  #8 
KnowitAll
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?

01 January 2013  #9 
A newbie
portfolio
Zohar
Wellington,
New Zealand
Join Date: Mar 2009
Posts: 1,825

@tobbew, I'm familiar with the create sphere in the bonus tools, and moreover, as I noted, there's even a builtin polyHelix. With both I would face the same question of calculating the helix length. But let's ask your animation question officially:
http://forums.cgsociety.org/showthr...004#post7496004 @Nyro, about your first post, you can't use my definitions, e.g. radius (that correspond to the helix and cylinder attributes in maya), without blinking, and expect me to understand what you meant. About your second post, my friend, you are inventing a new math... Unless I fully misunderstood you. This thickness of the helix is irrelevant, so let's consider a helix curve. If I do the "reverse" process of stretching it to a line, then I can simply project it to a plane, and get a bunch of circles, and then I get the answer in your first post; so this is the "minimum". On the other hand, as in my 1km example there can be a helix with one coil that covers a 1km. Also there's no maximum coils, there can be infinite coils (take epsilon helix width). So please read post #4 again, and try first to solve that problem, and you'll see the answer to the first. If you want I can add drawings. 
01 January 2013  #10 
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 singlecoil 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. __________________
aweControlPicker (GUI Picker for Maya) 
01 January 2013  #11 
A newbie
portfolio
Zohar
Wellington,
New Zealand
Join Date: Mar 2009
Posts: 1,825

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 singlecoil 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: http://www.physicsforums.com/showthread.php?t=326321 
01 January 2013  #12 
Lurking
portfolio
A. D.
Vertex Slinger
Munich,
Germany
Join Date: Dec 2006
Posts: 1,436

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).
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:
Originally Posted by Me:
Assume the difference in length of a line that goes straight from P0 to P1
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 singlecurve 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 cleartext, 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 fieldtest 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 threedimensional helicoid with any form of 'thickness'. __________________
aweControlPicker (GUI Picker for Maya) 
01 January 2013  #13 
A newbie
portfolio
Zohar
Wellington,
New Zealand
Join Date: Mar 2009
Posts: 1,825

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? 
01 January 2013  #14 
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) 
01 January 2013  #15 
A newbie
portfolio
Zohar
Wellington,
New Zealand
Join Date: Mar 2009
Posts: 1,825

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... 
Thread Closed share thread 
«
Previous Thread

Next Thread
»


