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

octoprint_compat: add webcam_rotation parameter #593

Closed
wants to merge 2 commits into from

Conversation

zanhecht
Copy link

octoprint_compat: add webcam_rotation parameter
docs: document webcam_rotation parameter in configuration.md

Add webcam_rotation parameter to the [octoprint_compat] settings to allow specifying a rotation in degrees (0, 90, 180, 270) to match the [webcam] rotation parameter. Since a horizontal flip and a vertical flip combined are equivalent to a 180-degree rotation, this is implemented by setting flipH and flipV to true for a 180 degree rotation and setting those parameter plus rotate90 to true for a 270-degree rotation.

Re-submission of #592 in line with the contributing guidelines.

Signed-off-by: Zan Hecht [email protected]

octoprint_compat: add webcam_rotation parameter

Add `webcam_rotation` parameter to the `[octoprint_compat]` settings to allow specifying a rotation in degrees (0, 90, 180, 270) to match the `[webcam]` `rotation` parameter. Since a horizontal flip and a vertical flip combined are equivalent to a 180-degree rotation, this is implemented by setting `flipH` and `flipV` to true for a 180 degree rotation and setting those parameter plus `rotate90` to true for a 270-degree rotation.

Signed-off-by: Zan Hecht <[email protected]>
docs: document webcam_rotation parameter in configuration.md

Modify configuration.md to document the `webcam_rotation` parameter in the `[octoprint_compat]` section, which allows specifying a rotation in degrees (0, 90, 180, 270) to match the `[webcam]` `rotation` parameter.

Signed-off-by: Zan Hecht <[email protected]>
@zanhecht zanhecht marked this pull request as ready for review January 21, 2023 14:40
@Arksine
Copy link
Owner

Arksine commented Jan 27, 2023

Hi. As per the discussion in the last PR, I don't think its a good idea to add this option. I understand that a 180 degree rotation is effectively a combination of a vertical and horizontal flip, but I'm not convinced that it is immediately apparent to users the since flip options rotate the image along different axes. I realize that the goal of this PR it to simplify configuration in some instances and provide an option similar to that in the [webcam] module, however in my experience introducing "alternate" configuration options tends to create more confusion, ie: "Which one do I use?"

Typically attempts to improve configuration involve deprecating old options. I considered this for octoprint_compat by replacing the "webcam" options with a webcam_name option similar to that in the [simplyprint] module. Ultimately I decided against this for two reasons:

  1. I did not want to force existing users to reconfigure their [octoprint_compat] module.
  2. I view the [octoprint_compat] module itself is a "necessary evil" to enable some level of compatibility with slicers. I would prefer not to maintain a compatibility layer with Octoprint's REST API, and my hope is that eventually slicers will implement extensions that use Moonraker's native APIs.. Unfortunately the existence of the compatibility module itself discourages this, thus it is my view that further changes to this module should be limited to essential changes (ie: bugfixes).

@Arksine
Copy link
Owner

Arksine commented Sep 6, 2024

As discussion seems to have concluded on this PR, I am closing it. Thanks.

@Arksine Arksine closed this Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants