Variable Pitch Helix script

Next
 From:  bemfarmer
6697.1 
Here is a simple script to create a variable pitch helix, at the origin.
It is based upon mathematics here:
https://www.zwsoft.com/support/zw3d-base-skills/1378
(Updated corrected link Nov 2023)
I did a pdf with additional information and algebra.

Note: For non-variable-radius helix, use the regular MoI Helix command.

Note that some protection from division by zero is included, which could possibly occur due to length of zero, or some negative pitches.
A better programmer might have used catch(e)?
Some negative entries produce different shapes, or no shape at all.
Based upon limited testing, the program does not hang up MoI.

I spent a lot of time trying to graft it onto MoI's helix script, which is fairly complicated, by switching it to an interpcurve, but
finally decided that the user could do a cplane if desired.

- Brian

EDITED: 22 Nov 2023 by BEMFARMER

Attachments:

Image Attachments:
Size: 70.1 KB, Downloaded: 217 times, Dimensions: 791x425px
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
6697.2 In reply to 6697.1 
Cool script Brian!

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Martin (MARTIN3D)
6697.3 In reply to 6697.1 
Great and very useful for modelling springs.
Unfortunately I can't do anything with the .7z file.
Could you upload a zip file?

Martin
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
6697.4 In reply to 6697.3 
Oops I forgot to do it in zip format.
Replaced 7z with zip file.

- Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Martin (MARTIN3D)
6697.5 In reply to 6697.4 
Thanks Brian. Excellent work!
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
6697.6 
French version ;) http://moiscript.weebly.com/geacuteomeacutetries-par-bemfarmer.html
(translation of the PDF in few days )

EDITED: 16 May 2014 by PILOU

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  DannyT (DANTAS)
6697.7 In reply to 6697.1 
Thanks Brian, very cool.

-
~Danny~
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Mike (MGG942)
6697.8 In reply to 6697.1 
Excellent!
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
6697.9 
---
Pilou
Is beautiful that please without concept!
My Gallery
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
6697.10 
Pitch1 is the initial "instantaneous" pitch at the beginning of the helix.
This can be checked by making the tangent, and doing Angle script, with a line parallel to the x axis.
This is the Lead angle. Take its tangent on a calculator, and multiply by 2 * PI, as explained in the pdf.

Using Length=100 units, constant radius=10 units, first 360 degree turn pitch = 10 units, end 360 degree turn pitch = 30 units,
yields a variable pitch helix with N = 5 turns, Pitch1 = 7.5 units, Pitch2 = 12.5 units.

(The formula result was 7.5 units. The Lead angle was 6.8068 degrees, to 4 decimal places, 2*PI*Tan(6.8068) = 7.499808.)
Angle script could possibly have more units of precision.

The terminal "instantaneous pitch" came out to a lead angle of 27.3495 degrees, for a pitch of 32.4987 units, per my math.

- Brian

The script could have an option added to display P1 and P2

EDITED: 29 May 2017 by BEMFARMER

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
6697.11 In reply to 6697.10 
Let P3 = PTerminal, be the instantaneous pitch at the end of the helix.
This value can be checked by converting the ending tangent angle, as previously described.
By reversing the values of sP and eP in the calculations, it is possible to easily calculate PTerminal, although it could get confusing.
Let sQ = eP, and eQ = sP So that Q1 = P3 (Q1 takes the roll of P1), and Q2 takes the roll of P2.
From the variable pitch equations:

Q2 = (N/(N-1)) * (eQ - sQ)/2 = (N/(N-1)) * (-1) * (eP - sP)) = -P2

Q1 = (L/N) - Q2 = (L/N) + P2
<<QED>>

To summarize the result, with the original sP and eP values, and the original variable pitch helix:

PTerminal = L/N + P2

I think that I will add a checkbox to the _VarPitchHelix script, to display the 4 additional pitches, P1, P2, Pinitial = P1, and Pterminal.

- Brian

EDITED: 2 Jun 2017 by BEMFARMER

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
6697.12 In reply to 6697.11 
Added pitch3, and an alert message to display the Number of turns, and the 3 other pitches.

// sP = pitch of first (bottom) full turn.
// eP = pitch of last (upper) full turn.

// p1 = initial instantaneous pitch, at bottom of curve.
// p2 = variable portion of pitch.
// p3 = terminal instantaneous pitch at top of curve.

I'm thinking that tangent lead angles would not change for various radii (?).

- Brian

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
6697.13 
Here is a late night companion script, _VarPitchHelixExtremes
This script has as inputs the axis length of the desired helix, the instantaneous initial and terminal pitches, and the beginning and ending radii.
Turns is a calculated value.
The math is slightly adjusted from the _VarPitchHelix script.
The math formulas are commented in the script .js file. I should type up my notes on the math.
(The math actually seems to be a bit too easy:-)

There is a verbose checkbox to display the various pitches, and the number of turns.

This script should be perfect to form a transition helix between two helices of the same handedness, same axis, same xy values of start/end,
and a space between them, and different known radii and/or known pitches.

The script has undergone very limited testing, and seems to work well, in alpha status, so use at your own risk.
Entering negative radii or pitches seems harmless, and yields weird or no results, so maybe the parameters should be absolute valued...
There is a crude alert for the two possible cases of division by zero.

(A third script is possible, where Turns is input, and axis Length is calculated.)

- Brian

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  bemfarmer
6697.14 In reply to 6697.13 
For a helix with constant radius, the pitch is related to the slope of the constant tangent with respect to the axis:

pitch = PI * 2 * radius * slope

So as the radius of that helix decreases, with constant pitch, the slope increases.

The slope of a helicoid increases closer to the axis.

For a helicoid created from sweep of a variable pitch helix, and intercepted with a surface of revolution that has variable radii,
the SLOPE at some point on the surface helix, could possibly decrease, stay the same or increase, w.r.t. the variable pitch helix. (?)

- Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All