[0.17] Holding tags issues

Here's the place for discussion related to CAM/CNC and the development of the Path module.
m0n5t3r
Posts: 15
Joined: Fri Feb 03, 2017 2:55 pm

[0.17] Holding tags issues

Postby m0n5t3r » Mon Apr 17, 2017 6:13 pm

I'm trying to make the holding tags work with the new tool controllers, and I'm close, I think: the way it's done in master currently leads to an AttributeError when trying to export the gcode; with https://github.com/m0n5t3r/FreeCAD/comm ... 533e806031 it generates gcode, but drops F (feed) parameters for some reason (gcode from the base contour object has F parameters, gcode from added dogbone dressup has F parameters, after adding holding tags dressup F parameters disappear from the output).

Can someone more familiar with the internals tell me where I should look to find out what's wrong?

OS: Ubuntu 16.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10802 (Git)
Build type: None
Branch: master
Hash: 10ce910c03347a90712327a7cc7be2bcdee13afc
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
mlampert
Posts: 292
Joined: Fri Sep 16, 2016 9:28 pm

Re: [0.17] Holding tags issues

Postby mlampert » Tue Apr 18, 2017 5:51 pm

The discussion in https://forum.freecadweb.org/viewtopic.php?f=15&t=20439 might shed some light into it. There are 2 options as I see it:
1) you can add the feedrate back into each Command from the active tool controller
2) you can add a command that sets the feedrate, and fix the post processor to output

My preference would be 2) but 1) is probably easier to accomplish (look at PathGeom.cmdsForEdge).
m0n5t3r
Posts: 15
Joined: Fri Feb 03, 2017 2:55 pm

Re: [0.17] Holding tags issues

Postby m0n5t3r » Tue Apr 18, 2017 6:57 pm

mlampert wrote:The discussion in https://forum.freecadweb.org/viewtopic.php?f=15&t=20439 might shed some light into it. There are 2 options as I see it:
1) you can add the feedrate back into each Command from the active tool controller
2) you can add a command that sets the feedrate, and fix the post processor to output

My preference would be 2) but 1) is probably easier to accomplish (look at PathGeom.cmdsForEdge).


it looks like both need going through all commands and seeing what changed, because the base commands only list the changed dimension (so it's easy to select the feed rate), while PathGeom.cmdsForEdge returns commands with all dimensions set, so I can't really add a feed rate at the beginning and be done with it (X/Y feed rates are different from the Z feed rate), so I'll go for 1.

However, this fixes a different issue from the tool controller thing; I haven't figured out the way things work in here yet, my OCD says I should submit a PR with the tool controller fix and another one for the feed rate fix. (incidentally, this is why I'm not asking why every command implements what looks like an interface in slightly different ways and why they don't inherit from a set of base classes that define the common boilerplate - I don't want to get banned yet :P)
m0n5t3r
Posts: 15
Joined: Fri Feb 03, 2017 2:55 pm

Re: [0.17] Holding tags issues

Postby m0n5t3r » Wed Apr 19, 2017 4:49 pm

mkay, works: https://github.com/m0n5t3r/FreeCAD/comm ... c9b8d0afa7

I'll submit a pull request after https://github.com/FreeCAD/FreeCAD/pull/699 gets merged

Another annoyance would be the base object falling out of the job when I delete the dressup, but that can be worked around (undo instead of delete); I'd have to find whatever is supposed to put the thing back inside the job, but that's for another procrastination session :)
mlampert
Posts: 292
Joined: Fri Sep 16, 2016 9:28 pm

Re: [0.17] Holding tags issues

Postby mlampert » Wed Apr 19, 2017 5:32 pm



Looks good to me, if you wanted you can use the constants PathGeom.CmdMoveXxxx instead.