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: 2081
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Toolbits. SERIOUS EFFORT NEEDED

Postby sliptonic » Sat Nov 07, 2020 6:05 pm

Thanks for the bug reports.
Just pushed the branch again with fixes for most of these

No longer has duplicate docks. BTW, the toolbar button for the dock toggles the state. So you can push it to both open and close the dock. The bug was only occurring if you closed with the 'X' button but now all states should be correct.

Changes to the edited Tool are now retained. Both for main properties and the attributes.

The disappearing tool was only happening if you added a new tool and then edited it. This has been fixed.

The changing toolbit name is by design. Toolbit sort of assumes that the name has something to do with the shape so it suggests a name whenever you change the shape. If this is perceived as a bug we can revisit it.
User avatar
dubstar-04
Posts: 592
Joined: Mon Mar 04, 2013 8:41 pm
Location: Chester, UK
Contact:

Re: Toolbits. SERIOUS EFFORT NEEDED

Postby dubstar-04 » Sun Nov 08, 2020 9:29 am

sliptonic wrote:
Sat Nov 07, 2020 6:05 pm
Thanks for the bug reports.
Just pushed the branch again with fixes for most of these
Amazing response time! The tooldock workflows seem robust now and a great improvement over the legacy tools. Additional testing results:

Tested and works as expected:
- Creating new tool
- Deleting existing tool
- Modifying an existing tool
- Modifying a new tool
- Add tool to job
- Add feeds and speeds to tool controller
- Delete tool controller
- Create operation using new tool controller
- Simulate job using toolbits

Unimplemented:
- moving tools between tool libraries
- deleting library through UI

Unexpected behaviour:
- saving library with a new name doesn't load the new library in the UI list (requires reselection of the library path)

Thanks,

Dan
florian1991
Posts: 2
Joined: Sat Oct 10, 2020 9:36 pm

Re: Toolbits. SERIOUS EFFORT NEEDED

Postby florian1991 » Sun Nov 08, 2020 10:38 am

Hi Brad

Tool Bits is amazing!

One small bug i found in the simulation (the path was correct):
If i edit the tool in the tree
2020-11-08 11_31_00-FreeCAD 0.19.png
2020-11-08 11_31_00-FreeCAD 0.19.png (298.63 KiB) Viewed 341 times
and then start the simulation, the Toolbit was not correctly updated and the simulation of the part is not correct
2020-11-08 11_27_14-FreeCAD 0.19.png
2020-11-08 11_27_14-FreeCAD 0.19.png (88.15 KiB) Viewed 341 times
sometimes it errors out with

Code: Select all

11:21:07  Running the Python command 'Path_Simulator' failed:
Traceback (most recent call last):
  File "C:\Users\flori\Git Projekts\FreeCAD\FreeCAD\build\Mod\Path\PathScripts\PathSimulatorGui.py", line 533, in Activated
    pathSimulation.Activate()
  File "C:\Users\flori\Git Projekts\FreeCAD\FreeCAD\build\Mod\Path\PathScripts\PathSimulatorGui.py", line 88, in Activate
    self.SimulateMill()
  File "C:\Users\flori\Git Projekts\FreeCAD\FreeCAD\build\Mod\Path\PathScripts\PathSimulatorGui.py", line 178, in SimulateMill
    self.SetupSimulation()
  File "C:\Users\flori\Git Projekts\FreeCAD\FreeCAD\build\Mod\Path\PathScripts\PathSimulatorGui.py", line 114, in SetupSimulation
    self.SetupOperation(0)
  File "C:\Users\flori\Git Projekts\FreeCAD\FreeCAD\build\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
and the simulation doesnt work at all

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22895 +9 (Git)
Build type: Release
Branch: pr/sliptonic/4014
Hash: f2d7979b3fc8c07f8890a0b6dce11c22603f81b1
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Austria (de_AT)


Florian
Attachments
test.FCStd
(73.83 KiB) Downloaded 14 times
Last edited by florian1991 on Sun Nov 08, 2020 11:16 am, edited 1 time in total.
User avatar
Kunda1
Posts: 9212
Joined: Thu Jan 05, 2017 9:03 pm

Re: Toolbits. SERIOUS EFFORT NEEDED

Postby Kunda1 » Sun Nov 08, 2020 10:52 am

Hi @florian1991, you first post, welcome to the forum! A request we ask of users especially when asking for help or testing code, please post your About so we know if you're using the latest iteration of code (and what 3rd party dependencies you're using). It saves everyone a lot of time.
Alone you go faster. Together we go farther
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
herbk
Posts: 1987
Joined: Mon Nov 03, 2014 3:45 pm
Location: Windsbach, Bavarya (Germany)

Re: Toolbits. SERIOUS EFFORT NEEDED

Postby herbk » Tue Nov 10, 2020 6:24 pm

Hi,
can someone please give me a hint how to start with Toolbits ?

I have Lagacy Tools disabled and have created a tooltable, but don't find a way to create a tool.... :oops:

