Creating a new CNC Tool Library and Toolbit

Here's the place for discussion related to CAM/CNC and the development of the Path module.
GeneFC
Veteran
Posts: 5205
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Creating a new CNC Tool Library and Toolbit

Post by GeneFC »

m_brown wrote: Thu Sep 14, 2023 2:19 am 21:05:20 BitLibrary.ERROR: Could not find tool #1: .125in_Endmill.fctb
I cannot tell just what you are doing that is not working.

Try digging around a bit in your folder structure to find out where the default tool files are located and where your new files are going. It sounds like something may have been messed up during your various attempts to get the tools set up.

You could also try a more radical approach.

Rename and/or save you configuration files, which should be in C:\\Users\###yourID##\AppData\Roaming\FreeCAD.

Then start a completely clean session of FreeCAD. Follow the direction I noted above to create tools. You should then be able to see where the tools are located.

You can restore your old configuration files if they contain items you wish to keep. Move the new tools into the restored folders.

I know this works, because I tried it earlier today.

Gene
m_brown
Posts: 26
Joined: Tue Sep 12, 2023 5:19 pm
Location: Little Rock, AR

Re: Creating a new CNC Tool Library and Toolbit

Post by m_brown »

That did it.
I renamed .../Appdata/Roaming/FreeCAD/user.cfg, and started FreeCAD.
After setting the preferred Units, selecting the Path WB, and clicking on the Tool Doc icon, it had me select an OS folder.
I used a folder of my own choosing, allowed it to make the other sub-folders and copy all the example toolbits.
I created my own tool library and added the tool I created.
The noteworthy difference was when it asked me for the template ToolBit, previously I was using one I had created, but this time it asked me to choose one from what looked like a standard set of templates, and I selected Endmill.
And it all seemed to work. Wahoo!
Thanks
GeneFC
Veteran
Posts: 5205
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Creating a new CNC Tool Library and Toolbit

Post by GeneFC »

Great!
GeneFC
Veteran
Posts: 5205
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Creating a new CNC Tool Library and Toolbit

Post by GeneFC »

CandL wrote: Sun Sep 17, 2023 5:17 pm
Frankly, I would stay clear of the "BTL" until the FreeCAD tool library basics are working. No need for all the added complication up front.

It depends on ones ultimate needs. I took a good look and decided to skip it, since it adds nothing I need.

Gene
m_brown
Posts: 26
Joined: Tue Sep 12, 2023 5:19 pm
Location: Little Rock, AR

Re: Creating a new CNC Tool Library and Toolbit

Post by m_brown »

(1) Am I correct to presume the Tool Dock is still rather new? Other than creating it, it's not actually used in any of the tutorials I've found.

Almost everything I do experimenting around causes tons of senseless error messages, most of which are utterly cryptic, and what little that makes sense seems to be wrong. But, rather than dwell on what's wrong, I'd like to focus on the right way to do things in the first place...

I created a simple part with 4 pockets, and I want to cut it out with an endmill like you might do with a laser cutter.

(2) BTW, Is there no way to copy and mirror sketch objects?

I just drew and constrained all the symmetric lines and arcs manually...

(3) BTW, What does this mean? The sketcher told me everything is fully constrained, but this error is repeated over and over again.

Code: Select all

  File "C:\Program Files\FreeCAD 0.21\Mod\Path\Path\Main\Gui\Job.py", line 1634, in clearSelection
    self.updateSelection()
  File "C:\Program Files\FreeCAD 0.21\Mod\Path\Path\Main\Gui\Job.py", line 1371, in updateSelection
    self.form.setOrigin.setEnabled(False)
<class 'AttributeError'>: 'NoneType' object has no attribute 'setOrigin'
I saved the part file.

[Edit] Later, I went back and closed FreeCAD, relaunched it, and opened this same file, and this error didn't reappear. So, I'll take that as a memory leak bug...

