# How to taper a spiral?

**URL:** <https://discourse.mcneel.com/t/how-to-taper-a-spiral/15432>\
**Category:** Rhino for Windows\
**Created:** [January 7, 2015, 9:43am UTC](https://discourse.mcneel.com/t/how-to-taper-a-spiral/15432 "2015-01-07T09:43:59Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![borislavski](https://avatars.discourse-cdn.com/v4/letter/b/bbce88/32.png) [@borislavski](https://discourse.mcneel.com/u/borislavski)\
**Post date:** [January 7, 2015, 9:43am UTC](https://discourse.mcneel.com/t/how-to-taper-a-spiral/15432/1 "2015-01-07T09:43:59Z")

</div>

Hello

I’ve checked all over the intertubes and the forums but couldn’t find any topics about this

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.

![](https://sea3.discourse-cdn.com/mcneel/uploads/default/15147/9ddb330752437c8a.jpg)

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](http://vimeo.com/80975642), 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?

---

<div class="post-metadata">

**Author:** ![jeff\_hammond](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jeff_hammond/32/768846_2.png) [@jeff\_hammond](https://discourse.mcneel.com/u/jeff_hammond)\
**Post date:** [January 7, 2015, 10:35am UTC](https://discourse.mcneel.com/t/how-to-taper-a-spiral/15432/2 "2015-01-07T10:35:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![AlW](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/alw/32/53821_2.png) [@AlW](https://discourse.mcneel.com/u/AlW)\
**Post date:** [January 7, 2015, 4:29pm UTC](https://discourse.mcneel.com/t/how-to-taper-a-spiral/15432/3 "2015-01-07T16:29:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jeff\_hammond](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jeff_hammond/32/768846_2.png) [@jeff\_hammond](https://discourse.mcneel.com/u/jeff_hammond)\
**Post date:** [January 7, 2015, 7:02pm UTC](https://discourse.mcneel.com/t/how-to-taper-a-spiral/15432/4 "2015-01-07T19:02:15Z")

</div>

> [@AlW](#):
>
> 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.

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.

---

<div class="post-metadata">

**Author:** ![MattE](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/matte/32/664526_2.png) [@MattE](https://discourse.mcneel.com/u/MattE)\
**Post date:** [January 7, 2015, 7:19pm UTC](https://discourse.mcneel.com/t/how-to-taper-a-spiral/15432/5 "2015-01-07T19:19:56Z")

</div>

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](http://www.rhino3.de/_develop/__v3_plugins/math/index.shtml)

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

may allow you to get what you’re after.

---

<div class="post-metadata">

**Author:** ![pascal](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/pascal/32/479395_2.png) [@pascal](https://discourse.mcneel.com/u/pascal)\
**Post date:** [January 7, 2015, 7:24pm UTC](https://discourse.mcneel.com/t/how-to-taper-a-spiral/15432/6 "2015-01-07T19:24:39Z")

</div>

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

![](https://sea3.discourse-cdn.com/mcneel/uploads/default/15194/a0f47fb1b1814fb7.png)

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

---

<div class="post-metadata">

**Author:** ![borislavski](https://avatars.discourse-cdn.com/v4/letter/b/bbce88/32.png) [@borislavski](https://discourse.mcneel.com/u/borislavski)\
**Post date:** [January 8, 2015, 12:16am UTC](https://discourse.mcneel.com/t/how-to-taper-a-spiral/15432/7 "2015-01-08T00:16:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pascal](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/pascal/32/479395_2.png) [@pascal](https://discourse.mcneel.com/u/pascal)\
**Post date:** [January 8, 2015, 12:22am UTC](https://discourse.mcneel.com/t/how-to-taper-a-spiral/15432/8 "2015-01-08T00:22:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![MattE](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/matte/32/664526_2.png) [@MattE](https://discourse.mcneel.com/u/MattE)\
**Post date:** [January 8, 2015, 1:06am UTC](https://discourse.mcneel.com/t/how-to-taper-a-spiral/15432/9 "2015-01-08T01:06:01Z")

</div>

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](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](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

---

<div class="post-metadata">

**Author:** ![jeff\_hammond](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jeff_hammond/32/768846_2.png) [@jeff\_hammond](https://discourse.mcneel.com/u/jeff_hammond)\
**Post date:** [January 8, 2015, 1:38am UTC](https://discourse.mcneel.com/t/how-to-taper-a-spiral/15432/10 "2015-01-08T01:38:24Z")

</div>

just messing around with this:

> **[Logarithmic spiral](https://en.wikipedia.org/wiki/Logarithmic_spiral)**
>
> A logarithmic spiral, equiangular spiral or growth spiral is a self-similar spiral curve which often appears in nature. The logarithmic spiral was first described by Descartes and later extensively investigated by Jacob Bernoulli, who called it Spira mirabilis, "the marvelous spiral".
> In polar coordinates 
>   
>     
>       
> (
> r
> ,
> θ
> )
>       
>     
> {\\displaystyle (r,\\theta )}
>   
> the logarithmic curve can be written as
> or
> with 
>   
>     
>       
> e
> ...

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

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

for i in range(0,50):
    radius = (i*e)**b*(i*30)
    point= rs.Polar((0,0,0), i*30, radius)
    pts.append(rs.AddPoint(point))

rs.AddInterpCurve(pts)

```

![](https://sea3.discourse-cdn.com/mcneel/uploads/default/15207/476704fb4c08013e.png)

* * *

with b=2:

![](https://sea3.discourse-cdn.com/mcneel/uploads/default/15208/f36c6253d2dc9c45.png)

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

---

<div class="post-metadata">

**Author:** ![borislavski](https://avatars.discourse-cdn.com/v4/letter/b/bbce88/32.png) [@borislavski](https://discourse.mcneel.com/u/borislavski)\
**Post date:** [January 8, 2015, 3:05am UTC](https://discourse.mcneel.com/t/how-to-taper-a-spiral/15432/11 "2015-01-08T03:05:29Z")

</div>

> 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](https://www.maa.org/sites/default/files/images/upload_library/23/picado/seashells/espiraleng.html) 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?

---

<div class="post-metadata">

**Author:** ![jeff\_hammond](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jeff_hammond/32/768846_2.png) [@jeff\_hammond](https://discourse.mcneel.com/u/jeff_hammond)\
**Post date:** [January 8, 2015, 3:38am UTC](https://discourse.mcneel.com/t/how-to-taper-a-spiral/15432/12 "2015-01-08T03:38:18Z")

</div>

> [@borislavski](#):
>
> 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…:

```python

import rhinoscriptsyntax as rs
import math

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

ptlist.append(rs.AddPoint (x,y,z))
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
    point=rs.AddPoint(x,y,z)
    rs.RotateObject(point,cPt,-angleD * i)
    ptlist.append(point)

rs.AddInterpCurve(ptlist)

```

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 😉

---

<div class="post-metadata">

**Author:** ![jeff\_hammond](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jeff_hammond/32/768846_2.png) [@jeff\_hammond](https://discourse.mcneel.com/u/jeff_hammond)\
**Post date:** [January 8, 2015, 7:53am UTC](https://discourse.mcneel.com/t/how-to-taper-a-spiral/15432/13 "2015-01-08T07:53:36Z")

</div>

> [@borislavski](#):
>
> 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?

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
    point=rs.AddPoint(x,y,z)
    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.

---

<div class="post-metadata">

**Author:** ![Jess](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jess/32/769577_2.png) [@Jess](https://discourse.mcneel.com/u/Jess)\
**Post date:** [January 8, 2015, 2:09pm UTC](https://discourse.mcneel.com/t/how-to-taper-a-spiral/15432/14 "2015-01-08T14:09:31Z")

</div>

> [@MattE](#):
>
> …updated to work in newer versions of Rhino.

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

I’m not sure what exactly Boris wants to model. Attached is a seashell.  
[seashell.3dm](https://discourse.mcneel.com/uploads/default/15225/cfc978a7b00e4c77.3dm) (195.8 KB)

---

<div class="post-metadata">

**Author:** ![Darrell\_Plank](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@Darrell\_Plank](https://discourse.mcneel.com/u/Darrell_Plank)\
**Post date:** [January 8, 2015, 6:44pm UTC](https://discourse.mcneel.com/t/how-to-taper-a-spiral/15432/15 "2015-01-08T18:44:58Z")

</div>

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

Pow(bs,n)_{Sin(n_dt),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:  
 ![](https://sea3.discourse-cdn.com/mcneel/uploads/default/15235/4367e52cf0821e60.PNG)  
and here’s the result:  
 ![](https://sea3.discourse-cdn.com/mcneel/uploads/default/15236/9ba957e7fd14543a.PNG)  
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](https://sea3.discourse-cdn.com/mcneel/uploads/default/15237/91241b9f614eae08.gh) (2.4 KB)

---

<div class="post-metadata">

**Author:** ![jeff\_hammond](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jeff_hammond/32/768846_2.png) [@jeff\_hammond](https://discourse.mcneel.com/u/jeff_hammond)\
**Post date:** [January 8, 2015, 6:59pm UTC](https://discourse.mcneel.com/t/how-to-taper-a-spiral/15432/16 "2015-01-08T18:59:04Z")

</div>

> [@Darrell\_Plank](#):
>
> 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.

(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.

---

<div class="post-metadata">

**Author:** ![MattE](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/matte/32/664526_2.png) [@MattE](https://discourse.mcneel.com/u/MattE)\
**Post date:** [January 9, 2015, 9:39pm UTC](https://discourse.mcneel.com/t/how-to-taper-a-spiral/15432/17 "2015-01-09T21:39:46Z")

</div>

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

![](https://sea3.discourse-cdn.com/mcneel/uploads/default/15276/27cb5ab3e50cb18d.jpg)

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!

---

<div class="post-metadata">

**Author:** ![Nosorozec](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/nosorozec/32/669443_2.png) [@Nosorozec](https://discourse.mcneel.com/u/Nosorozec)\
**Post date:** [January 10, 2015, 10:13am UTC](https://discourse.mcneel.com/t/how-to-taper-a-spiral/15432/18 "2015-01-10T10:13:43Z")

</div>

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](http://help.solidworks.com/2014/English/SolidWorks/sldworks/c_equation_driven_curves.htm)
