# How to taper a spiral?

Hello

I’m trying to model a spiral volute that tapers in on itself towards the center like the image on the right (forgive my doodle, just imagine nicer curves). I got as far as the image on the left.

I can’t remember where, but I saw a workaround for this shape using arcs, however the results seemed to be more of an oval spiral than a circular one.
I also found this volute tutorial, but it’s very tedious for doing several spirals.

Is there an option that I’m simply overlooking or am I going to have to grind through this one?

have you tried the _Spiral command? (because if so, i’m not really sure what you’re wanting then)

there’s an option for Flat (if that’s what you want)… then pick the number of turns, the inner radius and outer radius and the thing spirals like your drawing

1 Like

The one on the left looks like after it passes the top (going CCW), each successive turn is equidistant at all points from adjacent turns. I’m thinking that what Boris would like is for the spiral to get increasingly closer to the adjacent turns as it gets closer to the center. Is that right, Boris?

Just trying to clarify, can’t offer any advice.

1 Like

yeah, maybe… hard to tell from looking at the pictures.
if that’s the case, you could (possibly) draw a _Spiral then _Pipe it with a varying pipe… small radius on the outer end then larger radius on the inner end… then _ExtractIsocurve.

edit- another thought… draw a _Spiral (top view)… draw a triangle next to it (or- a straight line on the red axis then another line which angles from one end of that one)… then use _Flow with stretch with the line on X being the base curve and the angled line being the curve to flow.
?
i don’t know… either of those seem like they’ll do the trick. can’t try until later though.

1 Like

Jess Maertterer once wrote a Math plugin for Rhino that would graph mathematical equations. I’m not sure if it ever got updated to work in newer versions of Rhino.
http://www.rhino3.de/_develop/__v3_plugins/math/index.shtml

That, in combination with something like this:
http://www.mathematische-basteleien.de/spiral.htm

may allow you to get what you’re after.

1 Like

There is a so called ‘golden’ spiral which can be nicely approximated with tangent arcs

If that is good enough, let me know, I have a script someplace that I made a hundred years ago for this, I’ll see if I can dig it up.

-Pascal

1 Like

Hey guys, thanks for all the help.

I’m thinking that what Boris would like is for the spiral to get increasingly closer to the adjacent turns as it gets closer to the center.

Yes, that is exactly what I’m looking for, forgive me for not posting a proper example. I’m essentially trying to get the outline of this shape

Jess Maertterer once wrote a Math plugin for Rhino that would graph mathematical equations. I’m not sure if it ever got updated to work in newer versions of Rhino.

Matt I’m sure that would work, but honestly, all those numbers are equations would fly right over my head, I mean I got a headache just looking at the page. If it comes down to it, I can give it a try but man, I’d really rather not.

draw a _Spiral then _Pipe it with a varying pipe… small radius on the outer end then larger radius on the inner end… then _ExtractIsocurve.

Jeff I tried the varying pipe method, the inside iso curve extraction almost worked, but it’s still a little off. The Flow method didn’t work for me at all, I think I messed up on of the commands (I’m still learning).

I have a script someplace that I made a hundred years ago for this, I’ll see if I can dig it up.

Pascal the golden spiral isn’t exactly what I’m looking for in this particular design but if you could find it, I would definitely use it in the future. If not don’t sweat it.

I just remembered that Adobe Illustrator has a spiral tool that creates degree 3 spirals, and it imports into Rhino like a charm. This is the spiral that I’m looking for and it’ll work for the time being, but I’m really trying to find a way of creating this spiral without having to leave the program.

AI spiral default settings

Hi Boris- the nautilus is pretty close to a golden spiral I think. In any case, I’ll see if I can find the script. It might be a little moldy.

-Pascal

1 Like

Hi Boris

The nautilus is an ‘equiangular’ (also known as a logarithmic) spiral I think. Any radius line you draw from the centre of the spiral always hits the spiral at the same angle - for a nautilus shell it’s around 80 degrees. I know you said the math is over your head, but Jess has already been there - I found this from a few years back:

