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

Encoding tiles symmetry and rotation #14

Open
Garazbolg opened this issue Apr 25, 2022 · 0 comments
Open

Encoding tiles symmetry and rotation #14

Garazbolg opened this issue Apr 25, 2022 · 0 comments

Comments

@Garazbolg
Copy link

The base implementation notes that you can "Augment pattern data with rotations and reflections."
I don't think you need reflections for the circuit problem but you might run into it with more complex setup.

Let's assume you don't need reflections.
For rotations you need to have 4 letters that indicate the orientation of the piece.

For this issue let's call them :

  • S -> straight
  • L -> rotated 90° to the left
  • F -> "flipped" but really it's rotated 180°
  • R -> rotated 90° to the right

So this tile :
4

would have edges 4S, 2, 4S, 0

And this one :
5

would have : 4S, 1, 1, 4R

Now the complicated bit is that you have to account for that whenever you are rotating a piece.
For a Left (90°) rotation :

  • every S becomes L
  • every L becomes F
  • every F becomes R
  • every R becomes S

This also fixes the problem of having 5.png left edge connecting to a 4S the wrong way because it will never be a 4S AND a top facing edge at the same time.

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

No branches or pull requests

1 participant