Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Add-in announcement: Fine-Tune your Screw Thread Designs in Autodesk Fusion. Feedback & ideas welcome

dbunch211
Contributor

Add-in announcement: Fine-Tune your Screw Thread Designs in Autodesk Fusion. Feedback & ideas welcome

dbunch211
Contributor
Contributor

Since early April 2024 I have been working on creating a screw thread python add-in to model more flexible threads in fusion.  Coming from OpenSCAD a few years ago, I have missed the flexibility of using any diameter thread, pitch & thread angle that I could do in OpenSCAD.  I initially started a topic here with a problem I could not figure out. Copy a Body x times & join them all together - Autodesk Community - Fusion

After resolving that problem with a work around, I decided to start a new topic on anything else that might come up related to this & hopefully get some feedback & future ideas.

 

It currently allows you to draw threads of most any angle, both positive, negative & flat Top and/or Bottom threads.  Some angles you will get an error on.  You can have a different positive angle for the top & bottom, but a different angle for negative for the top & bottom will give you an error.  I have only seen negative angles used once in a YouTube video.

 

These threads are not 100% accurate probably because the helix is an approximation but should be close enough for 3d printing which this program was written for. My measurements show being off by 0.0054% (30.0016) - 0.05% (30.014) instead of (30.0 deg angle).  Any chance there is a helix primitive in the sketch mode?

 

Here is a link to the program.

https://github.com/geodave810/ThreadTune

 

There are some

0 Likes
Reply
990 Views
8 Replies
Replies (8)

dbunch211
Contributor
Contributor

I made all of this a component & grouped them together on the timeline.  This topic Solved: How to create Timeline Groups - Autodesk Community - Fusion helped me to get the start & end index for the grouping.  The new version can be found here: https://github.com/geodave810/ThreadTune/releases/tag/v1.2.1

0 Likes

dbunch211
Contributor
Contributor

I added chamfering to the threads & got rid of the annoying extra tool body left behind when cutting the threads for the Nut.

https://github.com/geodave810/ThreadTune/releases/tag/v1.3.0

0 Likes

dbunch211
Contributor
Contributor

I made the pitch for the threads & the helix separate variables.  This makes it similar to the way the coil works, except you can use a profile of a screw threads rather than circles, squares, or triangles.

https://github.com/geodave810/ThreadTune/releases/tag/v1.3.5

A larger helix pitch than the thread pitch will allow for the option to make the M/F Thread offset the same distance all the way around the thread.  I was not sure of the math to do the offset & considered just trying the offset command in the API, but ChatGPT actually came up with the correct math for me to do this.  I only had to change the offset direction from positive to negative.  It even plotted the points graphically to show how it looked.  The vertical offset line does not look visually correct, but the numbers it printed out were.

ThreadOffsetGraph.JPG

0 Likes

dbunch211
Contributor
Contributor

Think I am done with adding all the features I wanted to this program. A week or so after initially creating the GitHub repository for this program, I found another repository by the same exact name. I was surprised that GitHub allowed that. I have been thinking about renaming this for a while. In order to keep the name similar, I just changed it to P_ThreadTune with P standing for Python.  I will keep the other repository for now with a link to the newer one, but will probably eventually delete it.  I might sometime in the future rewrite this in C++ and use the prefix C_ for that.  It is fast enough for me, so not sure whether writing it in C++ would be beneficial other than teaching me how to use this API in C++
https://github.com/geodave810/P_ThreadTune/releases/tag/v1.4.0
The dialog box changed considerably since the previous version.

ThreadTune_v1_4_Tab1.JPG

0 Likes

dbunch211
Contributor
Contributor

Added new Pattern option & disabled Center Line option since that did not work a lot of times.
The Pattern is faster than previous Helix or LongHelix & more accurate. This method draws one
thread profile & one revolution of the helix. It then models one revolution of the threads & uses
the pattern along a path to create all the threads. The DrawCylinder routine will combine them all together.
Using more spline points, like 36 or 45 does not bog it down now when using the pattern option.

I originally used the rectangular pattern with a quantity of 1 for other side of rectangle, but then realized the
pattern along a path would be simpler.  There will be a seam where each thread matches the other but won't make any difference on an exported STL file.

 

With using the pattern option with 18 spline points I can draw a M8 thread 200mm long & be off by only 0.0065% on a 30-degree angle.  Using the Helix method, I am off by 0.3325% & the threads near the top start to be skewed.  Using 45 spline points with the pattern, I am only off by 0.002%.  I would not be able to use 45 splines with previous methods.  To put it in better perspective that 30-degree angle being off 0.002% measures 30.00061-degs.  That 0.0065% error of the 30-degree angle measures 30.00194-degrees. Also using the pattern method, the threads will be exactly the same for each revolution since they are all copies of the original 1 revolution of the thread.

 

I also fixed a couple of other things and added some more error checks.

https://github.com/geodave810/P_ThreadTune/releases/tag/1.4.5

0 Likes

dbunch211
Contributor
Contributor

The latest version 1.5 now supports Metric or English threads.

https://github.com/geodave810/P_ThreadTune/releases/tag/v1.5

0 Likes

dbunch211
Contributor
Contributor

While my mind was still in tune with this program, I added another tab for Coil options.  The big advantage of using this versus the built-in coil is that it uses a profile for the coil which you can go back through the timeline to adjust to your needs, like rounding the corners of sharp edges.  I added profiles for circles, ellipses, polygons, rectangles and stars.  Stars might not be useful but were fun to add.  I still need to add triangles.  This tab currently only works with mm units.

Here are some possibilities.

CoilAndSpiralTypes.jpg

https://github.com/geodave810/P_ThreadTune/releases/tag/v2.0.0

0 Likes

dbunch211
Contributor
Contributor

Fixed numerous bugs in the coil/spiral section of code
1. For ellipse sections, I was using radii for ellipse instead of diameters.
2. I had the inside & outside section position backwards from the way Fusion uses them, so I made that consistent with fusion.
3. Replaced 33 if,elif statements in command_created routine with 2 simple statements for each group of if & elif.
4. If Coil options was run last time, it will select the Coil Options tab when this is run again.
5. Since I added a variable to Coils, Coil_DialogInput_V10.txt is now the previous input file for coils.

I still have to add the English units to the Coils section but will see if any more bugs in current code need fixing first.

https://github.com/geodave810/P_ThreadTune/releases/tag/v2.1.0

0 Likes