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

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
rynn
Posts: 214
Joined: Tue Jul 31, 2018 7:00 am

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

Post by rynn » Wed Oct 21, 2020 7:23 pm

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: 45
Joined: Sun May 29, 2016 2:19 pm
Contact:

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

Post by JulianStirling » Wed Oct 21, 2020 11:36 pm

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: 45
Joined: Sun May 29, 2016 2:19 pm
Contact:

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

Post by JulianStirling » Wed Oct 21, 2020 11:45 pm

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: 66
Joined: Sun Feb 23, 2020 9:56 am
Location: Hessen -Germany

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

Post by REl » Thu Oct 22, 2020 6:15 pm

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
Posts: 28938
Joined: Tue Mar 17, 2015 9:14 am

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

Post by chrisb » Thu Oct 22, 2020 8:13 pm

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: 45
Joined: Sun May 29, 2016 2:19 pm
Contact:

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

Post by JulianStirling » Thu Oct 22, 2020 10:23 pm

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 437 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: 214
Joined: Tue Jul 31, 2018 7:00 am

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

Post by rynn » Sat Oct 24, 2020 8:48 am

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: 66
Joined: Sun Feb 23, 2020 9:56 am
Location: Hessen -Germany

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

Post by REl » Fri Oct 30, 2020 8:19 pm

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
Posts: 28938
Joined: Tue Mar 17, 2015 9:14 am

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

Post by chrisb » Fri Oct 30, 2020 10:16 pm

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: 214
Joined: Tue Jul 31, 2018 7:00 am

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

Post by rynn » Mon Nov 02, 2020 8:28 pm

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