Tool library really messed up

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
blazini36
Posts: 81
Joined: Wed Apr 18, 2018 10:21 am

Tool library really messed up

Post by blazini36 »

I was hoping to machine a couple of parts today, instead I've been messing with this tool library issue. Running Freecad on Linux (Manjaro), the Official version:

Code: Select all

OS: Manjaro Linux (GNOME/gnome)
Word size of FreeCAD: 64-bit
Version: 0.21.30029 (Git)
Build type: Release
Branch: makepkg
Hash: 7f23e793eb136def6aee0f0ce8131bbbb6cd21e6
Python 3.10.5, Qt 5.15.5, Coin 4.0.1, Vtk 9.1.0, OCC 7.5.3
Locale: English/United States (en_US)
Installed mods: 
  * kicadStepUpMod 10.14.5
The Tool library Editor is completely bugged out in this version. I remember being pretty annoyed when the whole "tool dock" thing started but I managed to get it going fine since. Not sure when this started since I haven't used path in a while but it must have broken in an update. The library I was running was stored on an NFS share.

I go to open it today and it's blank. I putzed around with it and can't get it going. I tried just starting a new one and ever time I create a new tool under either the default or a custom Library, the new tool dissapears soon as I click on the Library in the editor. Nothing one the NFS share has changed, but I tried setting everything up in the ~.FreeCAD/... directory, same thing. I came across a post that said they needed to edit the user.cfg file for "LastPathToolLibrary" and a couple of similar entries. I tried leaving the values blank, and entering local directories. I tried enabling legacy tools....nothing.

I tried installing the appimage, same deal. I tried installing the latest git version but it failed to build. I went back to the Arch repo version. Any ideas as to how to get a working tool library again?
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Tool library really messed up

Post by GeneFC »

I don't have any tool library problems with the latest versions, but I am on Windows.

There has been a lot of discussion recently about the location of support files in Linux installations. I think there were some changes in the FreeCAD core that changed locations.

I would look in that direction to see if you can find the missing tool library.

Gene
blazini36
Posts: 81
Joined: Wed Apr 18, 2018 10:21 am

Re: Tool library really messed up

Post by blazini36 »

Well I know where the library is. The problem is it doesn't work. I re-pointed at the original and it repopulated once I think, as soon as I click on the library in the editor all the tools dissapear. That's the same problem I have when I just start from scratch and try to add a new tool to a newly created library.

After deleting the .FreeCAD folder the Legacy tool manager now works. I get a pop-up that says it'll be removed in .20 but this is .21 sooo. I'm working on a toolpath now, if it works with the Legacy tools that's fine by me, I liked the old setup better anyway.
blazini36
Posts: 81
Joined: Wed Apr 18, 2018 10:21 am

Re: Tool library really messed up

Post by blazini36 »

Well Legacy tools don't seem to work. Some error about a curve, I assume that's because legacy tools were removed.

I switched back to the newer tool manager. I see what the problem is now, the manager keeps rewriting the library as a blank file. I can copy everything from the Default.fctl file into a new .fctl file outside of FreeCAD and it'll get wiped out. If I add a tool to the default library it'll just wipe the new tool out and write the file back to default tools.

This is a pretty major bug, I'm a bit surprised I'm the first person to encounter it.
User avatar
sliptonic
Veteran
Posts: 3459
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Tool library really messed up

Post by sliptonic »

blazini36 wrote: Mon Sep 05, 2022 1:54 am This is a pretty major bug, I'm a bit surprised I'm the first person to encounter it.
Probably because there's something unique to your situation. The bug isn't affecting everyone.
Start by checking out the value of these four parameters
LastFileToolLibrary
LastPathToolBit
LastPathToolLibrary
LastPathToolShape

Also check
UseAbsoluteToolPaths

I'm guessing that there's something goofy with one or more of those.
blazini36
Posts: 81
Joined: Wed Apr 18, 2018 10:21 am

Re: Tool library really messed up

Post by blazini36 »

Well I had uninstalled Freecad and wiped the ~/.FreeCAD and ~/.config/FreeCAD directories and then set it up from scratch with the first time tool library dialog. Not sure what's special about my setup. As I said, I've edited the values in the config file you mentioned, gave them the proper directories and left them blank.

