Adaptive Clearing - apparent bug

Here's the place for discussion related to CAM/CNC and the development of the Path module.
MakerFix
Posts: 6
Joined: Sat Jan 25, 2020 5:11 pm

Adaptive Clearing - apparent bug

Postby MakerFix » Sat Jan 25, 2020 6:06 pm

Hello,

First off, thank you to all who have contributed to FreeCAD, it is a great program and getting better on a regular basis.

I recently started using FreeCAD to generate gcode for my CNC router and I think I've found a bug in the adaptive clearing and profiling functionality.
I created a simple puzzle shape and when I generate an adaptive clearing path on the inside of the shape I get a small glitch in the path where the path goes outside the shape. As part of trying to get a better handle on what was going wrong I noticed that if I switch the operation to profiling instead of clearing there's a gap in the profile in the same location as the glitch when clearing.

When I switch the operation to the outside of the object, either clearing or profiling, it appears to run correctly.

I searched the forum and the bug tracker and I don't think this has been reported yet. My apologies if it already has and I missed seeing it.

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.19358 (Git)
Build type: Release
Branch: master
Hash: 9e736095187450812e16ff9b92b6839e578f5506
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Canada (en_CA)

Here are some screenshots of what I'm seeing.
adaptive_clearing_glitch.png
Overview of part/job.
adaptive_clearing_glitch.png (238.36 KiB) Viewed 365 times
adaptive_clearing_glitch_closeup.png
Closeup for clearing glitch
adaptive_clearing_glitch_closeup.png (568.15 KiB) Viewed 365 times
adaptive_profile_equivalent_glitch.png
Equivalent profiling glitch
adaptive_profile_equivalent_glitch.png (234.37 KiB) Viewed 365 times
The example file that contains the bug is too big to attach directly. HERE is a link to a copy on Google Drive.
User avatar
sliptonic
Posts: 1679
Joined: Tue Oct 25, 2011 10:46 pm

Re: Adaptive Clearing - apparent bug

Postby sliptonic » Sat Jan 25, 2020 7:29 pm

I'm wondering if this isn't another example of spline problems. We've seen a few of them lately.
Realthunder has a PR pending that changes the discretization method. You could try building with that PR and see if you get the same results.

https://github.com/FreeCAD/FreeCAD/pull/2928
MakerFix
Posts: 6
Joined: Sat Jan 25, 2020 5:11 pm

Re: Adaptive Clearing - apparent bug

Postby MakerFix » Sat Jan 25, 2020 10:14 pm

Hi sliptonic,

Currently I'm not setup to build on Windows however I can see that being a useful capability.

Realthunder's pull-request may very well end up in FreeCAD master before I get properly setup. Regardless I'll keep an eye on it and - whichever way I get around to testing it - I'll see if it fixes the glitch I'm seeing.

BTW, your YouTube videos on FreeCAD's Path workbench were a big help in getting me started, thanks for those. Much appreciated.
MakerFix
Posts: 6
Joined: Sat Jan 25, 2020 5:11 pm

Re: Adaptive Clearing - apparent bug

Postby MakerFix » Mon Jan 27, 2020 1:12 am

I just now got a chance to test the following release of FreeCAD...

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.19373 (Git)
Build type: Release
Branch: master
Hash: c47512b7b2b3b64b4a21a86ad34a565459a13e6a
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Canada (en_CA)

...which has the above mentioned pull-request and the incorrect path generation is still present. To test I used the same test file as linked above, deleted the adaptive operation, and regenerated it.
MakerFix
Posts: 6
Joined: Sat Jan 25, 2020 5:11 pm

Re: Adaptive Clearing - apparent bug

Postby MakerFix » Tue Feb 18, 2020 1:00 am

So here's what could be an interesting piece of additional information.

When you take the example file provided and change the step over percent to 19 the bug goes away and you get what appears to be the proper paths. Also 19% step over is the ONLY value it works for. Once I accidentally realized it worked for 19% I tried all the others from 15% to 75% to see what would happen. In all those cases the bug remains.
Attachments
adaptive_clearing_glitch_closeup_19_percent.png
adaptive_clearing_glitch_closeup_19_percent.png (450.5 KiB) Viewed 109 times