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
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Fasteners workbench based on screw-maker

Post by Roy_043 »

shaise wrote: Wed Mar 23, 2022 9:01 am Do you wish to create a PR for this?
https://github.com/shaise/FreeCAD_FastenersWB/pull/132

ToniTen wrote: Wed Mar 23, 2022 9:38 am that further split the outer edge
The updated code ignores edges that are part of the outer wire of the face.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Fasteners workbench based on screw-maker

Post by Kunda1 »

Anyone interested in helping to implement this Feature Request?
Need help implementing JCIS screws: https://github.com/shaise/FreeCAD_Faste ... issues/114
I want to implement JCIS (Japanese Camera Industry Standard) screws. The standards are found here: here (bottom of the page under CIPA AD-001 to -003). The threads are metric (although it uses 1.4, 1.7, 2.0, 2.3 and 2.6 nominal diameters).
I followed the contributing guidelines as far as I could, meaning writing the tables and entries into the various .py files. The one thing I'm not able to do is actually writing the code. I have zero experience programming a shape for FreeCAD. And because the code in screw_maker.py is not well enough documented so that I could understand what's going on, I'm having issues starting.

I'll attach what I've done so far. I'll include the specsheets and two FC models made according to them.

Regarding my thought process with the non-Phillips-head driver: A "punch" is easy to model by the specsheet, as I've done. I thought of boolean-cutting the recess out of the screws using the "T"-depth from the specsheet. This seems to me to be the easiest way to achieve the recess. The screws themselves seem similar, but not equal to, the ISO7045 to -48 standards.

Again, modeling would not be a prob
lem; understanding and reconstructing the code is. Any help so that I could do it would be appreciated.
FastenersWB-JCIS.zip
There is a guide on how to contribute to Fasteners at https://github.com/shaise/FreeCAD_Faste ... IBUTING.md

Note: the discussion related to FR #114 has a dedicated forum thread at https://forum.freecadweb.org/viewtopic.php?f=8&t=67504
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
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Fasteners workbench based on screw-maker

Post by Kunda1 »