OS: openSUSE Leap 15.1 (KDE//usr/share/xsessions/plasma5)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22960 (Git) AppImage
Build type: Release
Branch: master
Hash: c5a4b01d2e4218bcc0eb6650337650a6c65ef0e4
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: German/Germany (de_DE)
Gruß Herbert
User avatar
sliptonic
Posts: 2081
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Toolbits. SERIOUS EFFORT NEEDED

Postby sliptonic » Tue Nov 10, 2020 6:52 pm

This is still a draft PR. If you can build from source, you can pull my branch or checkout the PR branch and build it.

From there, you need to disable legacy tools and restart.

Then pushing the library toolbar button will open the 'Dock' which shows your currently selected library. If you don't have a library, it should default to the one shipped with FreeCAD. The dock lets you add tool controllers for tools in your library.

There's a button in the corner of the dock that opens the library manager. Here you can create new libraries, add existing toolbits to a library, create toolbits, etc.

When you close the manager, whichever library was shown will become the default in the Dock.
User avatar
sliptonic
Posts: 2081
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Toolbits. SERIOUS EFFORT NEEDED

Postby sliptonic » Tue Nov 10, 2020 8:03 pm

florian1991 wrote:
Sun Nov 08, 2020 10:38 am

One small bug i found in the simulation (the path was correct):
Hi Florian,
Boy I hate it when people say, "one small bug..." :lol:

You've uncovered something trickier. The shapefiles and Toolbit files are stored outside the document. When you create a toolcontroller, a copy of the toolbit is created inside the document.

So here's the scenario:
The user has custom toolshape. And also a custom toolbit that uses the shape.
The user creates a document with a Job and adds a TC and the custom toolbit to an operation.

So far, so good.

Now the user shares the file. Maybe uploads it to the forum.

At this point we're still good. Everything should work because the toolbit is stored in document and the toolbit has a shape property that holds a solid corresponding to the tool. When you toggle the visibility of a toolbit, this is the shape you're seeing. Everything including the simulation should still work....except for editing the toolbit. That won't be possible because the shapefile doesn't exist to rebuild the shape solid.

I think unless the shapefile is found, the toolbit is effectively read-only. This is something we need to handle more gracefully. At the moment it's an ugly error.

I can't duplicate your specific simulation bug because of unknown toolbits/shapefiles and this might be part of the problem as you're seeing it.

Hmm. You've given us something to chew on.
florian1991
Posts: 2
Joined: Sat Oct 10, 2020 9:36 pm

Re: Toolbits. SERIOUS EFFORT NEEDED

Postby florian1991 » Tue Nov 10, 2020 8:33 pm

Boy I hate it when people say, "one small bug..." :lol:
Sorry, i know that feeling :oops: (i am a PLC programmer/Mechatronics engineer)
I can't duplicate your specific simulation bug because of unknown toolbits/shapefiles and this might be part of the problem as you're seeing it
I use the endmill shape from Mod\Path\Tools\Shape

I know now when the simulation errors out with this error:

Code: Select all

21:06:35  Running the Python command 'Path_Simulator' failed:
Traceback (most recent call last):
  File "C:\Users\flori\Git Projekts\FreeCAD\FreeCAD\build\Mod\Path\PathScripts\PathSimulatorGui.py", line 533, in Activated
    pathSimulation.Activate()
  File "C:\Users\flori\Git Projekts\FreeCAD\FreeCAD\build\Mod\Path\PathScripts\PathSimulatorGui.py", line 88, in Activate
    self.SimulateMill()
  File "C:\Users\flori\Git Projekts\FreeCAD\FreeCAD\build\Mod\Path\PathScripts\PathSimulatorGui.py", line 178, in SimulateMill
    self.SetupSimulation()
  File "C:\Users\flori\Git Projekts\FreeCAD\FreeCAD\build\Mod\Path\PathScripts\PathSimulatorGui.py", line 114, in SetupSimulation
    self.SetupOperation(0)
  File "C:\Users\flori\Git Projekts\FreeCAD\FreeCAD\build\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
To get the error the shank diameter and the diameter of the cutting edge have the same diameter (like most endmills do). I guess its an error in the sketch of the Toolshape (the points of the line are on the same position).

Code: Select all

21:06:16  Updating geometry: Error build geometry(7): Both points are equal
21:06:16  Invalid solution from DogLeg solver.
It also happens on newly created tools
If i edit or create it with different diameters it works as expected

About this bug:
2020-11-10 21_25_48-FreeCAD 0.19.png
2020-11-10 21_25_48-FreeCAD 0.19.png (54.46 KiB) Viewed 204 times
I guess the shapefile is only updated when i double-click on here
2020-11-10 21_27_04-FreeCAD 0.19.png
2020-11-10 21_27_04-FreeCAD 0.19.png (22.65 KiB) Viewed 204 times
and not when i click ok in the edit task window.

When i open the edit task a second time without editing --> everything is fine again

Hope this helps

Florian


OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22895 +9 (Git)
Build type: Release
Branch: pr/sliptonic/4014
Hash: f2d7979b3fc8c07f8890a0b6dce11c22603f81b1
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Austria (de_AT)
Last edited by florian1991 on Tue Nov 10, 2020 9:25 pm, edited 1 time in total.
herbk
Posts: 1987
Joined: Mon Nov 03, 2014 3:45 pm
Location: Windsbach, Bavarya (Germany)

Re: Toolbits. SERIOUS EFFORT NEEDED

Postby herbk » Tue Nov 10, 2020 8:59 pm

Hi sliptonic,

sorry i cant compile by myselv, there are some dependencies at my OpenSuse i cant solve with my knolege...
sliptonic wrote:
Tue Nov 10, 2020 6:52 pm
... add existing toolbits to a library, create toolbits, etc.
A button "Add existing toolbits" i have, but not one to create a new...
Gruß Herbert
User avatar
sliptonic
Posts: 2081
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Toolbits. SERIOUS EFFORT NEEDED

Postby sliptonic » Tue Nov 10, 2020 10:04 pm

herbk wrote:
Tue Nov 10, 2020 8:59 pm
Hi sliptonic,

sorry i cant compile by myselv, there are some dependencies at my OpenSuse i cant solve with my knolege...

A button "Add existing toolbits" i have, but not one to create a new...
Toolbits have been in experimental features for a long time but the current PR changes a lot of the GUI and workflow. If your screen doesn't look like the one on this page: https://wiki.freecadweb.org/Path_ToolBi ... ry_Manager then you don't have the current stuff.