Paths inside PathCompound fail to compute.

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!
Post Reply
roivai
Posts: 117
Joined: Thu Feb 02, 2017 5:29 pm
Location: Oulu, Finland

Paths inside PathCompound fail to compute.

Post by roivai »

Hi,

I was trying to compound a few paths but received error:

Code: Select all

File "/home/pekka/builds/FreeCAD/freecad-build/Mod/Path/PathScripts/PathHelix.py", line 409, in execute
    job["zsafe"], tool.Diameter,
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'Diameter'
I was able to reproduce that with a simple Profile around a simple box. First, the path is generated just fine, but when I select the Path object and click the Compound icon, error is given.

After browsing inside the PathScripts source for a while, I was able to point out the problem in the findParentJob function inside PathUtils. It seems that it cannot iterate itself out of the Compound object and this again makes the Path unable to determine which tool is loaded by the Tool Controller.

I made a quick fix for it. It is available in my fork. At my very limited testing, it works.
https://github.com/pekkaroi/FreeCAD/com ... 9eb2a71fd7

I have no idea if that is the correct way to deal with that, so I did not want to create any pull requests, but rather ask here. So, is that a bug or am I doing something wrong when creating the compound. And if it really is a bug, is that any good way to fix it?
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: Paths inside PathCompound fail to compute.

Post by mlampert »

Looks good to me - can you create a pull request?
roivai
Posts: 117
Joined: Thu Feb 02, 2017 5:29 pm
Location: Oulu, Finland

Re: Paths inside PathCompound fail to compute.

Post by roivai »

I just did. Let's hope I did it right, first time using github for that. :)
Post Reply