Profile cut direction reverses with extra offset != 0 and compensation off

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!
Post Reply
User avatar
rmu
Posts: 61
Joined: Wed Aug 02, 2017 6:09 am

Profile cut direction reverses with extra offset != 0 and compensation off

Post by rmu »

Subject says it all, the cut direction reverses if

* compensation is turned off
* any extra offset different from 0 is specified

a similar problem seems to habe been mentioned here
https://forum.freecadweb.org/viewtopic. ... 10#p426969

Code: Select all

OS: KDE neon 5.26 (KDE/plasmawayland)
Word size of FreeCAD: 64-bit
Version: 0.20.2.29603 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0.20.2)
Hash: 930dd9a76203a3260b1e6256c70c1c3cad8c5cb8
Python 3.10.8, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: German/Austria (de_AT)
Attachments
profilecutdirection.FCStd
(25.52 KiB) Downloaded 32 times
User avatar
rmu
Posts: 61
Joined: Wed Aug 02, 2017 6:09 am

Re: Profile cut direction reverses with extra offset != 0 and compensation off

Post by rmu »

If somebody can reproduce this and confirm this is indeed not the intended behaviour I will try and fix it. Thanks.

The discrepancy of reversed path with the "CW/CCW" setting messes up the LeadIn/LeadOut dressup and possibly other stuff too.
User avatar
rmu
Posts: 61
Joined: Wed Aug 02, 2017 6:09 am

Re: Profile cut direction reverses with extra offset != 0 and compensation off

Post by rmu »

I'm pretty sure this https://github.com/FreeCAD/FreeCAD/blob ... le.py#L355 is the offending location, but I'm unsure of the rationale why it is reversing cut direction if compensation is off. Seems this is done deliberately, and with extra offset = 0, cut direction is as expected. git annotate doesn't help much, as the code traces back to a commit of the whole file.

Code: Select all

        if not obj.UseComp and obj.OffsetExtra.Value == 0.0:
             if direction == "CCW":
                params["orientation"] = 1
            else:
                params["orientation"] = 0       
leads to expected (at least to me) behaviour in my simple test case, but I don't understand why this is necessary.
User avatar
rmu
Posts: 61
Joined: Wed Aug 02, 2017 6:09 am

Re: Profile cut direction reverses with extra offset != 0 and compensation off

Post by rmu »

It took a while, but I prepared a PR and (rudimentary) unit tests for Path Profile.
Post Reply