Git Product home page Git Product logo

Comments (8)

chriskkkkl avatar chriskkkkl commented on April 28, 2024 3

Here is a solution:
(1)Add the following lines to the list of symmetry operations/functions.
else if (sym == 'F')
{
cardinality = 8;
a = i => i < 4 ? (i + 1) % 4 : 4 + (i - 1) % 4;
b = i => i < 4 ? i + 4 : i - 4;
}

(2) Add reflection function after line 47 ("Color[] rotate(Color[] array) => tile((x, y) => array[tilesize - 1 - y + x * tilesize]);"):
Color[] reflect(Color[] array) => tile((x, y) => array[tilesize - 1 - x + y * tilesize]);

(3) Change 135-136 ("tiles.Add(rotate(tiles[T + t - 1])); tilenames.Add($"{tilename} {t}");") as:
if (t < 4) tiles.Add(rotate(tiles[T + t - 1]));
if (t > 3) tiles.Add(reflect(tiles[T + t - 4]));
tilenames.Add($"{tilename} {t}");

from wavefunctioncollapse.

kjav avatar kjav commented on April 28, 2024

Here are some of the tiles that it is meant to connect to:

Tile images (click to view)

bend
cross
diagonal
diagonalbend
diagonalcap
diagonalfork
diagonalhairpin
empty
straight
t

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

Hi! You're right, there is indeed no option for a tile with no symmetry. I'll patch this up eventually, but I'm not sure when, it requires more than just adding else if (sym == 'J') { cardinality = 8; ...; }. I'm releasing a new version of WFC soon (as part of a larger project) with a different symmetry system that doesn't have this problem, because it induces the symmetry type from a low-pixel "scheme" of a tile.

from wavefunctioncollapse.

kjav avatar kjav commented on April 28, 2024

Hi mxgmn,

Thanks for your reply - I'm glad I understood the problem correctly! Could you explain why adding a "cardinality = 8" option would not fully solve the problem? For instance, adding the following symmetry option does not solve the problem but I do not understand why:

cardinality = 8;
a = i => 0;
b = i => 0;

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

Because it currently assumes that all symmetries of the tile could be reached by rotating the base tile (which is not true for your example). And by setting i => 0 you are actually describing a maximally symmetric case. The right a action would look more like i => (i + 1) % 8.

from wavefunctioncollapse.

shviller avatar shviller commented on April 28, 2024

I'm late to the party, but oh well, at least for posterity: the already mentioned fast-wfc has a symmetry="P" option, and additional indices for flipped+rotated tiles (4 for horizontally mirrored tile, for example)

from wavefunctioncollapse.

zzz6519003 avatar zzz6519003 commented on April 28, 2024

how is this related to chaos theory? & hope for the demo!

from wavefunctioncollapse.

mxgmn avatar mxgmn commented on April 28, 2024

I tested @chriskkkkl's solution on the new tileset, it works.

from wavefunctioncollapse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.