PR #3999 [PartDesign] Dynamic hole cut-types

Post here if you have re-based and finalised code to integrate into master, which was discussed, agreed to and tested in other forums. You can also submit your PR directly on github.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
rynn
Posts: 454
Joined: Tue Jul 31, 2018 7:00 am

PR #3999 [PartDesign] Dynamic hole cut-types

Post by rynn »

- Make countersink and counterbore on metric holes freely definable by user.
- Fixed the Naming of M1.6, M2, M2.5 and M3.5
- Added constructor for custom enums from Enums to PropertyEnumeration
- Put definitions of cut-types (counterbore/countersink) for screwtypes into json-files for easy modification.
- Allow users to put its own definitions in json-files in [UserDir]/Mod/PartDesign/Resources/Hole
- Contains several examples of cut-type definition json-files that are propably not production-ready.

This uses a local copy of nlohmann::json¹ to read json-files.
__________
¹ This is a very nice, header-only C++ library under the MIT License (https://github.com/nlohmann/json). I copied the single-file-version and the forward-declaration-header into …/PartDesign/App/ so no new dependencies arise.
Last edited by rynn on Sun Oct 25, 2020 9:43 pm, edited 1 time in total.
chrisb
Veteran
Posts: 53932
Joined: Tue Mar 17, 2015 9:14 am

Re: PR #3999 [PartDesign] Dynamic hole cut-types

Post by chrisb »

rynn wrote: Sun Oct 25, 2020 8:17 pm This uses a local copy of nlohmann::json¹ to read json-files.
In Path workbench e.g. Mod/Path/PathScripts/PathToolLibraryManager.py uses json ,as well. I think it would be sensible to use the same libraries, for various reasons such as less additional libraries, easier to understand the code , ...
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

Post by rynn »

gelöscht
rynn
Posts: 454
Joined: Tue Jul 31, 2018 7:00 am

Re: PR #3999 [PartDesign] Dynamic hole cut-types

Post by rynn »

chrisb wrote: Sun Oct 25, 2020 9:37 pm
rynn wrote: Sun Oct 25, 2020 8:17 pm This uses a local copy of nlohmann::json¹ to read json-files.
In Path workbench e.g. Mod/Path/PathScripts/PathToolLibraryManager.py uses json ,as well. I think it would be sensible to use the same libraries, for various reasons such as less additional libraries, easier to understand the code , ...
As far as I can see it uses the python json lib¹, which is part of the Python Standard Library².
PartDesign is C++.

__________
¹ https://docs.python.org/3/library/json.html
² https://docs.python.org/3.8/library/index.html
chrisb
Veteran
Posts: 53932
Joined: Tue Mar 17, 2015 9:14 am

Re: PR #3999 [PartDesign] Dynamic hole cut-types

Post by chrisb »

:oops: You are right, of course; sorry for the noise.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply