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

Idea: New way to encode shapes? #36

Closed
CallMeHein opened this issue Jul 28, 2023 · 1 comment
Closed

Idea: New way to encode shapes? #36

CallMeHein opened this issue Jul 28, 2023 · 1 comment

Comments

@CallMeHein
Copy link

Encoding shape by "flattening" all three dimensions

The goal is to encode shapes by having a sort of "map" that tells you how many blocks are at a certain coordinate in a certain dimension.

An example will hopefully make it clearer:

Imagine the well-known T-Piece (4 Cubes) in a specific orientation, and the "Views" from each dimension:

Base

base

Top view

top

Side view

side

Front view

front

Note the numbers i have added to the images, these denote how many cubes are behind the one face that is visible when viewing from the indicated side.

These are the essence of my proposal, so the T-Piece could be represented by the following Matrices

[1 2 1]


[0 1 0]
[1 1 1]


[1]
[3]

As far as I can tell, these three arrays will describe any orientation of the T-Piece when viewed from the correct side and you won't have to check all possible 24 rotations to compare two polycubes.


Now for my questions:

Is this feasible to implement? Will this even be more efficient than what is done right now?

Please ask any questions you might have, I'm willing to concede if turns out to be a bad idea

Representations for n=1 to n=4

n=1

Just a 1x1x1 cube
[1]
[1]
[1]

n=2

1x1x2
[1 1]
[1 1]
[2]

n=3

Corner Long
[1 1] [0 1] [1 1 1]
[2 1] [1 1 1]
[1 2] [3]

n=4

Square L Long Z T Corner/Pyramid "Twisted Z" (the one that can be reflected)
[1 1]
[1 1]
[1 1 1]
[0 0 1]
[1 1 1 1] [1 1 0]
[0 1 1]
[0 1 0]
[1 1 1]
[1 2]
[0 1]
[2 1]
[0 1]
[2 2] [3 1] [1 1 1 1] [2 2] [3 1] [1 0]
[2 1]
[1 0]
[2 1]
[2 2] [1 1 2] [4] [1 2 1] [1 2 1] [0 1]
[1 2]
[1 0]
[1 2]

This should prove that each unique shape has three arrays which make a unique set to describe that shape, at least for n <= 4, hopefully for other n as well.

@CallMeHein
Copy link
Author

Update: I have tried an implementation, but it breaks for n >= 6. Maybe someone else can work with this

@CallMeHein CallMeHein closed this as not planned Won't fix, can't repro, duplicate, stale Sep 30, 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

No branches or pull requests

1 participant