Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

Creating logarithmic spirals using a conic and a helix. Need some math help!

I've been trying to create logarithmic spirals in Onshape, and have found a few special features that other users have kindly developed, but none of these met my needs. You can project a regular (Archimedean) spiral on to a sketch easily enough using a conical helix: 

But I wanted a logarithmic spiral (i.e. one where the distance between the turnings increase in geometric progression) and unfortunately you can't project a helix on to anything other than a cone or a cylinder. So instead, I used the loft feature to create a surface from a helix to its axis. I then created a horn shaped object by rotating a sketch with a conic about its axis. I then subtracted (Boolean) the horn from the surface. I could then 'use' (i.e. project) the inside edge of the surface on to a sketch in a perpendicular plane:


https://cad.onshape.com/documents/8f65c1667813235a037348da/w/e6d6a886e68d914a56993e10/e/b02f51d28e59bd8b08e851b9

In this way the spiral shape is determined by only three variables: The radius of the horn's base:


the number of turns (rotations) the helix makes:


and the Rho of the conic used to sketch the horn's cross section.



The height of the horn has no influence.




What I would like to do is understand the relationship between these variables and the spiral's logarithmic ratio (the geometric progression of the distances between the turnings of the spiral), so that I can (a) figure out what variables to use to create a golden spiral (i.e. with a ratio equal to the golden ratio) and then perhaps at some future point once I've learned how, (b) incorporate these variables into a feature script that draws logarithmic spirals using just these three variables.

So, can anyone point me in the right direction?

Best Answer

  • mahirmahir Member, Developers Posts: 1,320 ✭✭✭✭✭
    edited January 2024 Answer ✓
    The equation for a logarithmic spiral is r = ae^(bθ). This can either be implemented via custom FS, or you can use my Parametric Curve FS to generate it. Here's an example.

Answers

  • MichaelPascoeMichaelPascoe Member Posts: 2,803 PRO

    What exactly are you having trouble with? If you can make it in the part studio, it can be either instantiated or recreated via FS.


    RENDERCAD
    rendercad.ai - Photorealistic product rendering.

    ▚▞▚▞▚▞▚▞▚
    ________________________________________________________________________
  • john_concannonjohn_concannon Member Posts: 6
    I can make it in the part studio, and in time I’ll learn how to implement it in feature script, but what I want to do is understand the relationship between the independent variables (number of turns, and Rho) and the dependent variable, the ratio of the spirals’ increase in distance from the origin per turn.  Because ultimately, I want to be able to draw a golden spiral (i.e. one with a ratio equal to the golden ratio).  
  • MichaelPascoeMichaelPascoe Member Posts: 2,803 PRO

    Not sure I can help you with understanding the variables. But I can help with FeatureScript. 

    Here is an example of how to create a spiral from scratch within FS using solid modeling approaches: 
    https://cad.onshape.com/documents/abb998532f54a132a42bea8b/w/b0d311a0342c2b1e722bdaf1/e/79973a...

    And here is an example of how to model it in the part studio, and simply instantiate it using your custom feature:
    https://cad.onshape.com/documents/bf218127a4290c050e205e75/w/42342e313f737ad5d1388f67/e/dd21cb39f...


    RENDERCAD
    rendercad.ai - Photorealistic product rendering.

    ▚▞▚▞▚▞▚▞▚
    ________________________________________________________________________
  • mahirmahir Member, Developers Posts: 1,320 ✭✭✭✭✭
    edited January 2024 Answer ✓
    The equation for a logarithmic spiral is r = ae^(bθ). This can either be implemented via custom FS, or you can use my Parametric Curve FS to generate it. Here's an example.

  • MichaelPascoeMichaelPascoe Member Posts: 2,803 PRO

    Boom! @mahir knows his spirals!


    RENDERCAD
    rendercad.ai - Photorealistic product rendering.

    ▚▞▚▞▚▞▚▞▚
    ________________________________________________________________________
  • john_concannonjohn_concannon Member Posts: 6
    Thank you Mahir. It certainly looks like I can use the Parametric Curve FS to create a golden spiral, a more direct method than I was aiming for, so I'll close this question as answered.

    And thank you Michael, I'll return to your examples when I start learning to write feature scripts.
  • robert_melascagliarobert_melascaglia Member Posts: 45 EDU
    Thank you Mahir.  I used your fine script and pushed the logarithmic curve into the 3rd dimension using "1 * t" as the last variable.  Would you know how to allow just one revolution?  Regards, Robert.
  • john_concannonjohn_concannon Member Posts: 6
    Hi Robert. You can set upper and lower bounds for the angle of

    Here's an example - I'm using Radians so t is bounded between -pi and pi (2 pi radians in a single rotation)



    The document is here: Single rotation parametric curve

    John
  • mahirmahir Member, Developers Posts: 1,320 ✭✭✭✭✭
    Thank you Mahir.  I used your fine script and pushed the logarithmic curve into the 3rd dimension using "1 * t" as the last variable.  Would you know how to allow just one revolution?  Regards, Robert.
    You can use @john_concannon 's method, but I personally prefer to leave #t bounded between 0 to 1 and instead vary the formula for #theta by replacing #t with #t*360*deg. That way the other formulas aren't impacted.
  • kendrick_fellerkendrick_feller Member Posts: 2

    Just a heads up the formula for radius in this example is missing a factor of 2 it should be:

    Radius = #a*exp(#b*2*PI*#c*#t)*mm

    to match the theta formula

    Theta = #c*#t*2*PI*rad

    I thought my spiral was unwinding a bit too slow.

Sign In or Register to comment.