I did sort of figure it out though. For whatever reason the dialog will ask to create the 3 directories, bit, shape, and Library. It looks like it creates the actual library file above those 3 directories rather than inside the Library directory, then it can't find it when saving a toolbit. That's the best I can tell what happened because re-pointing the tool library manager to the Library directory and creating a new one seemed to solve it though i thought I tried that already.

Now I have another problem, which I thought was because of trying the legacy tools but it's still there. I can't create a simple drill operation. No idea what's going on here:

Code: Select all

14:35:38  Traceback (most recent call last):
  File "/usr/lib/freecad/Mod/Path/PathScripts/PathUtils.py", line 71, in new_function
    res = function(*args, **kwargs)
  File "/usr/lib/freecad/Mod/Path/PathScripts/PathOp.py", line 820, in execute
    result = self.opExecute(obj)
  File "/usr/lib/freecad/Mod/Path/PathScripts/PathCircularHoleBase.py", line 194, in opExecute
    self.circularHoleExecute(obj, holes)
  File "/usr/lib/freecad/Mod/Path/PathScripts/PathDrilling.py", line 276, in circularHoleExecute
    PathFeedRate.setFeedRate(self.commandlist, obj.ToolController)
  File "/usr/lib/freecad/Mod/Path/PathFeedRate.py", line 80, in setFeedRate
    if _isVertical(machine.getPosition(), command):
  File "/usr/lib/freecad/Mod/Path/PathFeedRate.py", line 72, in _isVertical
    return PathGeom.isVertical(Part.makeLine(currentposition, endpoint))
  File "/usr/lib/freecad/Mod/Path/PathScripts/PathGeom.py", line 180, in isVertical
    if type(obj.Curve) == Part.Line or type(obj.Curve) == Part.LineSegment:
<class 'Base.FreeCADError'>: Unknown exception while reading attribute 'Curve' of object 'TopoShape'
14:35:38  Recompute failed! Please check report view.
memfis
Posts: 589
Joined: Tue Nov 15, 2016 7:58 pm

Re: Tool library really messed up

Post by memfis »

I confirm the existence of these two problems. Drilling has been going on for at least two months (according to appimage updates).
I've created new tools, every time I add tools to a job it says "recalculate", but using the job "template" leads to nothing - nothing is created. A long time ago.
Glad the TS complaints were heard.
User avatar
sliptonic
Veteran
Posts: 3459
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Tool library really messed up

Post by sliptonic »

I rebuilt from current master branch. Blew away my config directory and restarted.
It created tool directory as expected. New tool library was created in the Library directory. Or rather the default location was the Library directory.
I then created a job and drilling operation with a default drill tool. No errors in the console.

For whatever reason, I can't duplicate either issue.

With regard to the drilling op error below, please attach a file.

Code: Select all

OS: Linux Mint 20 (i3/i3)
Word size of FreeCAD: 64-bit
Version: 0.21.29963 (Git)
Build type: Unknown
Branch: master
Hash: 2d4c5a4cfb3ce631ded45525e6770418d05c5dbe
Python 3.8.10, Qt 5.12.8, Coin 4.0.0, Vtk 7.1.1, OCC 7.5.2
Locale: English/United States (en_US)
Installed mods: 
  * Assembly4 0.12.3
  * Behave-Dark-Colors 0.1.1
  * 3DfindIT 1.2.0
  * ProDarkThemePreferencePack 1.0.0
  * sheetmetal 0.2.52
  * FeedsAndSpeeds
  * ExtremeProDark 1.0.4
  * FeedsAndSpeeds.bak
  * Dracula 0.0.2
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Tool library really messed up

Post by GeneFC »

sliptonic wrote: Mon Sep 05, 2022 10:16 pm I then created a job and drilling operation with a default drill tool. No errors in the console.
This sounds a lot like the topic that came up a week ago.

https://forum.freecadweb.org/viewtopic. ... 97#p622397

In my tests that problem was caused by the drilling selector picking up complex holes shapes that could not be analyzed correctly. Removing everything but the circular holes allowed the drilling operation to complete without error.

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

Re: Tool library really messed up

Post by sliptonic »

The drillablelib.isDrillable function really just has this one job. It's used to populate the default list. It takes a model and returns a list of drillable locations. If there are models that break it, I'm interested.

It should find valid (and only valid) targets.

https://github.com/FreeCAD/FreeCAD/blob ... Lib.py#L42

If it's helpful, I can make a macro that uses this in isolation for testing.
Post Reply