PartDesign Hole: read cut-types from json-files.

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
rynn
Posts: 454
Joined: Tue Jul 31, 2018 7:00 am

PartDesign Hole: read cut-types from json-files.

Post by rynn »

Hello,

this patch changes Hole, so it reads cut-types for metric screws from json-files.
FIles are searched in ResourceDir/Mod/PartDesign/Resources/Hole and UserAppDataDir/Mod/PartDesign/Resources/Hole so users can add their own definitions.

I checked some examples into
https://github.com/berberic2/FreeCAD/tr ... urces/Hole
for DIN 7984, ISO 10642, ISO 14583 (fully and partial sunk), ISO 4762 and ISO 4762 with ISO 7089 washers.

Fileformat:

Code: Select all

{
    "name": "ISO 4762",
    "cut_type": "counterbore",
    "thread_type": "metric",
    "data": [
        { "thread": "M1.6", "diameter":  3.5, "depth":  1.7 },
        { "thread": "M2",   "diameter":  4.3, "depth":  2.1 },
…
    ]
}
bzw.

Code: Select all

{
    "name": "ISO 10642",
    "cut_type": "countersink",
    "thread_type": "metric",
    "angle": 90,
    "data": [
        { "thread": "M3",   "diameter":  6.7 },
        { "thread": "M4",   "diameter":  9.0 },
…
    ]
}
repo: https://github.com/berberic2/FreeCAD.git
branch: feature/hole-counter-dynamic
JulianStirling
Posts: 61
Joined: Sun May 29, 2016 2:19 pm
Contact:

Re: PartDesign Hole: read cut-types from json-files.

Post by JulianStirling »

Yes!!! Fantastic. I planned to do this ages ago because many of the definitions do not agree with the standards. It turned of I didn't have the time (or perhaps skill) to get it done. Once this gets merged we can do a big push to tidy up the hole definitions.
JulianStirling
Posts: 61
Joined: Sun May 29, 2016 2:19 pm
Contact:

Re: PartDesign Hole: read cut-types from json-files.

Post by JulianStirling »

Just took a quick took on my phone, seems it is only for the counterbore/countersink. How hard would it be to also be able to define the close/normal/loose fit for the threads, and even allow new thread definitions? This would be super useful for parts with very large or small metric threads, non-standard threads (like Whitworth or even American threads)
REl
Posts: 91
Joined: Sun Feb 23, 2020 9:56 am
Location: Hessen -Germany

Re: PartDesign Hole: read cut-types from json-files.

Post by REl »

Something like that would be nice.

https://knowledge.autodesk.com/support/ ... E-htm.html

It is easy to handle.
If you don't know anything, you don't have to do anything.
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: PartDesign Hole: read cut-types from json-files.

Post by chrisb »

REl wrote: Thu Oct 22, 2020 6:15 pm Something like that would be nice.
A decent GUI could be the next step. For now it is perfectly ok to have the json file, which is easy enough to understand and easy enough to change. It won't be change too often anyway.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
JulianStirling
Posts: 61
Joined: Sun May 29, 2016 2:19 pm
Contact:

Re: PartDesign Hole: read cut-types from json-files.

Post by JulianStirling »

REl wrote: Thu Oct 22, 2020 6:15 pm Something like that would be nice.
There are a lot of options here that would be overkill for now. But the principle of adding complex thread data via a simple file (personally I would prefer json over CSV, and would prefer carving a stone tablet of the thread data with my teeth over .xls).

A nice GUI would be nice. I think the cross section images in the Solidworks hole wizard are very helpful:
solid.png
solid.png (29.06 KiB) Viewed 3355 times
For me the #1 feature would be to find a way to transfer the information from the hole tool into tech draw so that you get the correct hole call out. A shame I am not competent enough to make it happen.
rynn
Posts: 454
Joined: Tue Jul 31, 2018 7:00 am

Re: PartDesign Hole: read cut-types from json-files.

Post by rynn »

To clarify the plan, I think the cut-types in Hole-Feature should offer:

· None
· Counterbore: fully customizabel by user, so he can create whatever counterbore he needs.
· Countersink: fully customizabel by user, so he can create whatever countersink he needs.

These three generic cut-types should work with all thread-types and with no thread.

Then there should be settings for specific screwtypes, that create countersinks and -bores for standard screws. I would not hardcode these but read them from json-files (see above).

I don’t think the “Cheesehead”, “Countersink socket screw” and “Cap Screw” types that are hardcoded into the hole feature and set the diameter and depth to some multiples of the hole-diameter are usefull at all. Personally, I would like to remove them, but are afraid this would cause backwards-compatibility problems.
REl
Posts: 91
Joined: Sun Feb 23, 2020 9:56 am
Location: Hessen -Germany

Re: PartDesign Hole: read cut-types from json-files.

Post by REl »

Hi,
I m sorry for the short text.

I mean that the organistion / structuring of the bohr informations for threads and screws. So you have an ecxel file (or Libre office file) where the Informations are struckturt so you can easy modife and extend the file.

Of course we nead a GUI like the other big CAD Systems.
If you don't know anything, you don't have to do anything.
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: PartDesign Hole: read cut-types from json-files.

Post by chrisb »

REl wrote: Fri Oct 30, 2020 8:19 pm Of course we nead a GUI like the other big CAD Systems.
Of course we don't need it. I mean needing has the semantics of being much more urgent than "nice to have". It means rather "I can't do without". And this is indeed nice to have and not more. Everyone should be able to open a text editor, copy a template and enter values. It is not super comfortable but as this has not to be done every day, it is far from being needed.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
rynn
Posts: 454
Joined: Tue Jul 31, 2018 7:00 am

Re: PartDesign Hole: read cut-types from json-files.

Post by rynn »

It’s now in the nightly builds:

Code: Select all

https://github.com/FreeCAD/FreeCAD/releases/tag/0.19_pre
test it please.
Post Reply