github.com/liucxer/courier@v1.7.1/h3/base_cells.go (about)

     1  package h3
     2  
     3  /**
     4   *  @brief base cell at a given ijk and required rotations into its system
     5   */
     6  type BaseCellOrient struct {
     7  	baseCell int ///< base cell number
     8  	ccwRot60 int ///< number of ccw 60 degree rotations relative to current
     9  }
    10  
    11  type BaseCellData struct {
    12  	homeFijk     FaceIJK ///< "home" face and normalized ijk coordinates on that face
    13  	isPentagon   int     ///< is this base cell a pentagon?
    14  	cwOffsetPent [2]int  ///< if a pentagon, what are its two clockwise offset
    15  }
    16  
    17  const INVALID_BASE_CELL = 127
    18  const MAX_FACE_COORD = 2
    19  
    20  /**
    21   * @brief Neighboring base cell ID in each IJK direction.
    22   * For each base cell, for each direction, the neighboring base
    23   * cell ID is given. 127 indicates there is no neighbor in that direction.
    24   */
    25  var baseCellNeighbors = [NUM_BASE_CELLS][7]int{
    26  	{0, 1, 5, 2, 4, 3, 8},                             // base cell 0
    27  	{1, 7, 6, 9, 0, 3, 2},                             // base cell 1
    28  	{2, 6, 10, 11, 0, 1, 5},                           // base cell 2
    29  	{3, 13, 1, 7, 4, 12, 0},                           // base cell 3
    30  	{4, INVALID_BASE_CELL, 15, 8, 3, 0, 12},           // base cell 4 (pentagon)
    31  	{5, 2, 18, 10, 8, 0, 16},                          // base cell 5
    32  	{6, 14, 11, 17, 1, 9, 2},                          // base cell 6
    33  	{7, 21, 9, 19, 3, 13, 1},                          // base cell 7
    34  	{8, 5, 22, 16, 4, 0, 15},                          // base cell 8
    35  	{9, 19, 14, 20, 1, 7, 6},                          // base cell 9
    36  	{10, 11, 24, 23, 5, 2, 18},                        // base cell 10
    37  	{11, 17, 23, 25, 2, 6, 10},                        // base cell 11
    38  	{12, 28, 13, 26, 4, 15, 3},                        // base cell 12
    39  	{13, 26, 21, 29, 3, 12, 7},                        // base cell 13
    40  	{14, INVALID_BASE_CELL, 17, 27, 9, 20, 6},         // base cell 14 (pentagon)
    41  	{15, 22, 28, 31, 4, 8, 12},                        // base cell 15
    42  	{16, 18, 33, 30, 8, 5, 22},                        // base cell 16
    43  	{17, 11, 14, 6, 35, 25, 27},                       // base cell 17
    44  	{18, 24, 30, 32, 5, 10, 16},                       // base cell 18
    45  	{19, 34, 20, 36, 7, 21, 9},                        // base cell 19
    46  	{20, 14, 19, 9, 40, 27, 36},                       // base cell 20
    47  	{21, 38, 19, 34, 13, 29, 7},                       // base cell 21
    48  	{22, 16, 41, 33, 15, 8, 31},                       // base cell 22
    49  	{23, 24, 11, 10, 39, 37, 25},                      // base cell 23
    50  	{24, INVALID_BASE_CELL, 32, 37, 10, 23, 18},       // base cell 24 (pentagon)
    51  	{25, 23, 17, 11, 45, 39, 35},                      // base cell 25
    52  	{26, 42, 29, 43, 12, 28, 13},                      // base cell 26
    53  	{27, 40, 35, 46, 14, 20, 17},                      // base cell 27
    54  	{28, 31, 42, 44, 12, 15, 26},                      // base cell 28
    55  	{29, 43, 38, 47, 13, 26, 21},                      // base cell 29
    56  	{30, 32, 48, 50, 16, 18, 33},                      // base cell 30
    57  	{31, 41, 44, 53, 15, 22, 28},                      // base cell 31
    58  	{32, 30, 24, 18, 52, 50, 37},                      // base cell 32
    59  	{33, 30, 49, 48, 22, 16, 41},                      // base cell 33
    60  	{34, 19, 38, 21, 54, 36, 51},                      // base cell 34
    61  	{35, 46, 45, 56, 17, 27, 25},                      // base cell 35
    62  	{36, 20, 34, 19, 55, 40, 54},                      // base cell 36
    63  	{37, 39, 52, 57, 24, 23, 32},                      // base cell 37
    64  	{38, INVALID_BASE_CELL, 34, 51, 29, 47, 21},       // base cell 38 (pentagon)
    65  	{39, 37, 25, 23, 59, 57, 45},                      // base cell 39
    66  	{40, 27, 36, 20, 60, 46, 55},                      // base cell 40
    67  	{41, 49, 53, 61, 22, 33, 31},                      // base cell 41
    68  	{42, 58, 43, 62, 28, 44, 26},                      // base cell 42
    69  	{43, 62, 47, 64, 26, 42, 29},                      // base cell 43
    70  	{44, 53, 58, 65, 28, 31, 42},                      // base cell 44
    71  	{45, 39, 35, 25, 63, 59, 56},                      // base cell 45
    72  	{46, 60, 56, 68, 27, 40, 35},                      // base cell 46
    73  	{47, 38, 43, 29, 69, 51, 64},                      // base cell 47
    74  	{48, 49, 30, 33, 67, 66, 50},                      // base cell 48
    75  	{49, INVALID_BASE_CELL, 61, 66, 33, 48, 41},       // base cell 49 (pentagon)
    76  	{50, 48, 32, 30, 70, 67, 52},                      // base cell 50
    77  	{51, 69, 54, 71, 38, 47, 34},                      // base cell 51
    78  	{52, 57, 70, 74, 32, 37, 50},                      // base cell 52
    79  	{53, 61, 65, 75, 31, 41, 44},                      // base cell 53
    80  	{54, 71, 55, 73, 34, 51, 36},                      // base cell 54
    81  	{55, 40, 54, 36, 72, 60, 73},                      // base cell 55
    82  	{56, 68, 63, 77, 35, 46, 45},                      // base cell 56
    83  	{57, 59, 74, 78, 37, 39, 52},                      // base cell 57
    84  	{58, INVALID_BASE_CELL, 62, 76, 44, 65, 42},       // base cell 58 (pentagon)
    85  	{59, 63, 78, 79, 39, 45, 57},                      // base cell 59
    86  	{60, 72, 68, 80, 40, 55, 46},                      // base cell 60
    87  	{61, 53, 49, 41, 81, 75, 66},                      // base cell 61
    88  	{62, 43, 58, 42, 82, 64, 76},                      // base cell 62
    89  	{63, INVALID_BASE_CELL, 56, 45, 79, 59, 77},       // base cell 63 (pentagon)
    90  	{64, 47, 62, 43, 84, 69, 82},                      // base cell 64
    91  	{65, 58, 53, 44, 86, 76, 75},                      // base cell 65
    92  	{66, 67, 81, 85, 49, 48, 61},                      // base cell 66
    93  	{67, 66, 50, 48, 87, 85, 70},                      // base cell 67
    94  	{68, 56, 60, 46, 90, 77, 80},                      // base cell 68
    95  	{69, 51, 64, 47, 89, 71, 84},                      // base cell 69
    96  	{70, 67, 52, 50, 83, 87, 74},                      // base cell 70
    97  	{71, 89, 73, 91, 51, 69, 54},                      // base cell 71
    98  	{72, INVALID_BASE_CELL, 73, 55, 80, 60, 88},       // base cell 72 (pentagon)
    99  	{73, 91, 72, 88, 54, 71, 55},                      // base cell 73
   100  	{74, 78, 83, 92, 52, 57, 70},                      // base cell 74
   101  	{75, 65, 61, 53, 94, 86, 81},                      // base cell 75
   102  	{76, 86, 82, 96, 58, 65, 62},                      // base cell 76
   103  	{77, 63, 68, 56, 93, 79, 90},                      // base cell 77
   104  	{78, 74, 59, 57, 95, 92, 79},                      // base cell 78
   105  	{79, 78, 63, 59, 93, 95, 77},                      // base cell 79
   106  	{80, 68, 72, 60, 99, 90, 88},                      // base cell 80
   107  	{81, 85, 94, 101, 61, 66, 75},                     // base cell 81
   108  	{82, 96, 84, 98, 62, 76, 64},                      // base cell 82
   109  	{83, INVALID_BASE_CELL, 74, 70, 100, 87, 92},      // base cell 83 (pentagon)
   110  	{84, 69, 82, 64, 97, 89, 98},                      // base cell 84
   111  	{85, 87, 101, 102, 66, 67, 81},                    // base cell 85
   112  	{86, 76, 75, 65, 104, 96, 94},                     // base cell 86
   113  	{87, 83, 102, 100, 67, 70, 85},                    // base cell 87
   114  	{88, 72, 91, 73, 99, 80, 105},                     // base cell 88
   115  	{89, 97, 91, 103, 69, 84, 71},                     // base cell 89
   116  	{90, 77, 80, 68, 106, 93, 99},                     // base cell 90
   117  	{91, 73, 89, 71, 105, 88, 103},                    // base cell 91
   118  	{92, 83, 78, 74, 108, 100, 95},                    // base cell 92
   119  	{93, 79, 90, 77, 109, 95, 106},                    // base cell 93
   120  	{94, 86, 81, 75, 107, 104, 101},                   // base cell 94
   121  	{95, 92, 79, 78, 109, 108, 93},                    // base cell 95
   122  	{96, 104, 98, 110, 76, 86, 82},                    // base cell 96
   123  	{97, INVALID_BASE_CELL, 98, 84, 103, 89, 111},     // base cell 97 (pentagon)
   124  	{98, 110, 97, 111, 82, 96, 84},                    // base cell 98
   125  	{99, 80, 105, 88, 106, 90, 113},                   // base cell 99
   126  	{100, 102, 83, 87, 108, 114, 92},                  // base cell 100
   127  	{101, 102, 107, 112, 81, 85, 94},                  // base cell 101
   128  	{102, 101, 87, 85, 114, 112, 100},                 // base cell 102
   129  	{103, 91, 97, 89, 116, 105, 111},                  // base cell 103
   130  	{104, 107, 110, 115, 86, 94, 96},                  // base cell 104
   131  	{105, 88, 103, 91, 113, 99, 116},                  // base cell 105
   132  	{106, 93, 99, 90, 117, 109, 113},                  // base cell 106
   133  	{107, INVALID_BASE_CELL, 101, 94, 115, 104, 112},  // base cell 107 (pentagon)
   134  	{108, 100, 95, 92, 118, 114, 109},                 // base cell 108
   135  	{109, 108, 93, 95, 117, 118, 106},                 // base cell 109
   136  	{110, 98, 104, 96, 119, 111, 115},                 // base cell 110
   137  	{111, 97, 110, 98, 116, 103, 119},                 // base cell 111
   138  	{112, 107, 102, 101, 120, 115, 114},               // base cell 112
   139  	{113, 99, 116, 105, 117, 106, 121},                // base cell 113
   140  	{114, 112, 100, 102, 118, 120, 108},               // base cell 114
   141  	{115, 110, 107, 104, 120, 119, 112},               // base cell 115
   142  	{116, 103, 119, 111, 113, 105, 121},               // base cell 116
   143  	{117, INVALID_BASE_CELL, 109, 118, 113, 121, 106}, // base cell 117 (pentagon)
   144  	{118, 120, 108, 114, 117, 121, 109},               // base cell 118
   145  	{119, 111, 115, 110, 121, 116, 120},               // base cell 119
   146  	{120, 115, 114, 112, 121, 119, 118},               // base cell 120
   147  	{121, 116, 120, 119, 117, 113, 118},               // base cell 121
   148  }
   149  
   150  /** @brief Neighboring base cell rotations in each IJK direction.
   151   *
   152   * For each base cell, for each direction, the number of 60 degree
   153   * CCW rotations to the coordinate system of the neighbor is given.
   154   * -1 indicates there is no neighbor in that direction.
   155   */
   156  var baseCellNeighbor60CCWRots = [NUM_BASE_CELLS][7]int{
   157  	{0, 5, 0, 0, 1, 5, 1},  // base cell 0
   158  	{0, 0, 1, 0, 1, 0, 1},  // base cell 1
   159  	{0, 0, 0, 0, 0, 5, 0},  // base cell 2
   160  	{0, 5, 0, 0, 2, 5, 1},  // base cell 3
   161  	{0, -1, 1, 0, 3, 4, 2}, // base cell 4 (pentagon)
   162  	{0, 0, 1, 0, 1, 0, 1},  // base cell 5
   163  	{0, 0, 0, 3, 5, 5, 0},  // base cell 6
   164  	{0, 0, 0, 0, 0, 5, 0},  // base cell 7
   165  	{0, 5, 0, 0, 0, 5, 1},  // base cell 8
   166  	{0, 0, 1, 3, 0, 0, 1},  // base cell 9
   167  	{0, 0, 1, 3, 0, 0, 1},  // base cell 10
   168  	{0, 3, 3, 3, 0, 0, 0},  // base cell 11
   169  	{0, 5, 0, 0, 3, 5, 1},  // base cell 12
   170  	{0, 0, 1, 0, 1, 0, 1},  // base cell 13
   171  	{0, -1, 3, 0, 5, 2, 0}, // base cell 14 (pentagon)
   172  	{0, 5, 0, 0, 4, 5, 1},  // base cell 15
   173  	{0, 0, 0, 0, 0, 5, 0},  // base cell 16
   174  	{0, 3, 3, 3, 3, 0, 3},  // base cell 17
   175  	{0, 0, 0, 3, 5, 5, 0},  // base cell 18
   176  	{0, 3, 3, 3, 0, 0, 0},  // base cell 19
   177  	{0, 3, 3, 3, 0, 3, 0},  // base cell 20
   178  	{0, 0, 0, 3, 5, 5, 0},  // base cell 21
   179  	{0, 0, 1, 0, 1, 0, 1},  // base cell 22
   180  	{0, 3, 3, 3, 0, 3, 0},  // base cell 23
   181  	{0, -1, 3, 0, 5, 2, 0}, // base cell 24 (pentagon)
   182  	{0, 0, 0, 3, 0, 0, 3},  // base cell 25
   183  	{0, 0, 0, 0, 0, 5, 0},  // base cell 26
   184  	{0, 3, 0, 0, 0, 3, 3},  // base cell 27
   185  	{0, 0, 1, 0, 1, 0, 1},  // base cell 28
   186  	{0, 0, 1, 3, 0, 0, 1},  // base cell 29
   187  	{0, 3, 3, 3, 0, 0, 0},  // base cell 30
   188  	{0, 0, 0, 0, 0, 5, 0},  // base cell 31
   189  	{0, 3, 3, 3, 3, 0, 3},  // base cell 32
   190  	{0, 0, 1, 3, 0, 0, 1},  // base cell 33
   191  	{0, 3, 3, 3, 3, 0, 3},  // base cell 34
   192  	{0, 0, 3, 0, 3, 0, 3},  // base cell 35
   193  	{0, 0, 0, 3, 0, 0, 3},  // base cell 36
   194  	{0, 3, 0, 0, 0, 3, 3},  // base cell 37
   195  	{0, -1, 3, 0, 5, 2, 0}, // base cell 38 (pentagon)
   196  	{0, 3, 0, 0, 3, 3, 0},  // base cell 39
   197  	{0, 3, 0, 0, 3, 3, 0},  // base cell 40
   198  	{0, 0, 0, 3, 5, 5, 0},  // base cell 41
   199  	{0, 0, 0, 3, 5, 5, 0},  // base cell 42
   200  	{0, 3, 3, 3, 0, 0, 0},  // base cell 43
   201  	{0, 0, 1, 3, 0, 0, 1},  // base cell 44
   202  	{0, 0, 3, 0, 0, 3, 3},  // base cell 45
   203  	{0, 0, 0, 3, 0, 3, 0},  // base cell 46
   204  	{0, 3, 3, 3, 0, 3, 0},  // base cell 47
   205  	{0, 3, 3, 3, 0, 3, 0},  // base cell 48
   206  	{0, -1, 3, 0, 5, 2, 0}, // base cell 49 (pentagon)
   207  	{0, 0, 0, 3, 0, 0, 3},  // base cell 50
   208  	{0, 3, 0, 0, 0, 3, 3},  // base cell 51
   209  	{0, 0, 3, 0, 3, 0, 3},  // base cell 52
   210  	{0, 3, 3, 3, 0, 0, 0},  // base cell 53
   211  	{0, 0, 3, 0, 3, 0, 3},  // base cell 54
   212  	{0, 0, 3, 0, 0, 3, 3},  // base cell 55
   213  	{0, 3, 3, 3, 0, 0, 3},  // base cell 56
   214  	{0, 0, 0, 3, 0, 3, 0},  // base cell 57
   215  	{0, -1, 3, 0, 5, 2, 0}, // base cell 58 (pentagon)
   216  	{0, 3, 3, 3, 3, 3, 0},  // base cell 59
   217  	{0, 3, 3, 3, 3, 3, 0},  // base cell 60
   218  	{0, 3, 3, 3, 3, 0, 3},  // base cell 61
   219  	{0, 3, 3, 3, 3, 0, 3},  // base cell 62
   220  	{0, -1, 3, 0, 5, 2, 0}, // base cell 63 (pentagon)
   221  	{0, 0, 0, 3, 0, 0, 3},  // base cell 64
   222  	{0, 3, 3, 3, 0, 3, 0},  // base cell 65
   223  	{0, 3, 0, 0, 0, 3, 3},  // base cell 66
   224  	{0, 3, 0, 0, 3, 3, 0},  // base cell 67
   225  	{0, 3, 3, 3, 0, 0, 0},  // base cell 68
   226  	{0, 3, 0, 0, 3, 3, 0},  // base cell 69
   227  	{0, 0, 3, 0, 0, 3, 3},  // base cell 70
   228  	{0, 0, 0, 3, 0, 3, 0},  // base cell 71
   229  	{0, -1, 3, 0, 5, 2, 0}, // base cell 72 (pentagon)
   230  	{0, 3, 3, 3, 0, 0, 3},  // base cell 73
   231  	{0, 3, 3, 3, 0, 0, 3},  // base cell 74
   232  	{0, 0, 0, 3, 0, 0, 3},  // base cell 75
   233  	{0, 3, 0, 0, 0, 3, 3},  // base cell 76
   234  	{0, 0, 0, 3, 0, 5, 0},  // base cell 77
   235  	{0, 3, 3, 3, 0, 0, 0},  // base cell 78
   236  	{0, 0, 1, 3, 1, 0, 1},  // base cell 79
   237  	{0, 0, 1, 3, 1, 0, 1},  // base cell 80
   238  	{0, 0, 3, 0, 3, 0, 3},  // base cell 81
   239  	{0, 0, 3, 0, 3, 0, 3},  // base cell 82
   240  	{0, -1, 3, 0, 5, 2, 0}, // base cell 83 (pentagon)
   241  	{0, 0, 3, 0, 0, 3, 3},  // base cell 84
   242  	{0, 0, 0, 3, 0, 3, 0},  // base cell 85
   243  	{0, 3, 0, 0, 3, 3, 0},  // base cell 86
   244  	{0, 3, 3, 3, 3, 3, 0},  // base cell 87
   245  	{0, 0, 0, 3, 0, 5, 0},  // base cell 88
   246  	{0, 3, 3, 3, 3, 3, 0},  // base cell 89
   247  	{0, 0, 0, 0, 0, 0, 1},  // base cell 90
   248  	{0, 3, 3, 3, 0, 0, 0},  // base cell 91
   249  	{0, 0, 0, 3, 0, 5, 0},  // base cell 92
   250  	{0, 5, 0, 0, 5, 5, 0},  // base cell 93
   251  	{0, 0, 3, 0, 0, 3, 3},  // base cell 94
   252  	{0, 0, 0, 0, 0, 0, 1},  // base cell 95
   253  	{0, 0, 0, 3, 0, 3, 0},  // base cell 96
   254  	{0, -1, 3, 0, 5, 2, 0}, // base cell 97 (pentagon)
   255  	{0, 3, 3, 3, 0, 0, 3},  // base cell 98
   256  	{0, 5, 0, 0, 5, 5, 0},  // base cell 99
   257  	{0, 0, 1, 3, 1, 0, 1},  // base cell 100
   258  	{0, 3, 3, 3, 0, 0, 3},  // base cell 101
   259  	{0, 3, 3, 3, 0, 0, 0},  // base cell 102
   260  	{0, 0, 1, 3, 1, 0, 1},  // base cell 103
   261  	{0, 3, 3, 3, 3, 3, 0},  // base cell 104
   262  	{0, 0, 0, 0, 0, 0, 1},  // base cell 105
   263  	{0, 0, 1, 0, 3, 5, 1},  // base cell 106
   264  	{0, -1, 3, 0, 5, 2, 0}, // base cell 107 (pentagon)
   265  	{0, 5, 0, 0, 5, 5, 0},  // base cell 108
   266  	{0, 0, 1, 0, 4, 5, 1},  // base cell 109
   267  	{0, 3, 3, 3, 0, 0, 0},  // base cell 110
   268  	{0, 0, 0, 3, 0, 5, 0},  // base cell 111
   269  	{0, 0, 0, 3, 0, 5, 0},  // base cell 112
   270  	{0, 0, 1, 0, 2, 5, 1},  // base cell 113
   271  	{0, 0, 0, 0, 0, 0, 1},  // base cell 114
   272  	{0, 0, 1, 3, 1, 0, 1},  // base cell 115
   273  	{0, 5, 0, 0, 5, 5, 0},  // base cell 116
   274  	{0, -1, 1, 0, 3, 4, 2}, // base cell 117 (pentagon)
   275  	{0, 0, 1, 0, 0, 5, 1},  // base cell 118
   276  	{0, 0, 0, 0, 0, 0, 1},  // base cell 119
   277  	{0, 5, 0, 0, 5, 5, 0},  // base cell 120
   278  	{0, 0, 1, 0, 1, 5, 1},  // base cell 121
   279  }
   280  
   281  /** @brief Resolution 0 base cell lookup table for each face.
   282   *
   283   * Given the face number and a resolution 0 ijk+ coordinate in that face's
   284   * face-centered ijk coordinate system, gives the base cell located at that
   285   * coordinate and the number of 60 ccw rotations to rotate into that base
   286   * cell's orientation.
   287   *
   288   * Valid lookup coordinates are from (0, 0, 0) to (2, 2, 2).
   289   *
   290   * This table can be accessed using the functions `_faceIjkToBaseCell` and
   291   * `_faceIjkToBaseCellCCWrot60`
   292   */
   293  var faceIjkBaseCells = [NUM_ICOSA_FACES][3][3][3]BaseCellOrient{
   294  	{ // face 0
   295  		{
   296  			// i 0
   297  			{{16, 0}, {18, 0}, {24, 0}}, // j 0
   298  			{{33, 0}, {30, 0}, {32, 3}}, // j 1
   299  			{{49, 1}, {48, 3}, {50, 3}}, // j 2
   300  		},
   301  		{
   302  			// i 1
   303  			{{8, 0}, {5, 5}, {10, 5}},   // j 0
   304  			{{22, 0}, {16, 0}, {18, 0}}, // j 1
   305  			{{41, 1}, {33, 0}, {30, 0}}, // j 2
   306  		},
   307  		{
   308  			// i 2
   309  			{{4, 0}, {0, 5}, {2, 5}},    // j 0
   310  			{{15, 1}, {8, 0}, {5, 5}},   // j 1
   311  			{{31, 1}, {22, 0}, {16, 0}}, // j 2
   312  		}},
   313  	{ // face 1
   314  		{
   315  			// i 0
   316  			{{2, 0}, {6, 0}, {14, 0}},   // j 0
   317  			{{10, 0}, {11, 0}, {17, 3}}, // j 1
   318  			{{24, 1}, {23, 3}, {25, 3}}, // j 2
   319  		},
   320  		{
   321  			// i 1
   322  			{{0, 0}, {1, 5}, {9, 5}},    // j 0
   323  			{{5, 0}, {2, 0}, {6, 0}},    // j 1
   324  			{{18, 1}, {10, 0}, {11, 0}}, // j 2
   325  		},
   326  		{
   327  			// i 2
   328  			{{4, 1}, {3, 5}, {7, 5}},  // j 0
   329  			{{8, 1}, {0, 0}, {1, 5}},  // j 1
   330  			{{16, 1}, {5, 0}, {2, 0}}, // j 2
   331  		}},
   332  	{ // face 2
   333  		{
   334  			// i 0
   335  			{{7, 0}, {21, 0}, {38, 0}},  // j 0
   336  			{{9, 0}, {19, 0}, {34, 3}},  // j 1
   337  			{{14, 1}, {20, 3}, {36, 3}}, // j 2
   338  		},
   339  		{
   340  			// i 1
   341  			{{3, 0}, {13, 5}, {29, 5}}, // j 0
   342  			{{1, 0}, {7, 0}, {21, 0}},  // j 1
   343  			{{6, 1}, {9, 0}, {19, 0}},  // j 2
   344  		},
   345  		{
   346  			// i 2
   347  			{{4, 2}, {12, 5}, {26, 5}}, // j 0
   348  			{{0, 1}, {3, 0}, {13, 5}},  // j 1
   349  			{{2, 1}, {1, 0}, {7, 0}},   // j 2
   350  		}},
   351  	{ // face 3
   352  		{
   353  			// i 0
   354  			{{26, 0}, {42, 0}, {58, 0}}, // j 0
   355  			{{29, 0}, {43, 0}, {62, 3}}, // j 1
   356  			{{38, 1}, {47, 3}, {64, 3}}, // j 2
   357  		},
   358  		{
   359  			// i 1
   360  			{{12, 0}, {28, 5}, {44, 5}}, // j 0
   361  			{{13, 0}, {26, 0}, {42, 0}}, // j 1
   362  			{{21, 1}, {29, 0}, {43, 0}}, // j 2
   363  		},
   364  		{
   365  			// i 2
   366  			{{4, 3}, {15, 5}, {31, 5}}, // j 0
   367  			{{3, 1}, {12, 0}, {28, 5}}, // j 1
   368  			{{7, 1}, {13, 0}, {26, 0}}, // j 2
   369  		}},
   370  	{ // face 4
   371  		{
   372  			// i 0
   373  			{{31, 0}, {41, 0}, {49, 0}}, // j 0
   374  			{{44, 0}, {53, 0}, {61, 3}}, // j 1
   375  			{{58, 1}, {65, 3}, {75, 3}}, // j 2
   376  		},
   377  		{
   378  			// i 1
   379  			{{15, 0}, {22, 5}, {33, 5}}, // j 0
   380  			{{28, 0}, {31, 0}, {41, 0}}, // j 1
   381  			{{42, 1}, {44, 0}, {53, 0}}, // j 2
   382  		},
   383  		{
   384  			// i 2
   385  			{{4, 4}, {8, 5}, {16, 5}},   // j 0
   386  			{{12, 1}, {15, 0}, {22, 5}}, // j 1
   387  			{{26, 1}, {28, 0}, {31, 0}}, // j 2
   388  		}},
   389  	{ // face 5
   390  		{
   391  			// i 0
   392  			{{50, 0}, {48, 0}, {49, 3}}, // j 0
   393  			{{32, 0}, {30, 3}, {33, 3}}, // j 1
   394  			{{24, 3}, {18, 3}, {16, 3}}, // j 2
   395  		},
   396  		{
   397  			// i 1
   398  			{{70, 0}, {67, 0}, {66, 3}}, // j 0
   399  			{{52, 3}, {50, 0}, {48, 0}}, // j 1
   400  			{{37, 3}, {32, 0}, {30, 3}}, // j 2
   401  		},
   402  		{
   403  			// i 2
   404  			{{83, 0}, {87, 3}, {85, 3}}, // j 0
   405  			{{74, 3}, {70, 0}, {67, 0}}, // j 1
   406  			{{57, 1}, {52, 3}, {50, 0}}, // j 2
   407  		}},
   408  	{ // face 6
   409  		{
   410  			// i 0
   411  			{{25, 0}, {23, 0}, {24, 3}}, // j 0
   412  			{{17, 0}, {11, 3}, {10, 3}}, // j 1
   413  			{{14, 3}, {6, 3}, {2, 3}},   // j 2
   414  		},
   415  		{
   416  			// i 1
   417  			{{45, 0}, {39, 0}, {37, 3}}, // j 0
   418  			{{35, 3}, {25, 0}, {23, 0}}, // j 1
   419  			{{27, 3}, {17, 0}, {11, 3}}, // j 2
   420  		},
   421  		{
   422  			// i 2
   423  			{{63, 0}, {59, 3}, {57, 3}}, // j 0
   424  			{{56, 3}, {45, 0}, {39, 0}}, // j 1
   425  			{{46, 3}, {35, 3}, {25, 0}}, // j 2
   426  		}},
   427  	{ // face 7
   428  		{
   429  			// i 0
   430  			{{36, 0}, {20, 0}, {14, 3}}, // j 0
   431  			{{34, 0}, {19, 3}, {9, 3}},  // j 1
   432  			{{38, 3}, {21, 3}, {7, 3}},  // j 2
   433  		},
   434  		{
   435  			// i 1
   436  			{{55, 0}, {40, 0}, {27, 3}}, // j 0
   437  			{{54, 3}, {36, 0}, {20, 0}}, // j 1
   438  			{{51, 3}, {34, 0}, {19, 3}}, // j 2
   439  		},
   440  		{
   441  			// i 2
   442  			{{72, 0}, {60, 3}, {46, 3}}, // j 0
   443  			{{73, 3}, {55, 0}, {40, 0}}, // j 1
   444  			{{71, 3}, {54, 3}, {36, 0}}, // j 2
   445  		}},
   446  	{ // face 8
   447  		{
   448  			// i 0
   449  			{{64, 0}, {47, 0}, {38, 3}}, // j 0
   450  			{{62, 0}, {43, 3}, {29, 3}}, // j 1
   451  			{{58, 3}, {42, 3}, {26, 3}}, // j 2
   452  		},
   453  		{
   454  			// i 1
   455  			{{84, 0}, {69, 0}, {51, 3}}, // j 0
   456  			{{82, 3}, {64, 0}, {47, 0}}, // j 1
   457  			{{76, 3}, {62, 0}, {43, 3}}, // j 2
   458  		},
   459  		{
   460  			// i 2
   461  			{{97, 0}, {89, 3}, {71, 3}}, // j 0
   462  			{{98, 3}, {84, 0}, {69, 0}}, // j 1
   463  			{{96, 3}, {82, 3}, {64, 0}}, // j 2
   464  		}},
   465  	{ // face 9
   466  		{
   467  			// i 0
   468  			{{75, 0}, {65, 0}, {58, 3}}, // j 0
   469  			{{61, 0}, {53, 3}, {44, 3}}, // j 1
   470  			{{49, 3}, {41, 3}, {31, 3}}, // j 2
   471  		},
   472  		{
   473  			// i 1
   474  			{{94, 0}, {86, 0}, {76, 3}}, // j 0
   475  			{{81, 3}, {75, 0}, {65, 0}}, // j 1
   476  			{{66, 3}, {61, 0}, {53, 3}}, // j 2
   477  		},
   478  		{
   479  			// i 2
   480  			{{107, 0}, {104, 3}, {96, 3}}, // j 0
   481  			{{101, 3}, {94, 0}, {86, 0}},  // j 1
   482  			{{85, 3}, {81, 3}, {75, 0}},   // j 2
   483  		}},
   484  	{ // face 10
   485  		{
   486  			// i 0
   487  			{{57, 0}, {59, 0}, {63, 3}}, // j 0
   488  			{{74, 0}, {78, 3}, {79, 3}}, // j 1
   489  			{{83, 3}, {92, 3}, {95, 3}}, // j 2
   490  		},
   491  		{
   492  			// i 1
   493  			{{37, 0}, {39, 3}, {45, 3}}, // j 0
   494  			{{52, 0}, {57, 0}, {59, 0}}, // j 1
   495  			{{70, 3}, {74, 0}, {78, 3}}, // j 2
   496  		},
   497  		{
   498  			// i 2
   499  			{{24, 0}, {23, 3}, {25, 3}}, // j 0
   500  			{{32, 3}, {37, 0}, {39, 3}}, // j 1
   501  			{{50, 3}, {52, 0}, {57, 0}}, // j 2
   502  		}},
   503  	{ // face 11
   504  		{
   505  			// i 0
   506  			{{46, 0}, {60, 0}, {72, 3}}, // j 0
   507  			{{56, 0}, {68, 3}, {80, 3}}, // j 1
   508  			{{63, 3}, {77, 3}, {90, 3}}, // j 2
   509  		},
   510  		{
   511  			// i 1
   512  			{{27, 0}, {40, 3}, {55, 3}}, // j 0
   513  			{{35, 0}, {46, 0}, {60, 0}}, // j 1
   514  			{{45, 3}, {56, 0}, {68, 3}}, // j 2
   515  		},
   516  		{
   517  			// i 2
   518  			{{14, 0}, {20, 3}, {36, 3}}, // j 0
   519  			{{17, 3}, {27, 0}, {40, 3}}, // j 1
   520  			{{25, 3}, {35, 0}, {46, 0}}, // j 2
   521  		}},
   522  	{ // face 12
   523  		{
   524  			// i 0
   525  			{{71, 0}, {89, 0}, {97, 3}},  // j 0
   526  			{{73, 0}, {91, 3}, {103, 3}}, // j 1
   527  			{{72, 3}, {88, 3}, {105, 3}}, // j 2
   528  		},
   529  		{
   530  			// i 1
   531  			{{51, 0}, {69, 3}, {84, 3}}, // j 0
   532  			{{54, 0}, {71, 0}, {89, 0}}, // j 1
   533  			{{55, 3}, {73, 0}, {91, 3}}, // j 2
   534  		},
   535  		{
   536  			// i 2
   537  			{{38, 0}, {47, 3}, {64, 3}}, // j 0
   538  			{{34, 3}, {51, 0}, {69, 3}}, // j 1
   539  			{{36, 3}, {54, 0}, {71, 0}}, // j 2
   540  		}},
   541  	{ // face 13
   542  		{
   543  			// i 0
   544  			{{96, 0}, {104, 0}, {107, 3}}, // j 0
   545  			{{98, 0}, {110, 3}, {115, 3}}, // j 1
   546  			{{97, 3}, {111, 3}, {119, 3}}, // j 2
   547  		},
   548  		{
   549  			// i 1
   550  			{{76, 0}, {86, 3}, {94, 3}},  // j 0
   551  			{{82, 0}, {96, 0}, {104, 0}}, // j 1
   552  			{{84, 3}, {98, 0}, {110, 3}}, // j 2
   553  		},
   554  		{
   555  			// i 2
   556  			{{58, 0}, {65, 3}, {75, 3}}, // j 0
   557  			{{62, 3}, {76, 0}, {86, 3}}, // j 1
   558  			{{64, 3}, {82, 0}, {96, 0}}, // j 2
   559  		}},
   560  	{ // face 14
   561  		{
   562  			// i 0
   563  			{{85, 0}, {87, 0}, {83, 3}},    // j 0
   564  			{{101, 0}, {102, 3}, {100, 3}}, // j 1
   565  			{{107, 3}, {112, 3}, {114, 3}}, // j 2
   566  		},
   567  		{
   568  			// i 1
   569  			{{66, 0}, {67, 3}, {70, 3}},   // j 0
   570  			{{81, 0}, {85, 0}, {87, 0}},   // j 1
   571  			{{94, 3}, {101, 0}, {102, 3}}, // j 2
   572  		},
   573  		{
   574  			// i 2
   575  			{{49, 0}, {48, 3}, {50, 3}}, // j 0
   576  			{{61, 3}, {66, 0}, {67, 3}}, // j 1
   577  			{{75, 3}, {81, 0}, {85, 0}}, // j 2
   578  		}},
   579  	{ // face 15
   580  		{
   581  			// i 0
   582  			{{95, 0}, {92, 0}, {83, 0}}, // j 0
   583  			{{79, 0}, {78, 0}, {74, 3}}, // j 1
   584  			{{63, 1}, {59, 3}, {57, 3}}, // j 2
   585  		},
   586  		{
   587  			// i 1
   588  			{{109, 0}, {108, 0}, {100, 5}}, // j 0
   589  			{{93, 1}, {95, 0}, {92, 0}},    // j 1
   590  			{{77, 1}, {79, 0}, {78, 0}},    // j 2
   591  		},
   592  		{
   593  			// i 2
   594  			{{117, 4}, {118, 5}, {114, 5}}, // j 0
   595  			{{106, 1}, {109, 0}, {108, 0}}, // j 1
   596  			{{90, 1}, {93, 1}, {95, 0}},    // j 2
   597  		}},
   598  	{ // face 16
   599  		{
   600  			// i 0
   601  			{{90, 0}, {77, 0}, {63, 0}}, // j 0
   602  			{{80, 0}, {68, 0}, {56, 3}}, // j 1
   603  			{{72, 1}, {60, 3}, {46, 3}}, // j 2
   604  		},
   605  		{
   606  			// i 1
   607  			{{106, 0}, {93, 0}, {79, 5}}, // j 0
   608  			{{99, 1}, {90, 0}, {77, 0}},  // j 1
   609  			{{88, 1}, {80, 0}, {68, 0}},  // j 2
   610  		},
   611  		{
   612  			// i 2
   613  			{{117, 3}, {109, 5}, {95, 5}}, // j 0
   614  			{{113, 1}, {106, 0}, {93, 0}}, // j 1
   615  			{{105, 1}, {99, 1}, {90, 0}},  // j 2
   616  		}},
   617  	{ // face 17
   618  		{
   619  			// i 0
   620  			{{105, 0}, {88, 0}, {72, 0}}, // j 0
   621  			{{103, 0}, {91, 0}, {73, 3}}, // j 1
   622  			{{97, 1}, {89, 3}, {71, 3}},  // j 2
   623  		},
   624  		{
   625  			// i 1
   626  			{{113, 0}, {99, 0}, {80, 5}},  // j 0
   627  			{{116, 1}, {105, 0}, {88, 0}}, // j 1
   628  			{{111, 1}, {103, 0}, {91, 0}}, // j 2
   629  		},
   630  		{
   631  			// i 2
   632  			{{117, 2}, {106, 5}, {90, 5}},  // j 0
   633  			{{121, 1}, {113, 0}, {99, 0}},  // j 1
   634  			{{119, 1}, {116, 1}, {105, 0}}, // j 2
   635  		}},
   636  	{ // face 18
   637  		{
   638  			// i 0
   639  			{{119, 0}, {111, 0}, {97, 0}}, // j 0
   640  			{{115, 0}, {110, 0}, {98, 3}}, // j 1
   641  			{{107, 1}, {104, 3}, {96, 3}}, // j 2
   642  		},
   643  		{
   644  			// i 1
   645  			{{121, 0}, {116, 0}, {103, 5}}, // j 0
   646  			{{120, 1}, {119, 0}, {111, 0}}, // j 1
   647  			{{112, 1}, {115, 0}, {110, 0}}, // j 2
   648  		},
   649  		{
   650  			// i 2
   651  			{{117, 1}, {113, 5}, {105, 5}}, // j 0
   652  			{{118, 1}, {121, 0}, {116, 0}}, // j 1
   653  			{{114, 1}, {120, 1}, {119, 0}}, // j 2
   654  		}},
   655  	{ // face 19
   656  		{
   657  			// i 0
   658  			{{114, 0}, {112, 0}, {107, 0}}, // j 0
   659  			{{100, 0}, {102, 0}, {101, 3}}, // j 1
   660  			{{83, 1}, {87, 3}, {85, 3}},    // j 2
   661  		},
   662  		{
   663  			// i 1
   664  			{{118, 0}, {120, 0}, {115, 5}}, // j 0
   665  			{{108, 1}, {114, 0}, {112, 0}}, // j 1
   666  			{{92, 1}, {100, 0}, {102, 0}},  // j 2
   667  		},
   668  		{
   669  			// i 2
   670  			{{117, 0}, {121, 5}, {119, 5}}, // j 0
   671  			{{109, 1}, {118, 0}, {120, 0}}, // j 1
   672  			{{95, 1}, {108, 1}, {114, 0}},  // j 2
   673  		},
   674  	},
   675  }
   676  
   677  /** @brief Resolution 0 base cell data table.
   678   *
   679   * For each base cell, gives the "home" face and ijk+ coordinates on that face,
   680   * whether or not the base cell is a pentagon. Additionally, if the base cell
   681   * is a pentagon, the two cw offset rotation adjacent faces are given (-1
   682   * indicates that no cw offset rotation faces exist for this base cell).
   683   */
   684  var baseCellData = [NUM_BASE_CELLS]BaseCellData{
   685  	{FaceIJK{1, CoordIJK{1, 0, 0}}, 0, [2]int{0, 0}},    // base cell 0
   686  	{FaceIJK{2, CoordIJK{1, 1, 0}}, 0, [2]int{0, 0}},    // base cell 1
   687  	{FaceIJK{1, CoordIJK{0, 0, 0}}, 0, [2]int{0, 0}},    // base cell 2
   688  	{FaceIJK{2, CoordIJK{1, 0, 0}}, 0, [2]int{0, 0}},    // base cell 3
   689  	{FaceIJK{0, CoordIJK{2, 0, 0}}, 1, [2]int{-1, -1}},  // base cell 4
   690  	{FaceIJK{1, CoordIJK{1, 1, 0}}, 0, [2]int{0, 0}},    // base cell 5
   691  	{FaceIJK{1, CoordIJK{0, 0, 1}}, 0, [2]int{0, 0}},    // base cell 6
   692  	{FaceIJK{2, CoordIJK{0, 0, 0}}, 0, [2]int{0, 0}},    // base cell 7
   693  	{FaceIJK{0, CoordIJK{1, 0, 0}}, 0, [2]int{0, 0}},    // base cell 8
   694  	{FaceIJK{2, CoordIJK{0, 1, 0}}, 0, [2]int{0, 0}},    // base cell 9
   695  	{FaceIJK{1, CoordIJK{0, 1, 0}}, 0, [2]int{0, 0}},    // base cell 10
   696  	{FaceIJK{1, CoordIJK{0, 1, 1}}, 0, [2]int{0, 0}},    // base cell 11
   697  	{FaceIJK{3, CoordIJK{1, 0, 0}}, 0, [2]int{0, 0}},    // base cell 12
   698  	{FaceIJK{3, CoordIJK{1, 1, 0}}, 0, [2]int{0, 0}},    // base cell 13
   699  	{FaceIJK{11, CoordIJK{2, 0, 0}}, 1, [2]int{2, 6}},   // base cell 14
   700  	{FaceIJK{4, CoordIJK{1, 0, 0}}, 0, [2]int{0, 0}},    // base cell 15
   701  	{FaceIJK{0, CoordIJK{0, 0, 0}}, 0, [2]int{0, 0}},    // base cell 16
   702  	{FaceIJK{6, CoordIJK{0, 1, 0}}, 0, [2]int{0, 0}},    // base cell 17
   703  	{FaceIJK{0, CoordIJK{0, 0, 1}}, 0, [2]int{0, 0}},    // base cell 18
   704  	{FaceIJK{2, CoordIJK{0, 1, 1}}, 0, [2]int{0, 0}},    // base cell 19
   705  	{FaceIJK{7, CoordIJK{0, 0, 1}}, 0, [2]int{0, 0}},    // base cell 20
   706  	{FaceIJK{2, CoordIJK{0, 0, 1}}, 0, [2]int{0, 0}},    // base cell 21
   707  	{FaceIJK{0, CoordIJK{1, 1, 0}}, 0, [2]int{0, 0}},    // base cell 22
   708  	{FaceIJK{6, CoordIJK{0, 0, 1}}, 0, [2]int{0, 0}},    // base cell 23
   709  	{FaceIJK{10, CoordIJK{2, 0, 0}}, 1, [2]int{1, 5}},   // base cell 24
   710  	{FaceIJK{6, CoordIJK{0, 0, 0}}, 0, [2]int{0, 0}},    // base cell 25
   711  	{FaceIJK{3, CoordIJK{0, 0, 0}}, 0, [2]int{0, 0}},    // base cell 26
   712  	{FaceIJK{11, CoordIJK{1, 0, 0}}, 0, [2]int{0, 0}},   // base cell 27
   713  	{FaceIJK{4, CoordIJK{1, 1, 0}}, 0, [2]int{0, 0}},    // base cell 28
   714  	{FaceIJK{3, CoordIJK{0, 1, 0}}, 0, [2]int{0, 0}},    // base cell 29
   715  	{FaceIJK{0, CoordIJK{0, 1, 1}}, 0, [2]int{0, 0}},    // base cell 30
   716  	{FaceIJK{4, CoordIJK{0, 0, 0}}, 0, [2]int{0, 0}},    // base cell 31
   717  	{FaceIJK{5, CoordIJK{0, 1, 0}}, 0, [2]int{0, 0}},    // base cell 32
   718  	{FaceIJK{0, CoordIJK{0, 1, 0}}, 0, [2]int{0, 0}},    // base cell 33
   719  	{FaceIJK{7, CoordIJK{0, 1, 0}}, 0, [2]int{0, 0}},    // base cell 34
   720  	{FaceIJK{11, CoordIJK{1, 1, 0}}, 0, [2]int{0, 0}},   // base cell 35
   721  	{FaceIJK{7, CoordIJK{0, 0, 0}}, 0, [2]int{0, 0}},    // base cell 36
   722  	{FaceIJK{10, CoordIJK{1, 0, 0}}, 0, [2]int{0, 0}},   // base cell 37
   723  	{FaceIJK{12, CoordIJK{2, 0, 0}}, 1, [2]int{3, 7}},   // base cell 38
   724  	{FaceIJK{6, CoordIJK{1, 0, 1}}, 0, [2]int{0, 0}},    // base cell 39
   725  	{FaceIJK{7, CoordIJK{1, 0, 1}}, 0, [2]int{0, 0}},    // base cell 40
   726  	{FaceIJK{4, CoordIJK{0, 0, 1}}, 0, [2]int{0, 0}},    // base cell 41
   727  	{FaceIJK{3, CoordIJK{0, 0, 1}}, 0, [2]int{0, 0}},    // base cell 42
   728  	{FaceIJK{3, CoordIJK{0, 1, 1}}, 0, [2]int{0, 0}},    // base cell 43
   729  	{FaceIJK{4, CoordIJK{0, 1, 0}}, 0, [2]int{0, 0}},    // base cell 44
   730  	{FaceIJK{6, CoordIJK{1, 0, 0}}, 0, [2]int{0, 0}},    // base cell 45
   731  	{FaceIJK{11, CoordIJK{0, 0, 0}}, 0, [2]int{0, 0}},   // base cell 46
   732  	{FaceIJK{8, CoordIJK{0, 0, 1}}, 0, [2]int{0, 0}},    // base cell 47
   733  	{FaceIJK{5, CoordIJK{0, 0, 1}}, 0, [2]int{0, 0}},    // base cell 48
   734  	{FaceIJK{14, CoordIJK{2, 0, 0}}, 1, [2]int{0, 9}},   // base cell 49
   735  	{FaceIJK{5, CoordIJK{0, 0, 0}}, 0, [2]int{0, 0}},    // base cell 50
   736  	{FaceIJK{12, CoordIJK{1, 0, 0}}, 0, [2]int{0, 0}},   // base cell 51
   737  	{FaceIJK{10, CoordIJK{1, 1, 0}}, 0, [2]int{0, 0}},   // base cell 52
   738  	{FaceIJK{4, CoordIJK{0, 1, 1}}, 0, [2]int{0, 0}},    // base cell 53
   739  	{FaceIJK{12, CoordIJK{1, 1, 0}}, 0, [2]int{0, 0}},   // base cell 54
   740  	{FaceIJK{7, CoordIJK{1, 0, 0}}, 0, [2]int{0, 0}},    // base cell 55
   741  	{FaceIJK{11, CoordIJK{0, 1, 0}}, 0, [2]int{0, 0}},   // base cell 56
   742  	{FaceIJK{10, CoordIJK{0, 0, 0}}, 0, [2]int{0, 0}},   // base cell 57
   743  	{FaceIJK{13, CoordIJK{2, 0, 0}}, 1, [2]int{4, 8}},   // base cell 58
   744  	{FaceIJK{10, CoordIJK{0, 0, 1}}, 0, [2]int{0, 0}},   // base cell 59
   745  	{FaceIJK{11, CoordIJK{0, 0, 1}}, 0, [2]int{0, 0}},   // base cell 60
   746  	{FaceIJK{9, CoordIJK{0, 1, 0}}, 0, [2]int{0, 0}},    // base cell 61
   747  	{FaceIJK{8, CoordIJK{0, 1, 0}}, 0, [2]int{0, 0}},    // base cell 62
   748  	{FaceIJK{6, CoordIJK{2, 0, 0}}, 1, [2]int{11, 15}},  // base cell 63
   749  	{FaceIJK{8, CoordIJK{0, 0, 0}}, 0, [2]int{0, 0}},    // base cell 64
   750  	{FaceIJK{9, CoordIJK{0, 0, 1}}, 0, [2]int{0, 0}},    // base cell 65
   751  	{FaceIJK{14, CoordIJK{1, 0, 0}}, 0, [2]int{0, 0}},   // base cell 66
   752  	{FaceIJK{5, CoordIJK{1, 0, 1}}, 0, [2]int{0, 0}},    // base cell 67
   753  	{FaceIJK{16, CoordIJK{0, 1, 1}}, 0, [2]int{0, 0}},   // base cell 68
   754  	{FaceIJK{8, CoordIJK{1, 0, 1}}, 0, [2]int{0, 0}},    // base cell 69
   755  	{FaceIJK{5, CoordIJK{1, 0, 0}}, 0, [2]int{0, 0}},    // base cell 70
   756  	{FaceIJK{12, CoordIJK{0, 0, 0}}, 0, [2]int{0, 0}},   // base cell 71
   757  	{FaceIJK{7, CoordIJK{2, 0, 0}}, 1, [2]int{12, 16}},  // base cell 72
   758  	{FaceIJK{12, CoordIJK{0, 1, 0}}, 0, [2]int{0, 0}},   // base cell 73
   759  	{FaceIJK{10, CoordIJK{0, 1, 0}}, 0, [2]int{0, 0}},   // base cell 74
   760  	{FaceIJK{9, CoordIJK{0, 0, 0}}, 0, [2]int{0, 0}},    // base cell 75
   761  	{FaceIJK{13, CoordIJK{1, 0, 0}}, 0, [2]int{0, 0}},   // base cell 76
   762  	{FaceIJK{16, CoordIJK{0, 0, 1}}, 0, [2]int{0, 0}},   // base cell 77
   763  	{FaceIJK{15, CoordIJK{0, 1, 1}}, 0, [2]int{0, 0}},   // base cell 78
   764  	{FaceIJK{15, CoordIJK{0, 1, 0}}, 0, [2]int{0, 0}},   // base cell 79
   765  	{FaceIJK{16, CoordIJK{0, 1, 0}}, 0, [2]int{0, 0}},   // base cell 80
   766  	{FaceIJK{14, CoordIJK{1, 1, 0}}, 0, [2]int{0, 0}},   // base cell 81
   767  	{FaceIJK{13, CoordIJK{1, 1, 0}}, 0, [2]int{0, 0}},   // base cell 82
   768  	{FaceIJK{5, CoordIJK{2, 0, 0}}, 1, [2]int{10, 19}},  // base cell 83
   769  	{FaceIJK{8, CoordIJK{1, 0, 0}}, 0, [2]int{0, 0}},    // base cell 84
   770  	{FaceIJK{14, CoordIJK{0, 0, 0}}, 0, [2]int{0, 0}},   // base cell 85
   771  	{FaceIJK{9, CoordIJK{1, 0, 1}}, 0, [2]int{0, 0}},    // base cell 86
   772  	{FaceIJK{14, CoordIJK{0, 0, 1}}, 0, [2]int{0, 0}},   // base cell 87
   773  	{FaceIJK{17, CoordIJK{0, 0, 1}}, 0, [2]int{0, 0}},   // base cell 88
   774  	{FaceIJK{12, CoordIJK{0, 0, 1}}, 0, [2]int{0, 0}},   // base cell 89
   775  	{FaceIJK{16, CoordIJK{0, 0, 0}}, 0, [2]int{0, 0}},   // base cell 90
   776  	{FaceIJK{17, CoordIJK{0, 1, 1}}, 0, [2]int{0, 0}},   // base cell 91
   777  	{FaceIJK{15, CoordIJK{0, 0, 1}}, 0, [2]int{0, 0}},   // base cell 92
   778  	{FaceIJK{16, CoordIJK{1, 0, 1}}, 0, [2]int{0, 0}},   // base cell 93
   779  	{FaceIJK{9, CoordIJK{1, 0, 0}}, 0, [2]int{0, 0}},    // base cell 94
   780  	{FaceIJK{15, CoordIJK{0, 0, 0}}, 0, [2]int{0, 0}},   // base cell 95
   781  	{FaceIJK{13, CoordIJK{0, 0, 0}}, 0, [2]int{0, 0}},   // base cell 96
   782  	{FaceIJK{8, CoordIJK{2, 0, 0}}, 1, [2]int{13, 17}},  // base cell 97
   783  	{FaceIJK{13, CoordIJK{0, 1, 0}}, 0, [2]int{0, 0}},   // base cell 98
   784  	{FaceIJK{17, CoordIJK{1, 0, 1}}, 0, [2]int{0, 0}},   // base cell 99
   785  	{FaceIJK{19, CoordIJK{0, 1, 0}}, 0, [2]int{0, 0}},   // base cell 100
   786  	{FaceIJK{14, CoordIJK{0, 1, 0}}, 0, [2]int{0, 0}},   // base cell 101
   787  	{FaceIJK{19, CoordIJK{0, 1, 1}}, 0, [2]int{0, 0}},   // base cell 102
   788  	{FaceIJK{17, CoordIJK{0, 1, 0}}, 0, [2]int{0, 0}},   // base cell 103
   789  	{FaceIJK{13, CoordIJK{0, 0, 1}}, 0, [2]int{0, 0}},   // base cell 104
   790  	{FaceIJK{17, CoordIJK{0, 0, 0}}, 0, [2]int{0, 0}},   // base cell 105
   791  	{FaceIJK{16, CoordIJK{1, 0, 0}}, 0, [2]int{0, 0}},   // base cell 106
   792  	{FaceIJK{9, CoordIJK{2, 0, 0}}, 1, [2]int{14, 18}},  // base cell 107
   793  	{FaceIJK{15, CoordIJK{1, 0, 1}}, 0, [2]int{0, 0}},   // base cell 108
   794  	{FaceIJK{15, CoordIJK{1, 0, 0}}, 0, [2]int{0, 0}},   // base cell 109
   795  	{FaceIJK{18, CoordIJK{0, 1, 1}}, 0, [2]int{0, 0}},   // base cell 110
   796  	{FaceIJK{18, CoordIJK{0, 0, 1}}, 0, [2]int{0, 0}},   // base cell 111
   797  	{FaceIJK{19, CoordIJK{0, 0, 1}}, 0, [2]int{0, 0}},   // base cell 112
   798  	{FaceIJK{17, CoordIJK{1, 0, 0}}, 0, [2]int{0, 0}},   // base cell 113
   799  	{FaceIJK{19, CoordIJK{0, 0, 0}}, 0, [2]int{0, 0}},   // base cell 114
   800  	{FaceIJK{18, CoordIJK{0, 1, 0}}, 0, [2]int{0, 0}},   // base cell 115
   801  	{FaceIJK{18, CoordIJK{1, 0, 1}}, 0, [2]int{0, 0}},   // base cell 116
   802  	{FaceIJK{19, CoordIJK{2, 0, 0}}, 1, [2]int{-1, -1}}, // base cell 117
   803  	{FaceIJK{19, CoordIJK{1, 0, 0}}, 0, [2]int{0, 0}},   // base cell 118
   804  	{FaceIJK{18, CoordIJK{0, 0, 0}}, 0, [2]int{0, 0}},   // base cell 119
   805  	{FaceIJK{19, CoordIJK{1, 0, 1}}, 0, [2]int{0, 0}},   // base cell 120
   806  	{FaceIJK{18, CoordIJK{1, 0, 0}}, 0, [2]int{0, 0}},   // base cell 121
   807  }
   808  
   809  /** @brief Return whether or not the indicated base cell is a pentagon. */
   810  func _isBaseCellPentagon(baseCell int) bool {
   811  	return baseCellData[baseCell].isPentagon != 0
   812  }
   813  
   814  /** @brief Return whether the indicated base cell is a pentagon where all
   815   * neighbors are oriented towards it. */
   816  func _isBaseCellPolarPentagon(baseCell int) bool {
   817  	return baseCell == 4 || baseCell == 117
   818  }
   819  
   820  /** @brief Find base cell given FaceIJK.
   821   *
   822   * Given the face number and a resolution 0 ijk+ coordinate in that face's
   823   * face-centered ijk coordinate system, return the base cell located at that
   824   * coordinate.
   825   *
   826   * Valid ijk+ lookup coordinates are from (0, 0, 0) to (2, 2, 2).
   827   */
   828  func _faceIjkToBaseCell(h *FaceIJK) int {
   829  	return faceIjkBaseCells[h.face][h.coord.i][h.coord.j][h.coord.k].baseCell
   830  }
   831  
   832  /** @brief Find base cell given FaceIJK.
   833   *
   834   * Given the face number and a resolution 0 ijk+ coordinate in that face's
   835   * face-centered ijk coordinate system, return the number of 60' ccw rotations
   836   * to rotate into the coordinate system of the base cell at that coordinates.
   837   *
   838   * Valid ijk+ lookup coordinates are from (0, 0, 0) to (2, 2, 2).
   839   */
   840  func _faceIjkToBaseCellCCWrot60(h *FaceIJK) int {
   841  	return faceIjkBaseCells[h.face][h.coord.i][h.coord.j][h.coord.k].ccwRot60
   842  }
   843  
   844  /** @brief Find the FaceIJK given a base cell.
   845   */
   846  func _baseCellToFaceIjk(baseCell int, h *FaceIJK) {
   847  	*h = baseCellData[baseCell].homeFijk
   848  }
   849  
   850  /** @brief Return whether or not the tested face is a cw offset face.
   851   */
   852  func _baseCellIsCwOffset(baseCell int, testFace int) bool {
   853  	return baseCellData[baseCell].cwOffsetPent[0] == testFace ||
   854  		baseCellData[baseCell].cwOffsetPent[1] == testFace
   855  }
   856  
   857  /** @brief Return the neighboring base cell in the given direction.
   858   */
   859  func _getBaseCellNeighbor(baseCell int, dir Direction) int {
   860  	return baseCellNeighbors[baseCell][dir]
   861  }
   862  
   863  /** @brief Return the direction from the origin base cell to the neighbor.
   864   * Returns INVALID_DIGIT if the base cells are not neighbors.
   865   */
   866  func _getBaseCellDirection(originBaseCell int, neighboringBaseCell int) Direction {
   867  	for dir := CENTER_DIGIT; dir < NUM_DIGITS; dir++ {
   868  		testBaseCell := _getBaseCellNeighbor(originBaseCell, dir)
   869  		if testBaseCell == neighboringBaseCell {
   870  			return dir
   871  		}
   872  	}
   873  	return INVALID_DIGIT
   874  }
   875  
   876  /**
   877   * res0IndexCount returns the number of resolution 0 indexes
   878   *
   879   * @return count int of resolution 0 indexes
   880   */
   881  func res0IndexCount() int {
   882  	return NUM_BASE_CELLS
   883  }
   884  
   885  /**
   886   * getRes0Indexes generates all base cells storing them into the provided
   887   * memory pointer. Buffer must be of size NUM_BASE_CELLS * sizeof(H3Index).
   888   */
   889  func getRes0Indexes(out []H3Index) {
   890  	for bc := 0; bc < NUM_BASE_CELLS; bc++ {
   891  		baseCell := H3_INIT
   892  		H3_SET_MODE(&baseCell, H3_HEXAGON_MODE)
   893  		H3_SET_BASE_CELL(&baseCell, bc)
   894  		out[bc] = baseCell
   895  	}
   896  }