Toolbits. SERIOUS EFFORT NEEDED

Here's the place for discussion related to CAM/CNC and the development of the Path module.
User avatar
sliptonic
Posts: 2073
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Toolbits. SERIOUS EFFORT NEEDED

Postby sliptonic » Tue Nov 03, 2020 4:22 pm

Mlampert introduced the Toolbit system a little over a year ago as an experimental feature. At the time, the UI/workflow wasn't complete or polished but the underlying structure was done. Since then, toolbits have gotten very little discussion and almost no additional development. This is really a shame because the new structure is vastly superior to the legacy tools. Besides the many advantages that toolbits offer, we NEED them to support lathe tools in the future.

We're getting very close to a release and I think it would be a mistake to release 0.19 with the legacy tools as the default. That would mean we would have to support the old tools through another development cycle and would have many new users learning and building their tool libraries on an obsolete structure.

I've done some work to smooth out the workflow and make the toolbit system more intuitive. This doesn't change the way toolbits work under the hood, it just organizes the menus and dialogs. I have a draft pull request pending but if we have any chance of getting this in place before a 0.19 release, we need to give it a serious effort.

I've also started the documentation at https://wiki.freecadweb.org/Path_Tools
The pull request is https://github.com/FreeCAD/FreeCAD/pull/4014 This pull request would improve the toolbit system and make it the default for Path.

I'm asking that anyone who can build from a git branch do so and test this. I'm also asking for help reviewing and improving the documentation.
User avatar
sliptonic
Posts: 2073
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Toolbits. SERIOUS EFFORT NEEDED

Postby sliptonic » Tue Nov 03, 2020 4:54 pm

BTW, I'm aware of one serious bug. I don't think this comes from the changes I made but does show up and can cause data loss.

If you have no stylesheet selected in preferences, when you open the toolbit editor dialog in the library, the spinboxes appear squashed. clicking on the name or shape file input box restores the spinboxes but clicking on them will cause a segfault. This doesn't happen if FreeCAD has a stylesheet selected.
GeneFC
Posts: 1773
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Toolbits. SERIOUS EFFORT NEEDED

Postby GeneFC » Tue Nov 03, 2020 9:57 pm

sliptonic wrote:
Tue Nov 03, 2020 4:22 pm
toolbits have gotten very little discussion
I may be a bit dense, but I did not know that there was anything ready to test or discuss. I looked at the new wiki pages you referenced, and I am not sure how to proceed. If I click on the tool icon (3 drill bits), I get the Standard Tool library interface.

If I select the menu item Open Toolbit Library Editor I see Toolbit Library - endmills.fctl with a few prepopulated entries, but it is not clear how to use these inside a Job. How do I replace the old standard Tool Controller method?

I don't use any stylesheets, so I am slightly reluctant to play around very much.

OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22846 (Git)
Build type: Release
Branch: master
Hash: 1f46b72491a0008384a6db4f2615a656249f6f08
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)


Gene
User avatar
sliptonic
Posts: 2073
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Toolbits. SERIOUS EFFORT NEEDED

Postby sliptonic » Wed Nov 04, 2020 12:22 am

GeneFC wrote:
Tue Nov 03, 2020 9:57 pm
I may be a bit dense, but I did not know that there was anything ready to test or discuss.
The basic concept has been in place since mlampert introduced it. For the most part, it works perfectly. He hadn't done any work to smooth out the workflow so the menu was full of interim items and the process of creating toolbit libraries, bits, and editing shapes was confusing. The changes I've made only address the workflow.
I looked at the new wiki pages you referenced, and I am not sure how to proceed. If I click on the tool icon (3 drill bits), I get the Standard Tool library interface.
One change is that the toolbits will now be the default system. However, if you're an existing FreeCAD user, your preference settings will have to be adjusted manually to use the toolbits. Specifically, this one.
preferences.png
preferences.png (81.8 KiB) Viewed 1032 times
Once this is set to not use legacy tools, pressing the library button on the toolbar should toggle the state of the dock. The dock is how you add tool controllers. The rest of the details about the dock and the library editor are on the wiki pages. I'll add a note to the wiki page about setting preferences.
I don't use any stylesheets, so I am slightly reluctant to play around very much.
This may not be a big deal and may be only my machine. I'm still testing.
GeneFC
Posts: 1773
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Toolbits. SERIOUS EFFORT NEEDED

Postby GeneFC » Wed Nov 04, 2020 12:39 am

sliptonic wrote:
Wed Nov 04, 2020 12:22 am
However, if you're an existing FreeCAD user, your preference settings will have to be adjusted manually to use the toolbits.
Thanks, that was the key. I will get right on it.

Gene
spanner888
Posts: 69
Joined: Tue May 28, 2019 10:51 am

Re: Toolbits. SERIOUS EFFORT NEEDED

Postby spanner888 » Wed Nov 04, 2020 3:15 am

Tool manager does not open and error message below appears in report pane.

Steps to reproduce:
Create new doc & switch to Part WB
Create a cube
Switch to Path WB
Create new Job, accept whatever defaults & press OK
Then select menu Path, toolManager, produces following error in console and Tool manager does not open and error message below appears in report pane:

