As a demo of the half-diagonal masking constraint, let's run this search but with 35 half diagonal width (so one less on each side than the 37 we get from "@zero:12").amling wrote: March 6th, 2025, 4:58 am...you could draw a constraint file with a half diagonal of forced zeros to make a search effectively one thinner...DroneBetter wrote: March 6th, 2025, 1:09 am also, I would appreciate greatly if diagonal width could specify on the granularity of half- instead of full-diagonals in a future version :mrgreen: thank you
First, let's unwind what "@zero:12" does. But before that, let's see the geometry's stats:
Code: Select all
$ rlife grid-tool geom-info c4d-f2b
Geometry: c4d-f2b
U: Vec3(1, -1, 0)
V: Vec3(-1, -1, 4)
W: Vec3(0, 0, 1)
Neighborhood sizes:
U: 3
W: 9
Unique positions (2):
#0: Vec3(0, 0, 0) => Vec3Uvw(0, 0, 0)
#1: Vec3(0, -1, 2) => Vec3Uvw(1, 1, 0)
WAO maximal tile masks: WaoTileMasks(2 = 0b10, 3 = 0b11)
Code: Select all
$ cat 1.in.uwi
| ............ | ............ |
| ............ | ............ |
| ............ | ............ |
| ............ | ............ |
| ............ | ............ |
| ............ | ............ |
| ............ | ............ |
| ............ | ............ |
Code: Select all
$ rlife grid-tool from-uwi c4d-f2b < 1.in.uwi > 1.in
$ cat 1.in
| | | . | . |
| .. | .. | ... | ... |
| .... | .... | .... | .... |
| .... | .... | .... | .... |
| .... | .... | .... | .... |
| .... | .... | .... | .... |
| .... | .... | .... | .... |
| .... | .... | .... | .... |
| .... | .... | .... | .... |
| .... | .... | .... | .... |
| .... | .... | .... | .... |
| .... | .... | .... | .... |
| .... | .... | ... | ... |
| .. | .. | . | . |
Now I want to constrain the NE-most half diagonal to zero, but where is that? It's in the third-to-last U column, but how do the tile indices map in? Let's mark the two tile indices in a UWI view and see...
Code: Select all
$ cat 1.test.uwi
| .........1.. | .........2.. |
| .........1.. | .........2.. |
| .........1.. | .........2.. |
| .........1.. | .........2.. |
| .........1.. | .........2.. |
| .........1.. | .........2.. |
| .........1.. | .........2.. |
| .........1.. | .........2.. |
$ rlife grid-tool from-uwi c4d-f2b < 1.test.uwi
| | | . | . |
| .. | .. | ... | ... |
| .... | .... | 2... | 2... |
| 12.. | 12.. | .12. | .12. |
| ..12 | ..12 | ...1 | ...1 |
| .... | .... | .... | .... |
| .... | .... | .... | .... |
| .... | .... | .... | .... |
| .... | .... | .... | .... |
| .... | .... | .... | .... |
| .... | .... | .... | .... |
| .... | .... | .... | .... |
| .... | .... | ... | ... |
| .. | .. | . | . |
Code: Select all
$ cat 1.cstr.uwi
| WWWWWWWWWWWW | WWWWWWWWW.WW |
| WWWWWWWWWWWW | WWWWWWWWW.WW |
| WWWWWWWWWWWW | WWWWWWWWW.WW |
(...many, many lines of the same...)
| WWWWWWWWWWWW | WWWWWWWWW.WW |
| WWWWWWWWWWWW | WWWWWWWWW.WW |
| WWWWWWWWWWWW | WWWWWWWWW.WW |
$ rlife grid-tool from-uwi c4d-f2b < 1.cstr.uwi > 1.cstr
$ # 1.cstr omitted because it's diagonally huge, but it looks like...
$ head -n 30 1.cstr.uwi | rlife grid-tool from-uwi c4d-f2b
| | | W | W |
| WW | WW | WWW | WWW |
| WWWW | WWWW | .WWWW | .WWWW |
| W.WWWW | W.WWWW | WW.WWWW | WW.WWWW |
| WWW.WWWW | WWW.WWWW | WWWW.WWWW | WWWW.WWWW |
| WWWWW.WWWW | WWWWW.WWWW | WWWWWW.WWWW | WWWWWW.WWWW |
| WWWWWWW.WWWW | WWWWWWW.WWWW | WWWWWWWW.WWWW | WWWWWWWW.WWWW |
| WWWWWWWWW.WWWW | WWWWWWWWW.WWWW | WWWWWWWWWW.WWWW | WWWWWWWWWW.WWWW |
| WWWWWWWWWWW.WWW | WWWWWWWWWWW.WWW | WWWWWWWWWWWW.WW | WWWWWWWWWWWW.WW |
| WWWWWWWWWWWWW.W | WWWWWWWWWWWWW.W | WWWWWWWWWWWWWW. | WWWWWWWWWWWWWW. |
| WWWWWWWWWWWWWWW | WWWWWWWWWWWWWWW | WWWWWWWWWWWWWWW | WWWWWWWWWWWWWWW |
| WWWWWWWWWWWWWWW | WWWWWWWWWWWWWWW | WWWWWWWWWWWWWWW | WWWWWWWWWWWWWWW |
| WWWWWWWWWWWWWWW | WWWWWWWWWWWWWWW | WWWWWWWWWWWWWW | WWWWWWWWWWWWWW |
| WWWWWWWWWWWWW | WWWWWWWWWWWWW | WWWWWWWWWWWW | WWWWWWWWWWWW |
| WWWWWWWWWWW | WWWWWWWWWWW | WWWWWWWWWW | WWWWWWWWWW |
| WWWWWWWWW | WWWWWWWWW | WWWWWWWW | WWWWWWWW |
| WWWWWWW | WWWWWWW | WWWWWW | WWWWWW |
| WWWWW | WWWWW | WWWW | WWWW |
| WWW | WWW | WW | WW |
| W | W | | |
Code: Select all
$ rlife llsss --rule 'B3/S12' c4d-f2b 1.in --constraint grid:1.cstr:none --left-edge odd --filters wcaf
The "none" after "1.cstr" means that if the search exceeds the length of the constraint grid it will stop constraining it which isn't exactly desirable, but I can't think of any better way to do this without real code changes.