shaise / FreeCAD_FastenersWB

A workbench to add/attach various fasteners to parts
GNU General Public License v2.0
279 stars 85 forks source link

Question: How to handle screws that are not available in all sizes in a range #377

Open berberic2 opened 5 months ago

berberic2 commented 5 months ago

P.e. „screw“ M20 is available in 80, 125 and 200 mm length but not in 100 and 160 mm. Of course the menu offers 100 and 160 mm as well, but these can not be generated because the length of the threaded part is only defined for known sizes…

For an example see https://github.com/berberic2/FreeCAD_FastenersWB/tree/din787

shaise commented 4 months ago

If there is any vendor that offers these sizes, I have no issue with adding these extra sizes to the "known" sizes. As long as all the standardized fasteners are rendered correctly, I don's see any issue with some non standard extras.

tobiasfalk commented 4 months ago

Could they be labeled with "NoS"(None Standard) so that one can directly see that they are not defined in the Standard.

berberic2 commented 2 months ago

I propose a change that does this, but not sure if this edge-case should be handled. (Code exists, PR not yet)

https://github.com/shaise/FreeCAD_FastenersWB/compare/master...berberic2:FreeCAD_FastenersWB:rangelist

If a screw only exists in discrete lengths (non-continous in range) there now is the possibility to define a [TYPE]rangelist table in the csv-files that associates a diameter with a list of length.

Example:

"DIN787rangelist" "Dia","" "M5","25","40" "M6","25","40","63" "M8","32","50","80" "M10","40","63","100" "M12","50","80","125","200" …

shaise commented 2 months ago

This is an interesting idea, Though I do not know if it worth the tedious job of going one by one over all possible options and update it. Perhaps a small change to your idea - instead of having to implement the list for all diameters, we can do it only for the diameters that matter - so only if rangelist exists AND the selected diameter exists in the range list, only then take it. This way if we have a fastener with 40 diameters and only one of them is non-continues in range, we need to add only this one to the rangelist.