Anyway, I created a Job and set the Stock and job origin, and closed the window.
The Model Data shows TC:Default Tool, but I want to use the tool I created.
I display the Tool Selector (Dock) and see the tool I want to use, but I haven't seen any documentation or YouTube tutorials showing what to do with it.
if I click the tool I want to use on the Tool Library and click the Add to Job button it creates a Body001 and Body002 objects in the Job, this is what it reports:

Code: Select all

10:36:05  Traceback (most recent call last):
10:36:05    File "C:\Program Files\FreeCAD 0.21\Mod\Path\Path\Tool\Gui\BitLibrary.py", line 459, in selectedOrAllToolControllers
10:36:05      tools = self.selectedOrAllTools()
10:36:05    File "C:\Program Files\FreeCAD 0.21\Mod\Path\Path\Tool\Gui\BitLibrary.py", line 439, in selectedOrAllTools
10:36:05      tools.append((toolNr, PathToolBit.Factory.CreateFrom(toolPath)))
10:36:05    File "C:\Program Files\FreeCAD 0.21\Mod\Path\Path\Tool\Bit.py", line 492, in CreateFrom
10:36:05      bit = Factory.CreateFromAttrs(data, name, path)
10:36:05    File "C:\Program Files\FreeCAD 0.21\Mod\Path\Path\Tool\Bit.py", line 476, in CreateFromAttrs
10:36:05      obj = Factory.Create(name, attrs["shape"], path)
10:36:05    File "C:\Program Files\FreeCAD 0.21\Mod\Path\Path\Tool\Gui\Bit.py", line 173, in Create
10:36:05      tool = PathToolBit.ToolBitFactory.Create(self, name, shapeFile, path)
10:36:05    File "C:\Program Files\FreeCAD 0.21\Mod\Path\Path\Tool\Bit.py", line 501, in Create
10:36:05      obj.Proxy = ToolBit(obj, shapeFile, path)
10:36:05    File "C:\Program Files\FreeCAD 0.21\Mod\Path\Path\Tool\Bit.py", line 183, in __init__
10:36:05      self._setupBitShape(obj)
10:36:05    File "C:\Program Files\FreeCAD 0.21\Mod\Path\Path\Tool\Bit.py", line 371, in _setupBitShape
10:36:05      self._setupProperty(obj, prop, attributes)
10:36:05    File "C:\Program Files\FreeCAD 0.21\Mod\Path\Path\Tool\Bit.py", line 336, in _setupProperty
10:36:05      obj.addProperty(typ, prop, grp, dsc)
10:36:05  NameError: {'sclassname': 'class Base::NameError', 'sErrMsg': 'Property Unnamed#ToolBit001.Shape already exists', 'sfile': 'E:\\FreeCAD\\FreeCAD-0.21\\src\\App\\DynamicProperty.cpp', 'iline': 173, 'sfunction': 'class App::Property *__cdecl App::DynamicProperty::addDynamicProperty(class App::PropertyContainer &,const char *,const char *,const char *,const char *,short,bool,bool)', 'swhat': 'Property Unnamed#ToolBit001.Shape already exists', 'btranslatable': False, 'breported': False}
Body001 is my tool bit, and body002 is my tool shape. they are Job objects, not listed in the Job.Tools collector.

so, I stopped right there and closed the part and exited FreeCAD so as to not stumble accross any memory leaks, and started it up again.
I opened this part again, and double-clicked on the Job object to edit it.
I selected the Tools tab, and clicked the Add button. I selected my tool. It didn't actually add it to the list of tools (in the Job Editor), but it gave me the same error except for the top 4 lines (before the one that ends in CreateFrom)
... and I'm stuck.
I attached the part file I created, and the tool shape and bit files too.
as always, thanks for your help.

