Adaptive Path/CAM Operation

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!
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Adaptive Path/CAM Operation

Post by sgrogan »

kreso-t wrote: Tue Aug 28, 2018 2:35 pm I can try and fix those things in my branch, however as they are not in any way related to adaptive feature, not sure if I should proceed with that or there are plans to fix that in the FreeCAD master?
Our ability to provide PY3 builds is recent, so, until now only those that could compile w/PY3 themselves have had the ability to test.
I would suggest to fix it in a separate pull request from your main work.
"fight the good fight"
kreso-t
Posts: 115
Joined: Sat Aug 04, 2018 2:32 pm

Re: Adaptive Path/CAM Operation

Post by kreso-t »

dubstar-04 wrote: Mon Aug 27, 2018 7:26 pm
Is there anything that can be done about the 'linking moves' where the tool rises between sections?

Peek 2018-08-27 20-25.gif
Hi Dan,

I tried this with your model and I can't seem to actually reproduce the issue I thought you are having - in all cases I checked it actually raises the tool to avoid cutting into regions that are not yet cleared when re-positioning to another section - which is behavior by design. From this angle I can not tell for sure if this is also the case in your simulation. However this design has potential for improvement and I have an idea how to optimize the linking moves in such cases as shown in your simulation (i.e. when that region passed over by linking move should eventually be cleared so it could try to do straight cut through it if that cut is not violating optimal step-over and also not cutting out of the boundaries of the base geometry) but it is a bit more complex addition, will need some more time for this.

BR,
Kreso
User avatar
dubstar-04
Posts: 698
Joined: Mon Mar 04, 2013 8:41 pm
Location: Chester, UK
Contact:

Re: Adaptive Path/CAM Operation

Post by dubstar-04 »

kreso-t wrote: Tue Aug 28, 2018 3:42 pm
dubstar-04 wrote: Mon Aug 27, 2018 7:26 pm
Is there anything that can be done about the 'linking moves' where the tool rises between sections?

Peek 2018-08-27 20-25.gif
Hi Dan,

I tried this with your model and I can't seem to actually reproduce the issue I thought you are having - in all cases I checked it actually raises the tool to avoid cutting into regions that are not yet cleared when re-positioning to another section - which is behavior by design. From this angle I can not tell for sure if this is also the case in your simulation. However this design has potential for improvement and I have an idea how to optimize the linking moves in such cases as shown in your simulation (i.e. when that region passed over by linking move should eventually be cleared so it could try to do straight cut through it if that cut is not violating optimal step-over and also not cutting out of the boundaries of the base geometry) but it is a bit more complex addition, will need some more time for this.

BR,
Kreso
Thats good news. Thank you for taking the time to check.

I was showing the adaptive tool path to someone today and they couldn't believe it was included in FreeCAD!!

Thank you for all your effort.
kreso-t
Posts: 115
Joined: Sat Aug 04, 2018 2:32 pm

Re: Adaptive Path/CAM Operation

Post by kreso-t »

dubstar-04 wrote: Tue Aug 28, 2018 7:46 pm
kreso-t wrote: Tue Aug 28, 2018 3:42 pm
dubstar-04 wrote: Mon Aug 27, 2018 7:26 pm
Is there anything that can be done about the 'linking moves' where the tool rises between sections?

Peek 2018-08-27 20-25.gif
Hi Dan,

I tried this with your model and I can't seem to actually reproduce the issue I thought you are having - in all cases I checked it actually raises the tool to avoid cutting into regions that are not yet cleared when re-positioning to another section - which is behavior by design. From this angle I can not tell for sure if this is also the case in your simulation. However this design has potential for improvement and I have an idea how to optimize the linking moves in such cases as shown in your simulation (i.e. when that region passed over by linking move should eventually be cleared so it could try to do straight cut through it if that cut is not violating optimal step-over and also not cutting out of the boundaries of the base geometry) but it is a bit more complex addition, will need some more time for this.

BR,
Kreso
Thats good news. Thank you for taking the time to check.

I was showing the adaptive tool path to someone today and they couldn't believe it was included in FreeCAD!!

