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: Wed Sep 05, 2018 6:13 amping
I get a build failure with VS2015/PY3/QT5/pybind11

Code: Select all

Error	C1083	Cannot open include file: 'unistd.h': No such file or directory	area-native	C:\Users\Chris\GitHub\kreso-t\src\Mod\Path\libarea\Adaptive.cpp	7	
"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 »

sgrogan wrote: Thu Sep 06, 2018 1:40 am
kreso-t wrote: Wed Sep 05, 2018 6:13 amping
I get a build failure with VS2015/PY3/QT5/pybind11

Code: Select all

Error	C1083	Cannot open include file: 'unistd.h': No such file or directory	area-native	C:\Users\Chris\GitHub\kreso-t\src\Mod\Path\libarea\Adaptive.cpp	7	
Hi,

It should be ok now, I removed this include.

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

Re: Adaptive Path/CAM Operation

Post by kreso-t »

kreso-t wrote: Wed Sep 05, 2018 6:13 am
dubstar-04 wrote: Tue Sep 04, 2018 9:38 pm Not sure if you have spotted this but rapids are done where there is stock, i.e the tool moves inwards to rapid when cutting from outside in. :

rapidInStock.png
Hi Dan,

Thanks for pointing that out, did not notice it until now (so far I ran only simulations for inside-out). I will fix that.

BR,
K.
This should be OK now.

BR,
K.
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: Thu Sep 06, 2018 5:36 am It should be ok now, I removed this include.
Thanks, Updated Win build: https://github.com/sgrogan/FreeCAD/releases/tag/kreso-t
"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 »

Hi,

From my side I consider it ready for PR now.
If you find some more issues pls. let me know.

Btw. these recent versions supporting outside-in approach have a few features/options that may not be instantly obvious, so I will add a description here.
Let say we want to clear that slot in the middle of the model on the next image.
First option is that you select the faces or edges that form a shape and choose the cut region Outside, it will clear everything but the selection while also overshooting the boundary of the stock (unless you check force inside-out):
FreeCAD 0.18_038.png
FreeCAD 0.18_038.png (221.52 KiB) Viewed 1460 times
Next option is to select the slot face and choose the Cut region: "inside", here it will not go from outside-in and will not overshoot the stock boundary (as with cut region="inside" tool is always constrained inside the selected geometry - that orange rectangle is not important here, it is for next example)
FreeCAD 0.18_035.png
FreeCAD 0.18_035.png (187.77 KiB) Viewed 1460 times
and if I add that rectangle to the selection (it must be touching some edge of the face geometry or completely containing it) it will overshoot the stock boundary (as rectangle is crossing outside the stock) and depending on the option "Force clearing Inside-out" will either start from inside or outside:
FreeCAD 0.18_036.png
FreeCAD 0.18_036.png (185.89 KiB) Viewed 1460 times
FreeCAD 0.18_034.png
FreeCAD 0.18_034.png (224.39 KiB) Viewed 1460 times
Edit: so with Cut region: "Inside" you need to add to selection the shapes crossing outside the stock boundary if you want to overshoot it (rectangle in this example was added using Draft WB)

Also there is this "keep tool down ratio" setting added. It controls how long the keep-tool-down linking path can be compared to direct distance between the points. If keep-tool-down-path length divided by direct distance is larger than this number it will raise the tool and make direct link rather than following the keep tool down path (as in some cases it may happen it has to go all around the model to get to the point that is just on the other side of some thin but not yet cleared wall, in such cases it's more efficient to raise the tool and get to other side at clearance height), i.e.:
Selection_040.png
Selection_040.png (88.14 KiB) Viewed 1457 times
Last edited by kreso-t on Sun Sep 09, 2018 8:59 am, edited 1 time in total.
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: Sat Sep 08, 2018 9:23 am From my side I consider it ready for PR now.
If you find some more issues pls. let me know.
I say go for it!
Thanks @kreso-t for the attention to the OS/build-option issues, it's much appreciated.
Thanks also to @dubstar-04, strong testing like this, from a knowledgeable user, leads to a better feature.

EDIT: also thanks to @mlampert
Also, I created a PR against your repo to incorporate the changes necessary for the latest master (I broke your integration with the changes for the op default values).
That's pretty cool teamwork.
"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 »

sgrogan wrote: Sat Sep 08, 2018 5:13 pm ..
Thanks also to @dubstar-04, strong testing like this, from a knowledgeable user, leads to a better feature.

EDIT: also thanks to @mlampert
Also, I created a PR against your repo to incorporate the changes necessary for the latest master (I broke your integration with the changes for the op default values).
That's pretty cool teamwork.
+1

Thanks also to you @sgrogan, for providing the build packages and making sure that code builds on different OS/enviroments

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

Re: Adaptive Path/CAM Operation

Post by kreso-t »

mlampert wrote: Tue Sep 04, 2018 1:54 am Late to the party - and I agree with all the ppl who encourage you to make a PR, this would make an awesome addition to Path and from my limited testing I think it's ready. I built and installed your op for the first time today and played with it, this is really good stuff. My models are certainly not the most complicated ones, but I haven't found any issues at all.

Also, I created a PR against your repo to incorporate the changes necessary for the latest master (I broke your integration with the changes for the op default values).

Let me know if you need any help integrating with the FC build system or prepping a PR - although - looking at your code I highly doubt you're gonna need any help.
I submitted the PR to FreeCAD master. The adaptive operation is added as experimental feature.
As this is my first ever Pull Request using GitHub :) , pls. let me know if I should do something differently (I can cancel/close it and make a new one).

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

Re: Adaptive Path/CAM Operation

Post by kreso-t »

sliptonic wrote: Wed Sep 05, 2018 1:03 pm
dubstar-04 wrote: Next week I would like to run a part on my machine and see how it goes!
Please please record a video!
+1

I would also very much like to see how that looks on your machine.

BR,
K.
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: Adaptive Path/CAM Operation

Post by mlampert »

kreso-t wrote: Sun Sep 09, 2018 8:31 am I submitted the PR to FreeCAD master. The adaptive operation is added as experimental feature.
As this is my first ever Pull Request using GitHub :) , pls. let me know if I should do something differently (I can cancel/close it and make a new one).
I looked at your PR and as expected you did a great job. The only recommendation I would have going forward is shooting for more expressive commit messages. It is quite unlikely that your PR gets invalidated since your code is new. But maybe check every now and then if your branch is still up to date, if not pressing the "Update branch" usually does the merge for you. Other than that, address review comments if there are any and once the maintainers are satisfied (and have some time) they will merge the branch and we all get to use your op :D

Thanks, this is really great!
Post Reply