Fasteners workbench based on screw-maker

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
User avatar
ppemawm
Veteran
Posts: 1240
Joined: Fri May 17, 2013 3:54 pm
Location: New York NY USA

Re: Fasteners workbench based on screw-maker

Post by ppemawm »

felixcollins wrote: Tue Jul 26, 2022 9:55 pm Is it possible to explode/unlock the item to allow it to be edited?
Import the .step file and drag/drop it into an Assembly4 Body which creates a BaseFeature that you can modify with PartDesign to your heart's content.
"It is a poor workman who blames his tools..." ;)
RussG
Posts: 124
Joined: Wed Apr 27, 2022 11:27 pm

Confused by Fasteners WB Proprties

Post by RussG »

Code: Select all

OS: macOS 10.16
Word size of FreeCAD: 64-bit
Version: 0.20.29177 (Git)
Build type: Release
Branch: (HEAD detached at 0.20)
Hash: 68e337670e227889217652ddac593c93b5e8dc94
Python 3.9.13, Qt 5.12.9, Coin 4.0.0, Vtk 9.1.0, OCC 7.5.3
Locale: C/Default (C)
Installed mods: 
  * fasteners 0.3.50
I making a standard c-clamp for 3D printing. I created a threaded rod using the Fasteners WB. I chose a UNC threaded rod. In the Parameters section of the Property window there is a <value> property setting for the diameter of the rod. I selected 1/2". But there is also a <diameter Custom> property which is a selectable <value> in mm only, and both diameters can be set independently. (see screenshot). So, how can there be two diameters, <diameter> and <diameter Custom> both of which can selected at the same time and in different sizes and systems as well? I didn't find an explanation in the Fasterners WB wiki. Did I miss something? What do I need to know here?

Also, in making a threaded hole in the C portion of the c-clamp through which the threaded rod will run, the Hole feature in Part Design allows for Class selection for the threads of 1A, 1B and 1C. I found info about these classes at a very nice page from Fastenal at <https://www.fastenal.com/content/feds/p ... Design.pdf> for anyone interested in that. I understand the thread classes as having to do with the tolerances of the threads. So here my problem is that while I can pick a class of thread for the hole in Part Design the Fasteners WB doesn't offer that for threaded rods but rather just says "standard coarse threads" when hovering over the threaded rod icon. So, it seems there is no way to match the thread class for the male threads of the threaded rod and the female threads of the hole. Here too, what do I need to know?

Thanks so much everyone!
diamerer Custom.jpg
diamerer Custom.jpg (127.48 KiB) Viewed 2035 times
Last edited by Kunda1 on Wed Aug 10, 2022 8:53 am, edited 1 time in total.
Reason: Merged this post in to the main FastenerWB thread
User avatar
shaise
Posts: 470
Joined: Thu Jun 11, 2015 8:11 am

Re: Fasteners workbench based on screw-maker

Post by shaise »

