Page 1 of 3

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

Posted: Wed Oct 21, 2020 7:23 pm
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

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

Posted: Wed Oct 21, 2020 11:36 pm
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.

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

Posted: Wed Oct 21, 2020 11:45 pm
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)

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

Posted: Thu Oct 22, 2020 6:15 pm
by REl
Something like that would be nice.

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

It is easy to handle.

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

Posted: Thu Oct 22, 2020 8:13 pm
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.

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

Posted: Thu Oct 22, 2020 10:23 pm
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 635 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.

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

Posted: Sat Oct 24, 2020 8:48 am
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.

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

Posted: Fri Oct 30, 2020 8:19 pm
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.

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

Posted: Fri Oct 30, 2020 10:16 pm
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.

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

Posted: Mon Nov 02, 2020 8:28 pm
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.