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!
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: Adaptive Path/CAM Operation

Post by mlampert »

chrisb wrote: Fri Jan 04, 2019 10:15 pm Even if I recompute only the AdaptivePath the issue is toggled. It seems that not only the values of AdaptiveInputState and AdaptiveOutputState change, but also Placements of Z-axis, XZ plane.
I looked at the XY values, and it seems they are all over the place - suggesting that there might be a division by a very small value. Just a theory/hunch though.
schnebeck
Posts: 130
Joined: Thu Jun 22, 2017 8:04 pm

Re: Adaptive Path/CAM Operation

Post by schnebeck »

If I recompute Adaptive-OP in ChrisBs test file the result looks fine.
Screenshot_20190104_233036.png
Screenshot_20190104_233036.png (13.71 KiB) Viewed 1740 times
HTH

Thorsten

OS: Ubuntu 18.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15521 (Git)
Build type: Release
Branch: master
Hash: 6cdeab9c1469a41f24ae5e8fa9091c9bdfbb90db
Python version: 2.7.15rc1
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
chrisb
Veteran
Posts: 54201
Joined: Tue Mar 17, 2015 9:14 am

Re: Adaptive Path/CAM Operation

Post by chrisb »

I wonder where it comes from. I tested on a Ubuntu installed on a virtual machine on my Mac. Outside the virtual machine I get the error, inside it is OK; so it's not a processor thing.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
jurij
Posts: 22
Joined: Tue Oct 23, 2018 11:37 am

Re: Adaptive Path/CAM Operation

Post by jurij »

Hi,

This is what I get with the cube model:

adaptive_cb.png
adaptive_cb.png (31.5 KiB) Viewed 1654 times

OS: Linux
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15536 (Git) AppImage
Build type: Release
Branch: master
Hash: 98ebeaa198df945ba666c15912c6caf95920f0ef
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedKingdom (en_GB)
chrisb
Veteran
Posts: 54201
Joined: Tue Mar 17, 2015 9:14 am

Re: Adaptive Path/CAM Operation

Post by chrisb »

The error seems to come out of libarea.

Code: Select all

            a2d = area.Adaptive2d()
            a2d.stepOverFactor = 0.01*obj.StepOver
            a2d.toolDiameter = float(op.tool.Diameter)
            a2d.helixRampDiameter =  helixDiameter
            a2d.keepToolDownDistRatio = keepToolDownRatio
            a2d.stockToLeave =float(obj.StockToLeave)
            a2d.tolerance = float(obj.Tolerance)
            a2d.forceInsideOut = obj.ForceInsideOut
            a2d.opType = opType
            #EXECUTE
            results = a2d.Execute(stockPath2d,path2d,progressFn)
Values going in a2d.Execute look good
One of result in results has the wrong values in result.AdaptivePaths
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
kreso-t
Posts: 115
Joined: Sat Aug 04, 2018 2:32 pm

Re: Adaptive Path/CAM Operation

Post by kreso-t »

chrisb wrote: Tue Jan 08, 2019 12:53 am The error seems to come out of libarea.

Code: Select all

            a2d = area.Adaptive2d()
            a2d.stepOverFactor = 0.01*obj.StepOver
            a2d.toolDiameter = float(op.tool.Diameter)
            a2d.helixRampDiameter =  helixDiameter
            a2d.keepToolDownDistRatio = keepToolDownRatio
            a2d.stockToLeave =float(obj.StockToLeave)
            a2d.tolerance = float(obj.Tolerance)
            a2d.forceInsideOut = obj.ForceInsideOut
            a2d.opType = opType
            #EXECUTE
            results = a2d.Execute(stockPath2d,path2d,progressFn)
Values going in a2d.Execute look good
One of result in results has the wrong values in result.AdaptivePaths
So the problem seem to be in the C++ code. As it does not seem to reproduce on Linux and Windows I am suspecting there is some difference in C++ compiler behaviour or STL implementation on Mac OS X environment. I don't have access to Mac (and also I don't have much experience with it) so it is difficult for me to find the cause of the problem. I can maybe try to borrow Mac for a few days but need to know first how to setup FreeCAD build environment on OS X. Do you know if there is some up to date tutorial about that?

Thx,
BR,
K.
Syres
Veteran
Posts: 2900
Joined: Thu Aug 09, 2018 11:14 am

Re: Adaptive Path/CAM Operation

Post by Syres »

kreso-t wrote: Sat Jan 12, 2019 11:38 am
So the problem seem to be in the C++ code. As it does not seem to reproduce on Linux and Windows
Sorry, I don't concur with the Windows platform being OK. If I load Chris' file running :

OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15611 (Git)
Build type: Release
Branch: master
Hash: 64a94ae0f7c60fc981086fe157150a9c0dca29c6
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedKingdom (en_GB)

I have the same fault. I just backspace the zero and one figures in the Tolerance field and re-enter them which produces the correct result.
Syres
Veteran
Posts: 2900
Joined: Thu Aug 09, 2018 11:14 am

Re: Adaptive Path/CAM Operation

Post by Syres »

Apologies, ignore the above post, I realise it's OK after saving the corrected file on a Windows box but Chris always gets the fault even after re-saving on the Mac.
chrisb
Veteran
Posts: 54201
Joined: Tue Mar 17, 2015 9:14 am

Re: Adaptive Path/CAM Operation

Post by chrisb »

It's not a question of loading. Load the document an mark AdaptivePath (or the whole document) for recompute. After a recompute the problem vanishes on most computers.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 54201
Joined: Tue Mar 17, 2015 9:14 am

Re: Adaptive Path/CAM Operation

Post by chrisb »

kreso-t wrote: Sat Jan 12, 2019 11:38 am So the problem seem to be in the C++ code. As it does not seem to reproduce on Linux and Windows
mlampert had the same issue on Linux: https://forum.freecadweb.org/viewtopic. ... 10#p277776
I don't have access to Mac (and also I don't have much experience with it) so it is difficult for me to find the cause of the problem. I can maybe try to borrow Mac for a few days but need to know first how to setup FreeCAD build environment on OS X.
The MacOS build process seems to be out of whack anyway. That's why we don't get regularly updates for MacOS .

I will send a MacMini to user looo, so he can work on it. Perhaps he can send the MacMini to you once he is finished. Where do you live?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply