Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CAM: fixed A, B, and C axis handling; added relevant tests #18103

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

LarryWoestman
Copy link
Contributor

The refactored* postprocessors treated the rotary axis parameters (A, B, & C) the same as the linear axis parameters (X, Y, & Z). In particular, rotary axis parameter values (which should always be in degrees) are converted "from mm to inches" when the "--inches" argument is passed to the postprocessors. No conversion is necessary or desired.

This PR fixes the code so that the rotary axis parameters are not converted when the "--inches" argument is passed to the refactored* postprocessors.

A few of the existing tests needed to be fixed and more tests were added to check the rotary axis parameters under more circumstances.

This PR will fix issue #18101.

"G1 X10 Y20 Z30 A-440 B-450 C-460",
"G1 X0.3937 Y0.7874 Z1.1811 A-440.0000 B-450.0000 C-460.0000",
"--inches",
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 44 tests are nearly identical. To reduce future maintenance effort I suggest to consolidate them into a single, or perhaps three (normalized, negative and multi-turn angles), tests.

To still keep the coverage up, and to avoid the act-assert-act-assert-act-assert anti-pattern, you could leverage a local function with a sub-test to get parametrizable tests. See here for an example.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback and the example. I agree and will rewrite the tests to make them more maintainable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rewritten tests are now ready for review and/or pulling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mod: CAM Related to the CAM/Path Workbench
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CAM: refactored* postprocessors do not handle rotary axis parameters correctly
2 participants