[Edit] In the interest of turnaround time, I went back and restarted FreeCAD and reloaded the part, created a job without adding my tool, created a profile and offset patterns in some pockets, and attached are what the paths look like. That's bizarre. I can't figure out a pattern to those weird paths, but they seem to be correct sometimes, then changing a Step Over parameter back and forth from 25 to 30 or something benign like that changes it back to forth from correct to wrong.
Attachments
Tool Path.png
Tool Path.png (21.44 KiB) Viewed 195 times
Round Window 5.2.FCStd
(49.68 KiB) Downloaded 4 times
Endmill_.125in.FCStd
(12.16 KiB) Downloaded 4 times
Endmill_.125in.fctb
(368 Bytes) Downloaded 4 times
Round Window 5.FCStd
(19.7 KiB) Downloaded 4 times
jbraun
Posts: 214
Joined: Fri Sep 18, 2020 5:41 pm

Re: Creating a new CNC Tool Library and Toolbit

Post by jbraun »

The Model Data shows TC:Default Tool, but I want to use the tool I created.
Does the same problem exist if one of FC provided sample tools is added ? The custom tool video must be watched carefully because not everything that happens on screen is mentioned explicitly in the spoken commentary. Also the video was done in linux so some of the file paths may not apply.
For an endmill FC already provides that shape file.
If the problem extends to the sample tools I'm not sure what's going on.
For English help on youtube check out Joko Engineering or Mango Jelly Solutions.
Look for recent videos, this software is updated at a rapid pace.
GeneFC
Veteran
Posts: 5205
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Creating a new CNC Tool Library and Toolbit

Post by GeneFC »

m_brown wrote: Mon Sep 18, 2023 4:41 pm
I still have not figured out where you are going wrong, but this is what I saw when I opened your file.

Capture.PNG
Capture.PNG (39.48 KiB) Viewed 145 times

Gene
GeneFC
Veteran
Posts: 5205
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Creating a new CNC Tool Library and Toolbit

Post by GeneFC »

m_brown wrote: Mon Sep 18, 2023 4:41 pm (1) Am I correct to presume the Tool Dock is still rather new?
The tool dock or its equivalent has been around "forever", although substantial changes were made a couple of years ago.

I don't understand the problem of selecting tools. Just pick one from the Tool Dock display and click "Add to Job". The tool will be placed in the Job section of the tree and it can be used in any operation. You can also click the "3-milling bit" icon at the top right corner of the Tool Dock to go into the tool library for more detailed selections.

At this stage in your work there is no reason at all to try to create your own tool shapes (tool.FCStd files). The default set includes ordinary endmills. You may need to create a specific size, but that does not require a new shape file.

As far a tutorials, look for the ones by Sliptonic. He "wrote the book", so to speak. Some of the other tutorials are very good and some are garbage.

Gene
m_brown
Posts: 26
Joined: Tue Sep 12, 2023 5:19 pm
Location: Little Rock, AR

Re: Creating a new CNC Tool Library and Toolbit

Post by m_brown »

Gads! and you generated that running in this kind of environment?

Code: Select all

OS: Windows 10 build 19045
Word size of FreeCAD: 64-bit
Version: 0.21.1.33668 +26 (Git)
Build type: Release
Branch: (HEAD detached at 0.21.1)
Hash: f6708547a9bb3f71a4aaade12109f511a72c207c
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: English/United States (en_US)
Yes, I've carefully reviewed all the Sliptonic tutorials. They're very instructional, but they're all based on earlier versions now because I see some discrepancies. He goes into quite a lot of detail about creating your own tools and libraries, and the benefits. All of the literature and most of the tutorials elaborate on the virtues of customizing the work environment to your preferences. And I do prefer to do everything in inches I can.

The version of this thing I'm working on now is using the unmodified default tool instead of my own, without any effect. So, there's something else going on here I haven't identified yet. I've recomposed the part and the paths from scratch. I'm about to try uninstalling the whole thing and reinstalling it again just to see if that has any effect too.
Last edited by m_brown on Tue Sep 19, 2023 12:05 am, edited 4 times in total.
Post Reply