Hi All
The Fastener Workbench has undergone a major refactoring:
- Screw creation was split to separate files per fastener type.
- Lots of code duplication cleaned.
- Adding new fasteners is easier now.
- All fasteners now support real thread (including PEMs and PCB fasteners
The Contributing.md was updated accordingly
Naturally this overhaul might introduce new bugs and it is hard to test all possible scenarios. If you encounter bugs (specially backward compatibility) please let me know asap here in the forum, or  raise an issue on the GitHub repository https://github.com/shaise/FreeCAD_FastenersWB.
fasteners-new.jpg
fasteners-new.jpg (41.32 KiB) Viewed 1898 times
Thanks
Bance
Veteran
Posts: 4186
Joined: Wed Feb 11, 2015 3:00 pm
Location: London

Re: Fasteners workbench based on screw-maker

Post by Bance »

Well done @shaise !

Thanks for this great WB. :D
User avatar
obelisk79
Veteran
Posts: 1061
Joined: Thu Sep 24, 2020 9:01 pm

Re: Fasteners workbench based on screw-maker

Post by obelisk79 »

I love this workbench, thanks so much for the continued effort to improve it!
User avatar
KurtF
Posts: 161
Joined: Fri Mar 04, 2022 7:36 pm
Location: North Carolina, US
Contact:

Re: Confused by Fasteners WB Proprties

Post by KurtF »

RussG wrote: Wed Aug 10, 2022 12:12 am So here my problem is that while I can pick a class of thread for the hole in Part Design the Fasteners WB doesn't offer that for threaded rods but rather just says "standard coarse threads" when hovering over the threaded rod icon. So, it seems there is no way to match the thread class for the male threads of the threaded rod and the female threads of the hole. Here too, what do I need to know?
Hi Russ. I posted an add-on to this WB months ago, which I think meets your needs. Tolerance classes (ISO) are specified the same way for male and female threads. Ditto for diameters.
KurtF wrote: Sun Jun 12, 2022 12:48 am I just posted in Macros: ThreadMaker final release. https://forum.freecadweb.org/viewtopic.php?f=22&t=69355 I think you'll like it for generating ISO 261 Metric threads, or Custom free-hand dimensions.
May whatever Higher Power you believe in bless the Ukrainians. They are a decent people who never hurt anybody.
User avatar
shaise
Posts: 470
Joined: Thu Jun 11, 2015 8:11 am

Re: Confused by Fasteners WB Proprties

Post by shaise »

RussG wrote: Wed Aug 10, 2022 12:12 am So, how can there be two diameters, <diameter> and <diameter Custom> both of which can selected at the same time and in different sizes and systems as well? I didn't find an explanation in the Fasterners WB wiki. Did I miss something? What do I need to know here?
As soon as you select and change <diameter Custom>, <diameter> will change from a value to "Custom"
Same when you select a different <diameter>, it will automatically update <diameter Custom> to be the same (but in mm)
In short:
if <diameter> shows any value, this value will be taken. If you set <diameter> to "Custom", <diameter Custom> will be taken instead.
rynn
Posts: 454
Joined: Tue Jul 31, 2018 7:00 am

Re: Fasteners workbench based on screw-maker

Post by rynn »

Hi,
shaise wrote: Mon Aug 22, 2022 8:01 am Naturally this overhaul might introduce new bugs and it is hard to test all possible scenarios. If you encounter bugs (specially backward compatibility) please let me know asap here in the forum, or  raise an issue on the GitHub repository https://github.com/shaise/FreeCAD_FastenersWB.
I like the refactoring, thanks a lot.

(issue: https://github.com/shaise/FreeCAD_Faste ... issues/163)
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Fasteners workbench based on screw-maker

Post by Kunda1 »

@shaise thank you so much for your refactoring work on Fasteners! Paves the way for more contributions now that you've simplified the fasteners adding configuration. +1
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
KurtF
Posts: 161
Joined: Fri Mar 04, 2022 7:36 pm
Location: North Carolina, US
Contact:

Re: Fasteners workbench based on screw-maker

Post by KurtF »

Kunda1 wrote: Mon Aug 22, 2022 5:51 pm @shaise thank you so much for your refactoring work on Fasteners! Paves the way for more contributions now that you've simplified the fasteners adding configuration. +1
Hello, Shai. First, want to echo that from Kunda! I finally got a chance to look at it, but unfortunately it threw an error on my first nut. My FC version is a little old, and I wouldn't be surprised if the error disappeared by upgrading my FC. But you did say you wanted info on back compatibility, so here's the details. And thanks again for all the work you put into this!

Edit Update: Ok cancel this error report. I restarted FC 2 more times and now I cannot reproduce any of it. But I'll leave the details just in case you want to see it.

Code: Select all

OS: Windows 10 (10.0)
Word size of FreeCAD: 64-bit
Version: 0.20.28671 (Git)
Build type: Release
Python 3.8.13, Qt 5.12.9, Coin 4.0.0, OCC 7.5.3
Locale: English/United States (en_US)
Installed mods: 
  * fasteners 0.4.3
Report View showing 2 clicks on nut buttons:

Code: Select all

11:57:58  Save AutoRecovery file: Needed time: 19ms
11:58:15  Get diams for type:ISO4035
11:58:15  Running the Python command 'FSISO4035' failed:
Traceback (most recent call last):
  File "C:\Users\kurtf\AppData\Roaming\FreeCAD\Mod\fasteners\.\FastenersCmd.py", line 538, in Activated
    FSScrewObject(a, self.Type, selObj)
  File "C:\Users\kurtf\AppData\Roaming\FreeCAD\Mod\fasteners\.\FastenersCmd.py", line 170, in __init__
    self.VerifyMissingAttrs(obj, type)
  File "C:\Users\kurtf\AppData\Roaming\FreeCAD\Mod\fasteners\.\FastenersCmd.py", line 236, in VerifyMissingAttrs
    diameters = screwMaker.GetAllDiams(type)
  File "C:\Users\kurtf\AppData\Roaming\FreeCAD\Mod\fasteners\.\ScrewMaker.py", line 305, in GetAllDiams
    return sorted(FsData[type + "def"], key=FastenerBase.DiaStr2Num)  # ***
  File "C:\Users\kurtf\AppData\Roaming\FreeCAD\Mod\fasteners\.\FastenerBase.py", line 222, in DiaStr2Num
    return FsData["DiaList"][DiaStr][0]

name 'FsData' is not definedSave AutoRecovery file: Needed time: 18ms
12:03:58  Save AutoRecovery file: Needed time: 0ms
12:05:06  Get diams for type:ASMEB18.2.2.1A
12:05:06  Running the Python command 'FSASMEB18.2.2.1A' failed:
Traceback (most recent call last):
  File "C:\Users\kurtf\AppData\Roaming\FreeCAD\Mod\fasteners\.\FastenersCmd.py", line 538, in Activated
    FSScrewObject(a, self.Type, selObj)
  File "C:\Users\kurtf\AppData\Roaming\FreeCAD\Mod\fasteners\.\FastenersCmd.py", line 170, in __init__
    self.VerifyMissingAttrs(obj, type)
  File "C:\Users\kurtf\AppData\Roaming\FreeCAD\Mod\fasteners\.\FastenersCmd.py", line 236, in VerifyMissingAttrs
    diameters = screwMaker.GetAllDiams(type)
  File "C:\Users\kurtf\AppData\Roaming\FreeCAD\Mod\fasteners\.\ScrewMaker.py", line 305, in GetAllDiams
    return sorted(FsData[type + "def"], key=FastenerBase.DiaStr2Num)  # ***
  File "C:\Users\kurtf\AppData\Roaming\FreeCAD\Mod\fasteners\.\FastenerBase.py", line 222, in DiaStr2Num
    return FsData["DiaList"][DiaStr][0]

name 'FsData' is not definedSave AutoRecovery file: Needed time: 19ms
12:09:58  Save AutoRecovery file: Needed time: 0ms
Error occurs on both old document with fasteners from prior FW version; and on brand new empty document. Let me know if I can get you any more detail.

On a separate matter, what do you think about merging my macro code for creating mated male/female thread shafts/inserts? I feel it is the one thing missing from FW, the ability to create mating threads of almost any length or size (or pitch, tolerance), for projects like the C clamp above. I'm interested to know your thoughts.
May whatever Higher Power you believe in bless the Ukrainians. They are a decent people who never hurt anybody.
Post Reply