Code: Select all

14:06:02  grbl_post: GCode postprocessor loaded.
14:06:08  Running the Python command 'Path_ToolLibraryEdit' failed:
Traceback (most recent call last):
  File "/home/spanner888/Documents/_source/freecad-build/Mod/Path/PathScripts/PathToolLibraryEditor.py", line 463, in Activated
    self.edit()
  File "/home/spanner888/Documents/_source/freecad-build/Mod/Path/PathScripts/PathToolLibraryEditor.py", line 449, in edit
    if PathToolBitLibraryCmd.CommandToolBitLibraryLoad.Execute(job):

module 'PathScripts.PathToolBitLibraryCmd' has no attribute 'CommandToolBitLibraryLoad'
If in Path preferences Tools, I enable "Use Legacy Tools" the error does not occur, but of course the above steps open legacy tool editor opens and not the ToolBit editor.

Code: Select all

OS: Debian GNU/Linux 10 (buster) (XFCE/xfce)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22895 +2 (Git)
Build type: Unknown
Branch: sliptonic/toolbits_tidyup
Hash: 7d4e21c1c4fbdff2d3eb8eceb7fe5130a8910cf6
Python version: 3.7.3
Qt version: 5.11.3
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Australia (en_AU)
Note a few months ago I did compile and look at the new Toolbit system.
User avatar
dubstar-04
Posts: 576
Joined: Mon Mar 04, 2013 8:41 pm
Location: Manchester, UK
Contact:

Re: Toolbits. SERIOUS EFFORT NEEDED

Postby dubstar-04 » Wed Nov 04, 2020 12:05 pm

spanner888 wrote:
Wed Nov 04, 2020 3:15 am
Tool manager does not open and error message below appears in report pane.
Same issue here.

The class is commented out:
toolbitDock.png
toolbitDock.png (57.43 KiB) Viewed 872 times


OS: Debian GNU/Linux 10 (buster) (GNOME/gnome-xorg)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22894 +3 (Git)
Build type: Unknown
Branch: pr/4014
Hash: 7d4e21c1c4fbdff2d3eb8eceb7fe5130a8910cf6
Python version: 3.7.3
Qt version: 5.11.3
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedKingdom (en_GB)
m0n5t3r
Posts: 129
Joined: Fri Feb 03, 2017 2:55 pm

Re: Toolbits. SERIOUS EFFORT NEEDED

Postby m0n5t3r » Wed Nov 04, 2020 1:26 pm

I'm not sure if it fits here, but I don't see anything in the PR about the simulator, and with the current daily package it doesn't work:

Code: Select all

15:21:30  Running the Python command 'Path_Simulator' failed:
Traceback (most recent call last):
  File "/usr/share/freecad-daily/Mod/Path/PathScripts/PathSimulatorGui.py", line 533, in Activated
    pathSimulation.Activate()
  File "/usr/share/freecad-daily/Mod/Path/PathScripts/PathSimulatorGui.py", line 88, in Activate
    self.SimulateMill()
  File "/usr/share/freecad-daily/Mod/Path/PathScripts/PathSimulatorGui.py", line 178, in SimulateMill
    self.SetupSimulation()
  File "/usr/share/freecad-daily/Mod/Path/PathScripts/PathSimulatorGui.py", line 114, in SetupSimulation
    self.SetupOperation(0)
  File "/usr/share/freecad-daily/Mod/Path/PathScripts/PathSimulatorGui.py", line 138, in SetupOperation
    raise RuntimeError("Path Simulation: Error in tool geometry - {}".format(self.tool.Name))

Path Simulation: Error in tool geometry - ToolBit
I don't have time to attempt a build or to investigate right now, but I think the simulator should work with the default toolbits.
User avatar
sliptonic
Posts: 2073
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Toolbits. SERIOUS EFFORT NEEDED

Postby sliptonic » Wed Nov 04, 2020 3:41 pm

dubstar-04 wrote:
Wed Nov 04, 2020 12:05 pm
spanner888 wrote:
Wed Nov 04, 2020 3:15 am
Tool manager does not open and error message below appears in report pane.
Same issue here.

The class is commented out:
It should be commented out. That's the old editor. This looks like you might have an unclean build
User avatar
dubstar-04
Posts: 576
Joined: Mon Mar 04, 2013 8:41 pm
Location: Manchester, UK
Contact:

Re: Toolbits. SERIOUS EFFORT NEEDED

Postby dubstar-04 » Wed Nov 04, 2020 7:50 pm

sliptonic wrote:
Wed Nov 04, 2020 3:41 pm
dubstar-04 wrote:
Wed Nov 04, 2020 12:05 pm
spanner888 wrote:
Wed Nov 04, 2020 3:15 am
Tool manager does not open and error message below appears in report pane.
Same issue here.

The class is commented out:
It should be commented out. That's the old editor. This looks like you might have an unclean build
It appears you have to restart FreeCAD once you have changed setting for legacy tools.

Without a restart the noted error occurs.

Thanks,

Dan