PartDesign Hole: read cut-types from json-files.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: PartDesign Hole: read cut-types from json-files.
I wait for it!
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
-
- Posts: 529
- Joined: Fri Sep 18, 2020 5:40 pm
Re: PartDesign Hole: read cut-types from json-files.
Would this also be the way to store actual thread cross section parameters. I.e what we need in order to produce the real thread geometry (when that feature has been implemented)?
Re: PartDesign Hole: read cut-types from json-files.
Probably. In my opinion JSON is a good compromise between beeing structured and beeing human-readable/human-editable. There are other fileformats like XML, csv/tsv or YAML which are either more structured, more human-readable or easier to edit.davidosterberg wrote: ↑Tue Dec 29, 2020 10:48 pm Would this also be the way to store actual thread cross section parameters. I.e what we need in order to produce the real thread geometry (when that feature has been implemented)?
-
- Posts: 529
- Joined: Fri Sep 18, 2020 5:40 pm
Re: PartDesign Hole: read cut-types from json-files.
Great! Do you know if somebody else is working on the true threads implementation?rynn wrote: ↑Wed Dec 30, 2020 11:54 amProbably. In my opinion JSON is a good compromise between beeing structured and beeing human-readable/human-editable. There are other fileformats like XML, csv/tsv or YAML which are either more structured, more human-readable or easier to edit.davidosterberg wrote: ↑Tue Dec 29, 2020 10:48 pm Would this also be the way to store actual thread cross section parameters. I.e what we need in order to produce the real thread geometry (when that feature has been implemented)?
I have been recently been working on something similar (https://github.com/FreeCAD/FreeCAD/pull/4209), and implementing the hole feature's true thread function has been on my todo list.
But in order to do it we need to agree on how to store and maintain the database of cross sections dimensions (all the parameters). It would be tempting to somehow use sketches to draw the cross sections with constraints for each thread family, and use JSON to store the dimensional values. This way it would be easy to implement new thread types. Not sure how to implement it though.
Re: PartDesign Hole: read cut-types from json-files.
I don’t know, but I do not have an overview at all. Maybe ask wmayer or uwestoehrdavidosterberg wrote: ↑Wed Dec 30, 2020 12:50 pm Great! Do you know if somebody else is working on the true threads implementation?
Interesting featureI have been recently been working on something similar (https://github.com/FreeCAD/FreeCAD/pull/4209), and implementing the hole feature's true thread function has been on my todo list.
There are at least two ways to generate threads. For a vertical thread:
- sweep a vertical cross-section of one tooth along a helix or
- sweep a horizontal crossection of the thread along a helix (see ThreadProfile workbench¹).
There is also thread-generation in the fasteners-workbench² (don’t know how it’s working).
The hard part probably is implementing the thread creation, putting the parameters in JSON-files is straightforward then.But in order to do it we need to agree on how to store and maintain the database of cross sections dimensions (all the parameters). It would be tempting to somehow use sketches to draw the cross sections with constraints for each thread family, and use JSON to store the dimensional values. This way it would be easy to implement new thread types. Not sure how to implement it though.
__________
¹ https://github.com/mwganson/ThreadProfile
² https://github.com/shaise/FreeCAD_FastenersWB
-
- Posts: 529
- Joined: Fri Sep 18, 2020 5:40 pm
Re: PartDesign Hole: read cut-types from json-files.
There is an overview in https://wiki.freecadweb.org/Thread_for_Screw_Tutorial that covers both these methods. I like Method 3 (the former in your list). because it is straight forward to define and verify the profile against the defining standard. You can also implement stuff like thread tolerance, so that the user can tweak that to his liking (important for 3D printing).rynn wrote: ↑Thu Dec 31, 2020 11:49 am There are at least two ways to generate threads. For a vertical thread:In my understanding the later method is favorable.
- sweep a vertical cross-section of one tooth along a helix or
- sweep a horizontal crossection of the thread along a helix (see ThreadProfile workbench¹).
Not hard. The functionality is there in above mentioned PR. It could do both the sweep methods you mention.
-
- Posts: 529
- Joined: Fri Sep 18, 2020 5:40 pm
Re: PartDesign Hole: read cut-types from json-files.
Sneak peak of upcoming PR:
- Metric coarse thread is implemented
- Left / Right thread direction
Todo:
- Thread modeling is pretty slow, so perhaps give some visual indication that FreeCAD is thinking.
- Implement UNC
- Perhaps some refactoring
- Perhaps thread lead out
- Tolerance adjustment (including convenience functions for 3d printing)
What works:- Metric coarse thread is implemented
- Left / Right thread direction
Todo:
- Thread modeling is pretty slow, so perhaps give some visual indication that FreeCAD is thinking.
- Implement UNC
- Perhaps some refactoring
- Perhaps thread lead out
- Tolerance adjustment (including convenience functions for 3d printing)
-
- Posts: 529
- Joined: Fri Sep 18, 2020 5:40 pm
Re: PartDesign Hole: read cut-types from json-files.
From the images it looks as if you mixed left and right hand threads.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
-
- Posts: 529
- Joined: Fri Sep 18, 2020 5:40 pm
Re: PartDesign Hole: read cut-types from json-files.
I don't think so (but doing this kind of error is my specialty so you never know). Maybe it is a perspective thing?
The threads being generated in the picture are the fine pitched ones to the left and they are left handed. The coarse pitched ones are right handed (i believe).
You might want to move this conversation to the other thread. I only cross posted here to attract the attention of some of the stakeholders/maintainers of this tool.