http://www.rhino3.de/educate/forum/viewtopic.php?f=15&t=104

and once the equation is set up (I’m sure there’s someone here who can help with that) you need never see it again - just use the plugin to generate your spirals. As long as the plugin works with recent versions of Rhino, of course.

Edit: I’ve just tried the V4 plugin in V5 and it works. You have to navigate to the folder to install the toolbar (drag and drop doesn’t work) but the plugin itself installs fine by drag and drop. Then I just typed in the equations for an involute spiral from here:
http://www.rhino3.de/_develop/__v3_plugins/math/library.shtml
Hit OK, and a spiral appeared. You’d need a different pair of equations in the Function (x) & Function (y) boxes to get a logarithmic spiral

1 Like

just messing around with this:

not sure if i plugged all the numbers in the right spot but it seems to work

import rhinoscriptsyntax as rs
import math
e = math.e
b =.5
pts = []

for i in range(0,50):



with b=2:

(i don’t think this is exactly right though… i think it should deviate(?) more rapidly) ?

1 Like

Hi Boris- the nautilus is pretty close to a golden spiral I think. In any case, I’ll see if I can find the script. It might be a little moldy.

Hey thanks Pascal, and I don’t mind the moldiness, if it works it works haha

Then I just typed in the equations for an involute spiral from here:

I tried the plugin and followed the involute of a circle numbers and got it working. I then tried to plug in this equation for a logarithmic spiral and it failed, miserably, didn’t even exit from the menu haha. If you know the correct way of plugging the logarithmic equation in would you mind sharing?

not sure if i plugged all the numbers in the right spot but it seems to work

Matt that is the spiral I’m looking for, and if knew coding (that is a script right) I’d give it a shot, but I’m very much a beginner. I am interested in learning though, if it isn’t too much trouble would you mind simplifying what you posted for a complete script noob?

jeff but…
i have to look at it again in a bit… if increasing b to get a more pronounced taper, it’s drawing a spiral 50billion feet across in an inches template… i think it’s because i used degrees (that’s what the 30 is… a point being placed every 30º) instead of radians in the formula… i’ll post again if i can get it under control and of reasonable size.

ha, yeah… i kinda gave up on trying to understand some of those formulas i found a wikipedia… i’d need a little remedial class to really understand what was happening and how to control it better… so i put it in a way i could understand…

i think the logarithmic spiral is doing this:
equally divide a circle with radial lines then just draw perpendicular lines from one curve to where it intersects with the next… then do another perp line from the intersection… etcetc.

so going off that, i can just use trig to figure out the hypotenuse of one triangle then use that as the adjacent for the next triangle and just keep rotating them…:


import rhinoscriptsyntax as rs
import math

ptlist = []
cPt= rs.coerce3dpoint([0,0,0])
angleD = 15
x=0
y=1
z=0

x= math.tan(angle)*y  #just to get things started?

for i in range(1,102):
y= x/math.sin(angle)
x= math.tan(angle)*y
rs.RotateObject(point,cPt,-angleD * i)
ptlist.append(point)



original drawing with a curve struck through the points:

this one is from the state the attached script is in:

if that’s the spiral you like, this script can easily have some user interface stuff attached and made friendlier to use… my main problem is that i’m really new to python and i don’t necessarily know how to share them with windows users (i’m on mac) plus i lack some confidence in ‘publishing’ a script…

so maybe someone else could help out with that

2 Likes

here’s what i did (and hey, realize i’m a beginner too… there are some real writers around here though that will really help you if you want to get into it)

import rhinoscriptsyntax as rs
import math


these two lines are saying 'hey python, i’m going to be using a couple of modules in this script… one is rhino specific commands (the stuff that starts with rs.) and the other is math

ptlist = []


here i’ve created an empty list… it’s like a bucket that will catch all the points created in the script.

cPt= rs.coerce3dpoint([0,0,0])


this is making a point object… cPt stands for centerpoint and it’s the point which will be used later for rotating.

angle = math.radians(15)
angleD = 15


these are the angles used in the script… they’re the same thing… angleD is 15º and the other one is converted to radians… most of the rhino stuff needs to be told angles in degrees while the python stuff works in radians.

x=0
y=1
z=0


this is how you assign variables … pretty easy.

ptlist.append(rs.AddPoint (x,y,z))


this might be bad practice? doing two things at once… the thing in parenthesis is a rhino command saying 'add a point at this location (x,y,z) which were the variables set earlier… that point is dropped into the list created earlier… so ptlist now has one object inside it.

x= math.tan(angle)*y


this is the first calculation… x will no longer be 0 after this (as it was earlier in the script)… soh cah toa (tangent = opposite/adjacent)

for i in range(1,102):
y= x/math.sin(angle)
x= math.tan(angle)*y
rs.RotateObject(point,cPt,-angleD * i)
ptlist.append(point)


this is a loop… the first time it goes through… i will be equal to 1… the next time, i will be equal to 2 …etcetc until the end of the range has been met… the range here is from 1 to 102

the new x and y coordinates are calculated then a point is created with the new numbers… that point is then rotated by the amount of our angle times whichever cycle of the loop we’re on… if we’re on cycle 10 then it’s going to rotate 150º…
that point is then dropped into the list and the loop repeats…

rs.AddInterpCurve(ptlist)


so once the loop is finished, the script drops back down to this level of indentation… this line tells it to take all the points which were collected (and they’re generally collected in the order they’re created in) and have an interpolated curve drawn through them.

the end.

Hi Matt, I’ve uploaded the Math plug-in for V5: http://rhino3.de/_develop/__v3_plugins/math/

I’m not sure what exactly Boris wants to model. Attached is a seashell.
seashell.3dm (195.8 KB)

1 Like

You can do this easily with an Expression. The key is the expression…well, expression, which is:

Pow(bs,n){Sin(ndt),Cos(n*dt),0}

Just noticed that the asterisks for multiplication don’t seem to show up in the response - perhaps due to some HTML weirdness or something. Look at the script below for the properly formatted expression.

Here’s a pic of the very simple grasshopper script:

and here’s the result:

So I’m just feeding successive series values into the expression which then computes the n’th point on the spiral. “dt” is the angle to advance with each successive point and bs is the base used for exponentiation. It should be just above 1 or the exponential growth will put your points way too far from the origin to see. Pipe the result into an interpolate curve and voila! Instant logarithmic spiral. I’ll include the GH script for reference even though it’s incredibly simple.

Oh - one last thing - the logarithmic spiral never actually reaches the origin (except as a limit at -infinity) so the 0’th point is at a distance 1 from the origin. You have to allow for negative starting indices to get closer to the origin which is why my start value above is -90.

Log Spiral.gh (2.4 KB)

1 Like

(some of) your asterisks are showing up but if you run into that type of problem again, select the text then click the preformatted text button at the top of the reply panel… (asterisks are used for italics and double asterisks are use for bold)

then you can type things like <return> in your post.

1 Like

I’ve played around with Jess’ plugin a little more (the V5 version he’s just made available) as I’d not done so before. It seems to work well with these settings for a logarithmic spiral

The beauty of it is that the curve is parametric, so highlighting the curve and then right-clicking the toolbar button brings up the original equation for the curve. You can then edit the equations to see what effect they have, then save the curve and its equation (including a neat little screen grab of the curve) to the Math library (toolbar button provided for that too) so that you can recall the curve for editing at any time in the future. Very neat!

The Math plugin is great, it is similar to built-in command in Solidworks (equation driven curves). Thanks.
The plugin can be used for numerical integration, surfaces, volumes also
http://help.solidworks.com/2014/English/SolidWorks/sldworks/c_equation_driven_curves.htm