@mfraser opened a feature request for adding Rivets to the Fasteners Workbench (issue: https://github.com/shaise/FreeCAD_Faste ... issues/117)

The dedicated thread is x-posted here https://forum.freecadweb.org/viewtopic.php?f=8&t=67503 to discuss the issue
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
ToniTen
Posts: 240
Joined: Fri Sep 04, 2020 10:11 am

Re: Fasteners workbench based on screw-maker

Post by ToniTen »

I found a small issue:

Prerequisites:
  • This happens when using metric threaded fasteners (not sure about ASME screws).
  • This happens when you select "Match screws by outer thread diameter (pass holes)"
If the diameter of the hole is exactly the same as the outer diameter of the thread of a fastener, Fasteners will automatically select that fastener size (e.g. using a M10 bolt on a ⌀10mm hole), even if in real life, due to tolerances, it's usually recommended to use a smaller bolt in this case. This does only happen when the holes were not done with the Hole tool, since the diameters for pass holes in the hole tool include the required clearance. However, if working with models imported to FreeCAD, where the designer didn't follow DIN/ISO norms, it is possible to end up with such situations

EDIT: Adding FreeCAD information

Code: Select all

OS: Ubuntu 18.04.6 LTS (XFCE/xubuntu)
Word size of FreeCAD: 64-bit
Version: 0.20.
Build type: Release
Branch: unknown
Hash: 6eafd180306cf19028d361115a47cac2fbee55a3
Python 3.6.9, Qt 5.9.5, Coin 4.0.0a, OCC 7.5.2
Locale: Spanish/Spain (es_ES)
Installed mods: 
  * fasteners 0.3.39
  * Assembly3 0.11.1
  * Manipulator 1.4.3
Last edited by ToniTen on Wed Mar 30, 2022 1:01 pm, edited 1 time in total.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Fasteners workbench based on screw-maker

Post by Kunda1 »

@ToniTen please edit your post to include full About info which will also let us know the Fasteners version you're using
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
ToniTen
Posts: 240
Joined: Fri Sep 04, 2020 10:11 am

Re: Fasteners workbench based on screw-maker

Post by ToniTen »

Kunda1 wrote: Wed Mar 30, 2022 12:38 pm @ToniTen please edit your post to include full About info which will also let us know the Fasteners version you're using
Sorry, fixed that already. I thought that since I had already posted that earlier, that would be sufficient, but I was wrong, since both FreeCAD Fasteners have been updated since.

I am also attaching a file that shows the issue. If you want to reproduce it follow these steps:
  • Remove or hide the screw
  • Switch to Fasteners
  • Make sure select "Match screws by outer thread diameter (pass holes)"
  • Select the edge of the hole or the face where the hole is
  • Add a screw that can have M12 thread
Attachments
Fasteners_no_clearance.FCStd
(17.48 KiB) Downloaded 20 times
User avatar
shaise
Posts: 470
Joined: Thu Jun 11, 2015 8:11 am

Re: Fasteners workbench based on screw-maker

Post by shaise »

ToniTen wrote: Wed Mar 30, 2022 9:51 am If the diameter of the hole is exactly the same as the outer diameter of the thread of a fastener, Fasteners will automatically select that fastener size (e.g. using a M10 bolt on a ⌀10mm hole), even if in real life, due to tolerances, it's usually recommended to use a smaller bolt in this case.
ISO Standard states a maximum of D-major (thread max width) to be slightly less than the M value, and the minimum considerably less.
In practicality most vendors tend to use diameters closer to minimum (probably to allow more tolerance) I have tested many M3 - M6 samples I have and found them to be 0.1 - 0.15 m less than the M value. I never had an issue inserting an Mx screw into an x hole.
ISO_Threads.png
ISO_Threads.png (14.85 KiB) Viewed 2922 times
shai
ToniTen
Posts: 240
Joined: Fri Sep 04, 2020 10:11 am

Re: Fasteners workbench based on screw-maker

Post by ToniTen »

shaise wrote: Wed Mar 30, 2022 1:47 pm ISO Standard states a maximum of D-major (thread max width) to be slightly less than the M value, and the minimum considerably less.
In practicality most vendors tend to use diameters closer to minimum (probably to allow more tolerance) I have tested many M3 - M6 samples I have and found them to be 0.1 - 0.15 m less than the M value. I never had an issue inserting an Mx screw into an x hole.

shai
There are multiple reasons why the screw should be smaller than the hole:
  • Tolerances: if the hole is ⌀10±0.1, and your M10 screw is just slightly under 10mm, then it might not fit
  • Many parts are modelled and drawn as they need to be machined, but then get painted/coated with a corrosion resistant layer
  • It's not just that the screw needs to be able to go through the through hole, it's that it sometimes needs to go into a tapped hole in another part, and then you also need to take into account the tolerances in position for both the through hole and the tapped hole: imagine you have 4 holes that need a screw, to join two parts (say a motor and a flange). Holes are in a square pattern, with a side of 200mm±0.1 for both through holes and tapped holes. Holes are 10mm±0.1, and painted, with a coat of paint whose thickness can reach 0.1mm. In the worst case scenario, you might end up with 9.8mm through holes that are 199.9m apart (centre to centre) while tapped holes are 200.1mm apart (centre to centre again). That won't work. The screw will scrape the paint and compromise the corrosion resistance. The holes on the parts won't line up, and there will be no play in the holes to compensate. This is obviously a worst case scenario, and I'm pulling numbers out of thin air, but these things happen. Sure, you could have tighter tolerances, but that makes the machining process a lot more costly (if outsourced) or finicky (if done in house).
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Fasteners workbench based on screw-maker

Post by Zolko »

with latest festebers WB version (0.3.40) there is a bug when editing a screw's length :

Code: Select all

14:18:24  At /home/hubertz/.local/share/FreeCAD/Mod/fasteners/./FSChangeParams.py Line 361
14:18:24  At /home/hubertz/.local/share/FreeCAD/Mod/fasteners/./ScrewMaker.py Line 207
14:18:24  At /home/hubertz/.local/share/FreeCAD/Mod/fasteners/./FastenerBase.py Line 208
14:18:24  'float' object has no attribute 'strip': Attribute not found.
how to reproduce: create a new document, insert a screw, edit the screw's parameters, and change only the length (to 20mm for ex). The code at line 208 is:

Code: Select all

def LenStr2Num(DiaStr):
    # remove brackets indicating less common diameters
    StripStr = DiaStr.strip("()")
I guess that there is a variable class mismatch (float -vs- string)

OS: Debian GNU/Linux 10 (buster) (KDE//usr/share/xsessions/plasma)
Word size of FreeCAD: 64-bit
Version: 0.20.28643 (Git)
Build type: Unknown
Branch: master
Hash: 16889913913c78dece869a5fb42fb8f0e23144ea
Python 3.7.3, Qt 5.11.3, Coin 4.0.0a, OCC 7.3.0
Locale: English/UnitedKingdom (en_GB)
Installed mods:
* A2plus
* CurvedShapes 1.0.1
* fcgear 1.0.0
* sheetmetal 0.2.49
* TabBar
* Render 2022.1.0
* fasteners 0.3.40
* Curves 0.4.1
* WeldingWB_GitHub 0.0.1
* Assembly4_GitHub 0.11.11
try the Assembly4 workbench for FreCAD — tutorials here and here
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 »

Cross-posting from https://forum.freecadweb.org/viewtopic. ... 1&start=20.

Here I've made a proposal to add thread functionality from my ThreadMaker tool into Fasteners Workbench, if that can be done without too much disruption. ThreadMaker does what the Fastener Threaded Rod object does, generating only thread bodies (no nuts, no bolt heads). It's features are described in the linked post.

Shaise, feel free to reply either here or there, wherever you prefer to discuss. Thanks!

P.S.- I discovered where Fasteners code is on my hard drive, then discovered the CONTRIBUTING.md file. I'm reading it now... Awesome! This workbench just became my Python/FreeCAD API training project. :-)
May whatever Higher Power you believe in bless the Ukrainians. They are a decent people who never hurt anybody.
Post Reply