First steps: Bearing Workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
- matthiaswm
- Posts: 35
- Joined: Wed Nov 18, 2020 11:41 am
- Location: Düsseldorf, Germany
First steps: Bearing Workbench
After a bit of hacking around (this is my first Python project), I thought I let you know about my little Roller Bearing Workbench:
https://github.com/MatthiasWM/FreeCAD_BearingsWB
It's not much yet, but it has a little database attached with 400 quite common ball bearings.
To improve the way the database is queried, I want to write a Task Panel next, but my Qt knowledge is quite minimal and the Qt Creator seems quite scary. Pointers, links, and general suggestions always appreciated.
https://github.com/MatthiasWM/FreeCAD_BearingsWB
It's not much yet, but it has a little database attached with 400 quite common ball bearings.
To improve the way the database is queried, I want to write a Task Panel next, but my Qt knowledge is quite minimal and the Qt Creator seems quite scary. Pointers, links, and general suggestions always appreciated.
Re: First steps: Bearing Workbench
I would advise you to make a mock up for the "task panel". At best, someone would be able to write you the UI files and implementation. At worst, you get one step closer to understanding Qt yourself because now you have a project.matthiaswm wrote: ↑Fri Aug 05, 2022 8:16 pm To improve the way the database is queried, I want to write a Task Panel next, but my Qt knowledge is quite minimal and the Qt Creator seems quite scary. Pointers, links, and general suggestions always appreciated.
FreeCAD_0_20_and_Bwb6Table_py.png
Re: First steps: Bearing Workbench
I'd be happy to give you a quick introduction to how the UI system works. This is not on expert level but sure should be enough to get a lot of starting off knowledge. This will probably require a lot of talking back and forth, so talking on a chat forum would surely be easiest. I got Discord and can be added as bensay#5141 and there is also the FreeCAD Discord server https://discord.gg/mTmcn7msqv where you should be welcome to ping me.matthiaswm wrote: ↑Fri Aug 05, 2022 8:16 pm To improve the way the database is queried, I want to write a Task Panel next, but my Qt knowledge is quite minimal and the Qt Creator seems quite scary. Pointers, links, and general suggestions always appreciated.
- matthiaswm
- Posts: 35
- Joined: Wed Nov 18, 2020 11:41 am
- Location: Düsseldorf, Germany
Re: First steps: Bearing Workbench
Thanks for the offer to get the UI stuff going. I was able to fiddle out a few things already, but I will get back to you when needed.
Re: First steps: Bearing Workbench
Is this something that can perhaps be merged with the fasteners workbench?
- matthiaswm
- Posts: 35
- Joined: Wed Nov 18, 2020 11:41 am
- Location: Düsseldorf, Germany
Re: First steps: Bearing Workbench
That was actually my first intuition, and some of my code is based on what I found in the Fastener workbench source. For the time being, I decided to start new workbench, so that my commits don't disturb the Fastener repo. When the Bearings WB is getting mature, and the community prefers a merge, it would be an easy thing to do and I would of course support that.Haavard wrote: ↑Mon Aug 08, 2022 9:58 am Is this something that can perhaps be merged with the fasteners workbench?
Re: First steps: Bearing Workbench
Cool! This is a nice move towards a more complete freecad toolbox
Will checkout this workbench the next time i use a bearing in a part.
- matthiaswm
- Posts: 35
- Joined: Wed Nov 18, 2020 11:41 am
- Location: Düsseldorf, Germany
Re: First steps: Bearing Workbench
Ok, I have a question:
I am using the "App::PropertyEnumeration" for the bearing Designation because it provides a neat list of enumeration. Because the list is quite large with 400+ options, I only show those to the user that make sense in the context.
When I use `obj.Designation = [ "608", "612", ... ]` to change that list, it does not update until I deselect the property and result it. I would like to update it immediately though. Is there a way?
My current workaround removes the entire property and adds it again with the new set of choices, which works, but seems ugly:
https://github.com/MatthiasWM/FreeCAD_B ... gs.py#L101
I am using the "App::PropertyEnumeration" for the bearing Designation because it provides a neat list of enumeration. Because the list is quite large with 400+ options, I only show those to the user that make sense in the context.
When I use `obj.Designation = [ "608", "612", ... ]` to change that list, it does not update until I deselect the property and result it. I would like to update it immediately though. Is there a way?
My current workaround removes the entire property and adds it again with the new set of choices, which works, but seems ugly:
https://github.com/MatthiasWM/FreeCAD_B ... gs.py#L101
- matthiaswm
- Posts: 35
- Joined: Wed Nov 18, 2020 11:41 am
- Location: Düsseldorf, Germany
Re: First steps: Bearing Workbench
I released a v0.0.3. If anyone likes to try it, simply click on a new document, then the bearing symbol in the bearing WB, the select the bearing. The Property dialog will show the designation. Click on it, and you will get a choice of similar bearings.
Likewise, change any of the diameters or the width, and the WB will try to find the matching Designation. If there is none, the user can still choose a similar bearing from the Designation pulldown menu.
Likewise, change any of the diameters or the width, and the WB will try to find the matching Designation. If there is none, the user can still choose a similar bearing from the Designation pulldown menu.
Code: Select all
https://youtu.be/wVlp09tWLBE