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

Add diagonal symmetry (fix #1171) #4100

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Gasparoken
Copy link
Member

Added symmetry UI buttons, 45 and -45 degrees axis. Now are possible activate all four symmetries, both diagonal symmetries, individual diagonal symmetry, and the old horizontal/vertical combinations.

fix #1171

@Gasparoken Gasparoken self-assigned this Oct 20, 2023
@Gasparoken
Copy link
Member Author

Oct-20-2023 09-22-53

@Gasparoken
Copy link
Member Author

Gasparoken commented Oct 20, 2023

Pending:

  • Image brush bug on 45 degrees reflections.
  • Add constraints on Symmetry buttons (some configurations do not have sense, for example: Horizontal + 45 degree symmetry).
  • Constraint on symmetry axis position origin when 'All' or dual diagonal symmetry is active (x, y have to be the same fractional part).

Orthogonal brush images symmetrization is implemented.

Also added diagonal SymmetryModes and processing, but diagonal symmetry UI buttons are still pending.
Added symmetry UI buttons, 45 and -45 degrees axis.
Now are possible activate all four symmetries, both
diagonal symmetries, individual diagonal symmetry, and
the old horizontal/vertical combinations.
@Gasparoken
Copy link
Member Author

Gasparoken commented Nov 3, 2023

Pending:

  • Need more testing when TileMode is ON.
  • Is CompressedImage still needed?
  • Add constraint to half pixel steps when diagonal are ON (symmetry is not possible in some cases)
  • Define what is done when an image brush is intersected by a symmetry axis.
  • Refactor m_image to a vector of ImageRef elements to support the m_symmetryImages buffer, to do the same with m_maskBitmap
  • Dynamics still has symmetry issues, it may be that the size/angle/gradient varies across the generation of the symmetry strokes.

@Gasparoken
Copy link
Member Author

When you can without rush, could you give me some feedback on this PR @martincapello?

Copy link
Member

@martincapello martincapello left a comment

Choose a reason for hiding this comment

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

I have been testing this for a while and seems that it works great! About the code, the only thing that looked a bit odd to me is having RIGHT_DIAG_REFLEX and LEFT_DIAG_REFLEX as symmetry modes, because the user can only select 4 modes. So I reviewed the code in more detail and saw that this "modes" are actually used to flag the stroke points so they can be properly rendered when the different symmetry combinations are set. Then, might be nice to separate the modes that the user can select from the modes or flags that the stroke points can have, maybe using different enums...just a thought.

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.

Diagonal symmetry
2 participants