roice3 / MagicTile

Non-euclidean Rubik's Cube Analogues
http://www.gravitation3d.com/magictile
MIT License
87 stars 12 forks source link

[Bug???] Leverage edge incidences to populate neighbors #23

Closed nanma80 closed 7 years ago

nanma80 commented 7 years ago

I trace master cells to the underlying tiles, and use the EdgeIncidences to find adjacent tiles, and use completed to map tiles back to cells.

I think I see a bug in edge incidences. I have a workaround but it'll be good to fix the bug.

Some edge incident tiles map to non-neighboring cells. For example, for {7, 3}, master cell 2 (blue) is in the edge incidences field of master cell 23 (teal). My workaround is that I filtered such fake incidences by checking the geometry again. And added an Assert to surface such cases. Because of my filtering, the lights on puzzle is eventually fine. But it'll still be good to debug the edge incidences. I'm not sure if the vertex incidences suffer the same problem.

In {8, 3} and {10, 3} I see the same problem.