Hoping some clever people here might help....

Hoping some clever people here might help…
Im trying to do the math for a conical helix/thread, NPT threads, but i want to limit the thread by Z depth and not by whole/half pitch, anyone have any idea how to find the endpoint(see pic)
x/y/z values…i have the math for whole/half pitch points at 0 and 180 degrees, but when the endpoint Z depth is spesified and its not at 0 or 180 degrees i get stuck.
I want to plot these into a drawing program with coordinates and script it so it can do all kinds of conical helixes, when given a set of variables.

e4776fd86e1419a087de69e6061265b9.jpeg

This doesn’t sound much like a problem.
Basic trigonometry actually.
What “drawing program” is it and what does your script look like?

http://catohagen.fastmail.fm/npt-helix.txt

i’ve put my math script here, currently adapted for Gibbscam cnc software.

Also i’ve explained myself abit wrongly(i see now)as I kinda find the endpoints, but i cant complete the last arc because the arc needs a startpoint for X/Y and when the helix doesnt end on 0 or 180.
The centerpoint for the arc is always abit offset from center, since the start-diameter at 0 degrees and end-diameter at 180 degrees isnt the same, end-diameter is lower since we move inwards conical, so startpoint for arc is above X center.

I have no idea if any of this makes sense…i tried commenting on the script and cleaning up…been on/off this script every few months for a long time, would be great to nail that last bit…

This one is pretty simple. Z(theta)=theta/A, where is the pitch (number of revs/inch) & theta is in radians. Will be the same for NPT or straight thread.

difference for 0 and 180 degrees points(y is always center/0 here) i can find the arc start x point with the difference of X at Z=0 and the negative X at 180 degrees, Z is half pitch here, so with psudo math it would be :

diameter of thread = 30mm
con angle 1.79 and pitch 2.209
X value at Z=0 would be 15mm
X value at 180 degrees would be -15mm at a straight thread, but conical thread it might be -14.93, so i find the arc startpoint as 15-14.93/2, i have no idea if this is the correct way, but the arc function works and draws the arc.

script does this for now…with a line completing the contour instead of the last arc