Thank you for all your effort.
Hi Dan,
I managed to add some optimizations safely (I think, based on initial tests seems OK) related to those unnecessary "linking moves" (based on that idea in my previous post, wasn't that complicated as I initially thought), now your test model has cca 20% less "linking moves". Also I added the "Stock to Leave" option:
Selection_023.png
Selection_023.png (163.4 KiB) Viewed 1332 times
BR,
Kreso
User avatar
dubstar-04
Posts: 698
Joined: Mon Mar 04, 2013 8:41 pm
Location: Chester, UK
Contact:

Re: Adaptive Path/CAM Operation

Post by dubstar-04 »

kreso-t wrote: Tue Aug 28, 2018 8:50 pm
dubstar-04 wrote: Tue Aug 28, 2018 7:46 pm
kreso-t wrote: Tue Aug 28, 2018 3:42 pm
dubstar-04 wrote: Mon Aug 27, 2018 7:26 pm
Is there anything that can be done about the 'linking moves' where the tool rises between sections?

Peek 2018-08-27 20-25.gif
Hi Dan,

I tried this with your model and I can't seem to actually reproduce the issue I thought you are having - in all cases I checked it actually raises the tool to avoid cutting into regions that are not yet cleared when re-positioning to another section - which is behavior by design. From this angle I can not tell for sure if this is also the case in your simulation. However this design has potential for improvement and I have an idea how to optimize the linking moves in such cases as shown in your simulation (i.e. when that region passed over by linking move should eventually be cleared so it could try to do straight cut through it if that cut is not violating optimal step-over and also not cutting out of the boundaries of the base geometry) but it is a bit more complex addition, will need some more time for this.

BR,
Kreso
Thats good news. Thank you for taking the time to check.

I was showing the adaptive tool path to someone today and they couldn't believe it was included in FreeCAD!!

Thank you for all your effort.
Hi Dan,
I managed to add some optimizations safely (I think, based on initial tests seems OK) related to those unnecessary "linking moves" (based on that idea in my previous post, wasn't that complicated as I initially thought), now your test model has cca 20% less "linking moves". Also I added the "Stock to Leave" option:

Selection_023.png

BR,
Kreso
That's great news!!

I just tried testing and I am getting the following error:

Code: Select all


Traceback (most recent call last):
  File "/home/sandal/FreeCAD/build/Mod/Path/PathScripts/PathUtils.py", line 60, in new_function
    res = function(*args, **kwargs)
  File "/home/sandal/FreeCAD/build/Mod/Path/PathScripts/PathOp.py", line 449, in execute
    result = self.opExecute(obj)
  File "/home/sandal/FreeCAD/build/Mod/Path/PathScripts/PathAdaptive.py", line 409, in opExecute
    Execute(self,obj)
  File "/home/sandal/FreeCAD/build/Mod/Path/PathScripts/PathAdaptive.py", line 318, in Execute
    a2d.stockToLeave = obj.StockToLeave
<class 'Boost.Python.ArgumentError'>: Python argument types in
    None.None(Adaptive2d, Base.Quantity)
did not match C++ signature:
    None(AdaptivePath::Adaptive2d {lvalue}, double)

kreso-t
Posts: 115
Joined: Sat Aug 04, 2018 2:32 pm

Re: Adaptive Path/CAM Operation

Post by kreso-t »

dubstar-04 wrote: Tue Aug 28, 2018 9:09 pm That's great news!!

I just tried testing and I am getting the following error:

Code: Select all


Traceback (most recent call last):
  File "/home/sandal/FreeCAD/build/Mod/Path/PathScripts/PathUtils.py", line 60, in new_function
    res = function(*args, **kwargs)
  File "/home/sandal/FreeCAD/build/Mod/Path/PathScripts/PathOp.py", line 449, in execute
    result = self.opExecute(obj)
  File "/home/sandal/FreeCAD/build/Mod/Path/PathScripts/PathAdaptive.py", line 409, in opExecute
    Execute(self,obj)
  File "/home/sandal/FreeCAD/build/Mod/Path/PathScripts/PathAdaptive.py", line 318, in Execute
    a2d.stockToLeave = obj.StockToLeave
<class 'Boost.Python.ArgumentError'>: Python argument types in
    None.None(Adaptive2d, Base.Quantity)
did not match C++ signature:
    None(AdaptivePath::Adaptive2d {lvalue}, double)

Sorry, my bad, tested it only with PYBIND11 build (and PYBIND is much smarter with converting the types from python to c++ than boost-python).
It's fixed now.
Also not sure if you already did that, but you need to add new adaptive operation, on the existing it will not work as it does not have this StockToLeave parameter stored in the model.

K.
User avatar
dubstar-04
Posts: 698
Joined: Mon Mar 04, 2013 8:41 pm
Location: Chester, UK
Contact:

Re: Adaptive Path/CAM Operation

Post by dubstar-04 »

kreso-t wrote: Tue Aug 28, 2018 9:23 pm
dubstar-04 wrote: Tue Aug 28, 2018 9:09 pm That's great news!!

I just tried testing and I am getting the following error:

Code: Select all


Traceback (most recent call last):
  File "/home/sandal/FreeCAD/build/Mod/Path/PathScripts/PathUtils.py", line 60, in new_function
    res = function(*args, **kwargs)
  File "/home/sandal/FreeCAD/build/Mod/Path/PathScripts/PathOp.py", line 449, in execute
    result = self.opExecute(obj)
  File "/home/sandal/FreeCAD/build/Mod/Path/PathScripts/PathAdaptive.py", line 409, in opExecute
    Execute(self,obj)
  File "/home/sandal/FreeCAD/build/Mod/Path/PathScripts/PathAdaptive.py", line 318, in Execute
    a2d.stockToLeave = obj.StockToLeave
<class 'Boost.Python.ArgumentError'>: Python argument types in
    None.None(Adaptive2d, Base.Quantity)
did not match C++ signature:
    None(AdaptivePath::Adaptive2d {lvalue}, double)

Sorry, my bad, tested it only with PYBIND11 build (and PYBIND is much smarter with converting the types from python to c++ than boost-python).
It's fixed now.
Also not sure if you already did that, but you need to add new adaptive operation, on the existing it will not work as it does not have this StockToLeave parameter stored in the model.

K.

Just incredible!!
AdaptiveSucess.png
AdaptiveSucess.png (189.06 KiB) Viewed 1316 times

Superb work, thank you so much for working on this!!
kreso-t
Posts: 115
Joined: Sat Aug 04, 2018 2:32 pm

Re: Adaptive Path/CAM Operation

Post by kreso-t »

dubstar-04 wrote: Tue Aug 28, 2018 9:40 pm ...
Thx Dan,

I am wondering how useful would it be to have the possibility to define in the adaptive operation (somehow, not sure exactly yet what would be the best way) to start cutting from the outside of the stock material, so that it does not necessarily have to plunge into material if not needed. I.e. if you would have model like the following:
FreeCAD 0.18_024.png
FreeCAD 0.18_024.png (363.38 KiB) Viewed 1285 times
This current inside-out approach seem to have some advantages cause it's maybe less likely for tool to hit clamps/fixtures, but still wondering if there are situations where you would really need to start cutting from outside-in. What do you think? Which do you use more often?

Thx,
K.
cahlfors
Posts: 91
Joined: Tue Jan 24, 2012 8:27 pm
Location: Sweden

Re: Adaptive Path/CAM Operation

Post by cahlfors »

There definitely are. Not all tools are even able to plunge, like a face mill for instance. There is nothing in the center that can cut.

Also of interest here is to have the cutting area overshoot the outer boundaries. Hard to explain, but imagine you were cutting this by hand. Then you would not only start from outside of the stock, you would take a pass and proceed beyond it as well. That way you would leave no artifacts around the perimeter. Staying within the surface of either the stock or part would leave artifacts along the perimeter and especially in the corners as the tool would not cut clear all the way to the edge. Today, we manage this phenomenon by either faking the stock being bigger than it is, or by creating a helper object with a bigger surface. It would be so much easier if the function could handle this by itself.

Looking forward to using this function! Thanks a million for your effort! :D
electrical engineer
Ubuntu or Mint
Mendel 3d-printer/OctoPrint
LinuxCNC
Optimum BF20L mill
User avatar
dubstar-04
Posts: 698
Joined: Mon Mar 04, 2013 8:41 pm
Location: Chester, UK
Contact:

Re: Adaptive Path/CAM Operation

Post by dubstar-04 »

kreso-t wrote: Wed Aug 29, 2018 6:59 pm
dubstar-04 wrote: Tue Aug 28, 2018 9:40 pm ...
Thx Dan,

I am wondering how useful would it be to have the possibility to define in the adaptive operation (somehow, not sure exactly yet what would be the best way) to start cutting from the outside of the stock material, so that it does not necessarily have to plunge into material if not needed. I.e. if you would have model like the following:
FreeCAD 0.18_024.png

This current inside-out approach seem to have some advantages cause it's maybe less likely for tool to hit clamps/fixtures, but still wondering if there are situations where you would really need to start cutting from outside-in. What do you think? Which do you use more often?

Thx,
K.
This would definitely be useful the test part for example:
Screenshot from 2018-08-26 20-13-24.png
Screenshot from 2018-08-26 20-13-24.png (90.32 KiB) Viewed 1270 times
This would benefit from starting machining from outside the stock and working inwards. That is what the HSM adaptive code would do.

Thanks,

Dan
Post Reply