"Fossies" - the Fresh Open Source Software Archive

Member "aqsis-1.8.2/libs/core/geometry/lookuptable.h" (24 Aug 2012, 157737 Bytes) of package /linux/privat/aqsis-1.8.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 // Aqsis
    2 // Copyright (C) 2006, Paul C. Gregory
    3 //
    4 // Contact: pgregory@aqsis.org
    5 //
    6 // This library is free software; you can redistribute it and/or
    7 // modify it under the terms of the GNU General Public
    8 // License as published by the Free Software Foundation; either
    9 // version 2 of the License, or (at your option) any later version.
   10 //
   11 // This library is distributed in the hope that it will be useful,
   12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
   13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   14 // General Public License for more details.
   15 //
   16 // You should have received a copy of the GNU General Public
   17 // License along with this library; if not, write to the Free Software
   18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   19 
   20 
   21 
   22 /** \file
   23     \brief   LookUpTable for the MarchingCubes 33 Algorithm
   24     \author Thomas Lewiner <thomas.lewiner@polytechnique.org>
   25     \author Math Dept, PUC-Rio
   26     \version 0.2
   27     \date    12/08/2002
   28 */
   29 
   30 //________________________________________________
   31 
   32 
   33 
   34 #ifndef _LOOKUPTABLE_H_
   35 #define _LOOKUPTABLE_H_
   36 
   37 
   38 
   39 
   40 
   41 //_____________________________________________________________________________
   42 /**
   43  * \brief case mapping
   44  * For each of the possible vertex states listed in this table there is a
   45  * specific triangulation of the edge intersection points.  The table lists
   46  * all of them in the form of 0-5 edge triples with the list terminated by
   47  * the invalid value -1.  For example: case[3] list the 2 triangles
   48  * formed when cube[0] and cube[1] are inside of the surface, but the rest of
   49  * the cube is not.
   50  *
   51  * Cube description:
   52  *         7 ________ 6           _____6__             ________
   53  *         /|       /|         7/|       /|          /|       /|
   54  *       /  |     /  |        /  |     /5 |        /  6     /  |
   55  *   4 /_______ /    |      /__4____ /    10     /_______3/    |
   56  *    |     |  |5    |     |    11  |     |     |     |  |   2 |
   57  *    |    3|__|_____|2    |     |__|__2__|     | 4   |__|_____|
   58  *    |    /   |    /      8   3/   9    /      |    /   |    /
   59  *    |  /     |  /        |  /     |  /1       |  /     5  /
   60  *    |/_______|/          |/___0___|/          |/_1_____|/
   61  *   0          1        0          1
   62  */
   63 //-----------------------------------------------------------------------------
   64 static const TqInt cases[256][2] = {
   65 /*   0:                          */  {  0, -1 },
   66 /*   1: 0,                       */  {  1,  0 },
   67 /*   2:    1,                    */  {  1,  1 },
   68 /*   3: 0, 1,                    */  {  2,  0 },
   69 /*   4:       2,                 */  {  1,  2 },
   70 /*   5: 0,    2,                 */  {  3,  0 },
   71 /*   6:    1, 2,                 */  {  2,  3 },
   72 /*   7: 0, 1, 2,                 */  {  5,  0 },
   73 /*   8:          3,              */  {  1,  3 },
   74 /*   9: 0,       3,              */  {  2,  1 },
   75 /*  10:    1,    3,              */  {  3,  3 },
   76 /*  11: 0, 1,    3,              */  {  5,  1 },
   77 /*  12:       2, 3,              */  {  2,  5 },
   78 /*  13: 0,    2, 3,              */  {  5,  4 },
   79 /*  14:    1, 2, 3,              */  {  5,  9 },
   80 /*  15: 0, 1, 2, 3,              */  {  8,  0 },
   81 /*  16:             4,           */  {  1,  4 },
   82 /*  17: 0,          4,           */  {  2,  2 },
   83 /*  18:    1,       4,           */  {  3,  4 },
   84 /*  19: 0, 1,       4,           */  {  5,  2 },
   85 /*  20:       2,    4,           */  {  4,  2 },
   86 /*  21: 0,    2,    4,           */  {  6,  2 },
   87 /*  22:    1, 2,    4,           */  {  6,  9 },
   88 /*  23: 0, 1, 2,    4,           */  { 11,  0 },
   89 /*  24:          3, 4,           */  {  3,  8 },
   90 /*  25: 0,       3, 4,           */  {  5,  5 },
   91 /*  26:    1,    3, 4,           */  {  7,  3 },
   92 /*  27: 0, 1,    3, 4,           */  {  9,  1 },
   93 /*  28:       2, 3, 4,           */  {  6, 16 },
   94 /*  29: 0,    2, 3, 4,           */  { 14,  3 },
   95 /*  30:    1, 2, 3, 4,           */  { 12, 12 },
   96 /*  31: 0, 1, 2, 3, 4,           */  {  5, 24 },
   97 /*  32:                5,        */  {  1,  5 },
   98 /*  33: 0,             5,        */  {  3,  1 },
   99 /*  34:    1,          5,        */  {  2,  4 },
  100 /*  35: 0, 1,          5,        */  {  5,  3 },
  101 /*  36:       2,       5,        */  {  3,  6 },
  102 /*  37: 0,    2,       5,        */  {  7,  0 },
  103 /*  38:    1, 2,       5,        */  {  5, 10 },
  104 /*  39: 0, 1, 2,       5,        */  {  9,  0 },
  105 /*  40:          3,    5,        */  {  4,  3 },
  106 /*  41: 0,       3,    5,        */  {  6,  4 },
  107 /*  42:    1,    3,    5,        */  {  6, 11 },
  108 /*  43: 0, 1,    3,    5,        */  { 14,  1 },
  109 /*  44:       2, 3,    5,        */  {  6, 17 },
  110 /*  45: 0,    2, 3,    5,        */  { 12,  4 },
  111 /*  46:    1, 2, 3,    5,        */  { 11,  6 },
  112 /*  47: 0, 1, 2, 3,    5,        */  {  5, 25 },
  113 /*  48:             4, 5,        */  {  2,  8 },
  114 /*  49: 0,          4, 5,        */  {  5,  7 },
  115 /*  50:    1,       4, 5,        */  {  5, 12 },
  116 /*  51: 0, 1,       4, 5,        */  {  8,  1 },
  117 /*  52:       2,    4, 5,        */  {  6, 18 },
  118 /*  53: 0,    2,    4, 5,        */  { 12,  5 },
  119 /*  54:    1, 2,    4, 5,        */  { 14,  7 },
  120 /*  55: 0, 1, 2,    4, 5,        */  {  5, 28 },
  121 /*  56:          3, 4, 5,        */  {  6, 21 },
  122 /*  57: 0,       3, 4, 5,        */  { 11,  4 },
  123 /*  58:    1,    3, 4, 5,        */  { 12, 15 },
  124 /*  59: 0, 1,    3, 4, 5,        */  {  5, 30 },
  125 /*  60:       2, 3, 4, 5,        */  { 10,  5 },
  126 /*  61: 0,    2, 3, 4, 5,        */  {  6, 32 },
  127 /*  62:    1, 2, 3, 4, 5,        */  {  6, 39 },
  128 /*  63: 0, 1, 2, 3, 4, 5,        */  {  2, 12 },
  129 /*  64:                   6,     */  {  1,  6 },
  130 /*  65: 0,                6,     */  {  4,  0 },
  131 /*  66:    1,             6,     */  {  3,  5 },
  132 /*  67: 0, 1,             6,     */  {  6,  0 },
  133 /*  68:       2,          6,     */  {  2,  6 },
  134 /*  69: 0,    2,          6,     */  {  6,  3 },
  135 /*  70:    1, 2,          6,     */  {  5, 11 },
  136 /*  71: 0, 1, 2,          6,     */  { 14,  0 },
  137 /*  72:          3,       6,     */  {  3,  9 },
  138 /*  73: 0,       3,       6,     */  {  6,  5 },
  139 /*  74:    1,    3,       6,     */  {  7,  4 },
  140 /*  75: 0, 1,    3,       6,     */  { 12,  1 },
  141 /*  76:       2, 3,       6,     */  {  5, 14 },
  142 /*  77: 0,    2, 3,       6,     */  { 11,  3 },
  143 /*  78:    1, 2, 3,       6,     */  {  9,  4 },
  144 /*  79: 0, 1, 2, 3,       6,     */  {  5, 26 },
  145 /*  80:             4,    6,     */  {  3, 10 },
  146 /*  81: 0,          4,    6,     */  {  6,  6 },
  147 /*  82:    1,       4,    6,     */  {  7,  5 },
  148 /*  83: 0, 1,       4,    6,     */  { 12,  2 },
  149 /*  84:       2,    4,    6,     */  {  6, 19 },
  150 /*  85: 0,    2,    4,    6,     */  { 10,  1 },
  151 /*  86:    1, 2,    4,    6,     */  { 12, 13 },
  152 /*  87: 0, 1, 2,    4,    6,     */  {  6, 24 },
  153 /*  88:          3, 4,    6,     */  {  7,  7 },
  154 /*  89: 0,       3, 4,    6,     */  { 12,  9 },
  155 /*  90:    1,    3, 4,    6,     */  { 13,  1 },
  156 /*  91: 0, 1,    3, 4,    6,     */  {  7,  9 },
  157 /*  92:       2, 3, 4,    6,     */  { 12, 20 },
  158 /*  93: 0,    2, 3, 4,    6,     */  {  6, 33 },
  159 /*  94:    1, 2, 3, 4,    6,     */  {  7, 13 },
  160 /*  95: 0, 1, 2, 3, 4,    6,     */  {  3, 12 },
  161 /*  96:                5, 6,     */  {  2, 10 },
  162 /*  97: 0,             5, 6,     */  {  6,  7 },
  163 /*  98:    1,          5, 6,     */  {  5, 13 },
  164 /*  99: 0, 1,          5, 6,     */  { 11,  2 },
  165 /* 100:       2,       5, 6,     */  {  5, 16 },
  166 /* 101: 0,    2,       5, 6,     */  { 12,  7 },
  167 /* 102:    1, 2,       5, 6,     */  {  8,  3 },
  168 /* 103: 0, 1, 2,       5, 6,     */  {  5, 29 },
  169 /* 104:          3,    5, 6,     */  {  6, 22 },
  170 /* 105: 0,       3,    5, 6,     */  { 10,  2 },
  171 /* 106:    1,    3,    5, 6,     */  { 12, 17 },
  172 /* 107: 0, 1,    3,    5, 6,     */  {  6, 27 },
  173 /* 108:       2, 3,    5, 6,     */  { 14,  9 },
  174 /* 109: 0,    2, 3,    5, 6,     */  {  6, 34 },
  175 /* 110:    1, 2, 3,    5, 6,     */  {  5, 39 },
  176 /* 111: 0, 1, 2, 3,    5, 6,     */  {  2, 14 },
  177 /* 112:             4, 5, 6,     */  {  5, 20 },
  178 /* 113: 0,          4, 5, 6,     */  { 14,  5 },
  179 /* 114:    1,       4, 5, 6,     */  {  9,  5 },
  180 /* 115: 0, 1,       4, 5, 6,     */  {  5, 32 },
  181 /* 116:       2,    4, 5, 6,     */  { 11, 10 },
  182 /* 117: 0,    2,    4, 5, 6,     */  {  6, 35 },
  183 /* 118:    1, 2,    4, 5, 6,     */  {  5, 41 },
  184 /* 119: 0, 1, 2,    4, 5, 6,     */  {  2, 16 },
  185 /* 120:          3, 4, 5, 6,     */  { 12, 23 },
  186 /* 121: 0,       3, 4, 5, 6,     */  {  6, 37 },
  187 /* 122:    1,    3, 4, 5, 6,     */  {  7, 14 },
  188 /* 123: 0, 1,    3, 4, 5, 6,     */  {  3, 16 },
  189 /* 124:       2, 3, 4, 5, 6,     */  {  6, 46 },
  190 /* 125: 0,    2, 3, 4, 5, 6,     */  {  4,  6 },
  191 /* 126:    1, 2, 3, 4, 5, 6,     */  {  3, 21 },
  192 /* 127: 0, 1, 2, 3, 4, 5, 6,     */  {  1,  8 },
  193 /* 128:                      7,  */  {  1,  7 },
  194 /* 129: 0,                   7,  */  {  3,  2 },
  195 /* 130:    1,                7,  */  {  4,  1 },
  196 /* 131: 0, 1,                7,  */  {  6,  1 },
  197 /* 132:       2,             7,  */  {  3,  7 },
  198 /* 133: 0,    2,             7,  */  {  7,  1 },
  199 /* 134:    1, 2,             7,  */  {  6, 10 },
  200 /* 135: 0, 1, 2,             7,  */  { 12,  0 },
  201 /* 136:          3,          7,  */  {  2,  7 },
  202 /* 137: 0,       3,          7,  */  {  5,  6 },
  203 /* 138:    1,    3,          7,  */  {  6, 12 },
  204 /* 139: 0, 1,    3,          7,  */  { 11,  1 },
  205 /* 140:       2, 3,          7,  */  {  5, 15 },
  206 /* 141: 0,    2, 3,          7,  */  {  9,  2 },
  207 /* 142:    1, 2, 3,          7,  */  { 14,  6 },
  208 /* 143: 0, 1, 2, 3,          7,  */  {  5, 27 },
  209 /* 144:             4,       7,  */  {  2,  9 },
  210 /* 145: 0,          4,       7,  */  {  5,  8 },
  211 /* 146:    1,       4,       7,  */  {  6, 13 },
  212 /* 147: 0, 1,       4,       7,  */  { 14,  2 },
  213 /* 148:       2,    4,       7,  */  {  6, 20 },
  214 /* 149: 0,    2,    4,       7,  */  { 12,  6 },
  215 /* 150:    1, 2,    4,       7,  */  { 10,  3 },
  216 /* 151: 0, 1, 2,    4,       7,  */  {  6, 25 },
  217 /* 152:          3, 4,       7,  */  {  5, 18 },
  218 /* 153: 0,       3, 4,       7,  */  {  8,  2 },
  219 /* 154:    1,    3, 4,       7,  */  { 12, 16 },
  220 /* 155: 0, 1,    3, 4,       7,  */  {  5, 31 },
  221 /* 156:       2, 3, 4,       7,  */  { 11,  9 },
  222 /* 157: 0,    2, 3, 4,       7,  */  {  5, 34 },
  223 /* 158:    1, 2, 3, 4,       7,  */  {  6, 40 },
  224 /* 159: 0, 1, 2, 3, 4,       7,  */  {  2, 13 },
  225 /* 160:                5,    7,  */  {  3, 11 },
  226 /* 161: 0,             5,    7,  */  {  7,  2 },
  227 /* 162:    1,          5,    7,  */  {  6, 14 },
  228 /* 163: 0, 1,          5,    7,  */  { 12,  3 },
  229 /* 164:       2,       5,    7,  */  {  7,  6 },
  230 /* 165: 0,    2,       5,    7,  */  { 13,  0 },
  231 /* 166:    1, 2,       5,    7,  */  { 12, 14 },
  232 /* 167: 0, 1, 2,       5,    7,  */  {  7,  8 },
  233 /* 168:          3,    5,    7,  */  {  6, 23 },
  234 /* 169: 0,       3,    5,    7,  */  { 12, 10 },
  235 /* 170:    1,    3,    5,    7,  */  { 10,  4 },
  236 /* 171: 0, 1,    3,    5,    7,  */  {  6, 28 },
  237 /* 172:       2, 3,    5,    7,  */  { 12, 21 },
  238 /* 173: 0,    2, 3,    5,    7,  */  {  7, 10 },
  239 /* 174:    1, 2, 3,    5,    7,  */  {  6, 41 },
  240 /* 175: 0, 1, 2, 3,    5,    7,  */  {  3, 13 },
  241 /* 176:             4, 5,    7,  */  {  5, 21 },
  242 /* 177: 0,          4, 5,    7,  */  {  9,  3 },
  243 /* 178:    1,       4, 5,    7,  */  { 11,  8 },
  244 /* 179: 0, 1,       4, 5,    7,  */  {  5, 33 },
  245 /* 180:       2,    4, 5,    7,  */  { 12, 22 },
  246 /* 181: 0,    2,    4, 5,    7,  */  {  7, 11 },
  247 /* 182:    1, 2,    4, 5,    7,  */  {  6, 42 },
  248 /* 183: 0, 1, 2,    4, 5,    7,  */  {  3, 14 },
  249 /* 184:          3, 4, 5,    7,  */  { 14, 11 },
  250 /* 185: 0,       3, 4, 5,    7,  */  {  5, 36 },
  251 /* 186:    1,    3, 4, 5,    7,  */  {  6, 44 },
  252 /* 187: 0, 1,    3, 4, 5,    7,  */  {  2, 17 },
  253 /* 188:       2, 3, 4, 5,    7,  */  {  6, 47 },
  254 /* 189: 0,    2, 3, 4, 5,    7,  */  {  3, 18 },
  255 /* 190:    1, 2, 3, 4, 5,    7,  */  {  4,  7 },
  256 /* 191: 0, 1, 2, 3, 4, 5,    7,  */  {  1,  9 },
  257 /* 192:                   6, 7,  */  {  2, 11 },
  258 /* 193: 0,                6, 7,  */  {  6,  8 },
  259 /* 194:    1,             6, 7,  */  {  6, 15 },
  260 /* 195: 0, 1,             6, 7,  */  { 10,  0 },
  261 /* 196:       2,          6, 7,  */  {  5, 17 },
  262 /* 197: 0,    2,          6, 7,  */  { 12,  8 },
  263 /* 198:    1, 2,          6, 7,  */  { 11,  7 },
  264 /* 199: 0, 1, 2,          6, 7,  */  {  6, 26 },
  265 /* 200:          3,       6, 7,  */  {  5, 19 },
  266 /* 201: 0,       3,       6, 7,  */  { 14,  4 },
  267 /* 202:    1,    3,       6, 7,  */  { 12, 18 },
  268 /* 203: 0, 1,    3,       6, 7,  */  {  6, 29 },
  269 /* 204:       2, 3,       6, 7,  */  {  8,  4 },
  270 /* 205: 0,    2, 3,       6, 7,  */  {  5, 35 },
  271 /* 206:    1, 2, 3,       6, 7,  */  {  5, 40 },
  272 /* 207: 0, 1, 2, 3,       6, 7,  */  {  2, 15 },
  273 /* 208:             4,    6, 7,  */  {  5, 22 },
  274 /* 209: 0,          4,    6, 7,  */  { 11,  5 },
  275 /* 210:    1,       4,    6, 7,  */  { 12, 19 },
  276 /* 211: 0, 1,       4,    6, 7,  */  {  6, 30 },
  277 /* 212:       2,    4,    6, 7,  */  { 14, 10 },
  278 /* 213: 0,    2,    4,    6, 7,  */  {  6, 36 },
  279 /* 214:    1, 2,    4,    6, 7,  */  {  6, 43 },
  280 /* 215: 0, 1, 2,    4,    6, 7,  */  {  4,  4 },
  281 /* 216:          3, 4,    6, 7,  */  {  9,  7 },
  282 /* 217: 0,       3, 4,    6, 7,  */  {  5, 37 },
  283 /* 218:    1,    3, 4,    6, 7,  */  {  7, 15 },
  284 /* 219: 0, 1,    3, 4,    6, 7,  */  {  3, 17 },
  285 /* 220:       2, 3, 4,    6, 7,  */  {  5, 44 },
  286 /* 221: 0,    2, 3, 4,    6, 7,  */  {  2, 19 },
  287 /* 222:    1, 2, 3, 4,    6, 7,  */  {  3, 22 },
  288 /* 223: 0, 1, 2, 3, 4,    6, 7,  */  {  1, 10 },
  289 /* 224:                5, 6, 7,  */  {  5, 23 },
  290 /* 225: 0,             5, 6, 7,  */  { 12, 11 },
  291 /* 226:    1,          5, 6, 7,  */  { 14,  8 },
  292 /* 227: 0, 1,          5, 6, 7,  */  {  6, 31 },
  293 /* 228:       2,       5, 6, 7,  */  {  9,  6 },
  294 /* 229: 0,    2,       5, 6, 7,  */  {  7, 12 },
  295 /* 230:    1, 2,       5, 6, 7,  */  {  5, 42 },
  296 /* 231: 0, 1, 2,       5, 6, 7,  */  {  3, 15 },
  297 /* 232:          3,    5, 6, 7,  */  { 11, 11 },
  298 /* 233: 0,       3,    5, 6, 7,  */  {  6, 38 },
  299 /* 234:    1,    3,    5, 6, 7,  */  {  6, 45 },
  300 /* 235: 0, 1,    3,    5, 6, 7,  */  {  4,  5 },
  301 /* 236:       2, 3,    5, 6, 7,  */  {  5, 45 },
  302 /* 237: 0,    2, 3,    5, 6, 7,  */  {  3, 19 },
  303 /* 238:    1, 2, 3,    5, 6, 7,  */  {  2, 21 },
  304 /* 239: 0, 1, 2, 3,    5, 6, 7,  */  {  1, 11 },
  305 /* 240:             4, 5, 6, 7,  */  {  8,  5 },
  306 /* 241: 0,          4, 5, 6, 7,  */  {  5, 38 },
  307 /* 242:    1,       4, 5, 6, 7,  */  {  5, 43 },
  308 /* 243: 0, 1,       4, 5, 6, 7,  */  {  2, 18 },
  309 /* 244:       2,    4, 5, 6, 7,  */  {  5, 46 },
  310 /* 245: 0,    2,    4, 5, 6, 7,  */  {  3, 20 },
  311 /* 246:    1, 2,    4, 5, 6, 7,  */  {  2, 22 },
  312 /* 247: 0, 1, 2,    4, 5, 6, 7,  */  {  1, 12 },
  313 /* 248:          3, 4, 5, 6, 7,  */  {  5, 47 },
  314 /* 249: 0,       3, 4, 5, 6, 7,  */  {  2, 20 },
  315 /* 250:    1,    3, 4, 5, 6, 7,  */  {  3, 23 },
  316 /* 251: 0, 1,    3, 4, 5, 6, 7,  */  {  1, 13 },
  317 /* 252:       2, 3, 4, 5, 6, 7,  */  {  2, 23 },
  318 /* 253: 0,    2, 3, 4, 5, 6, 7,  */  {  1, 14 },
  319 /* 254:    1, 2, 3, 4, 5, 6, 7,  */  {  1, 15 },
  320 /* 255: 0, 1, 2, 3, 4, 5, 6, 7,  */  {  0, -1 }
  321 };
  322 //_____________________________________________________________________________
  323 
  324 
  325 //_____________________________________________________________________________
  326 /**
  327  * \brief tiling table for case 1
  328  * For each of the case above, the specific triangulation of the edge
  329  * intersection points is given.
  330  * When a case is ambiguous, there is an auxiliary table that contains
  331  * the face number to test and the tiling table contains the specific
  332  * triangulations depending on the results
  333  * A minus sign means to invert the result of the test.
  334  */
  335 //-----------------------------------------------------------------------------
  336 static const TqInt tiling1[16][3] = {
  337 /*   1: 0,                       */  {  0,  8,  3 },
  338 /*   2:    1,                    */  {  0,  1,  9 },
  339 /*   4:       2,                 */  {  1,  2, 10 },
  340 /*   8:          3,              */  {  3, 11,  2 },
  341 /*  16:             4,           */  {  4,  7,  8 },
  342 /*  32:                5,        */  {  9,  5,  4 },
  343 /*  64:                   6,     */  { 10,  6,  5 },
  344 /* 128:                      7,  */  {  7,  6, 11 },
  345 /* 127: 0, 1, 2, 3, 4, 5, 6,     */  {  7, 11,  6 },
  346 /* 191: 0, 1, 2, 3, 4, 5,    7,  */  { 10,  5,  6 },
  347 /* 223: 0, 1, 2, 3, 4,    6, 7,  */  {  9,  4,  5 },
  348 /* 239: 0, 1, 2, 3,    5, 6, 7,  */  {  4,  8,  7 },
  349 /* 247: 0, 1, 2,    4, 5, 6, 7,  */  {  3,  2, 11 },
  350 /* 251: 0, 1,    3, 4, 5, 6, 7,  */  {  1, 10,  2 },
  351 /* 253: 0,    2, 3, 4, 5, 6, 7,  */  {  0,  9,  1 },
  352 /* 254:    1, 2, 3, 4, 5, 6, 7,  */  {  0,  3,  8 }
  353 };
  354 //_____________________________________________________________________________
  355 
  356 
  357 //_____________________________________________________________________________
  358 /**
  359  * \brief tiling table for case 2
  360  * For each of the case above, the specific triangulation of the edge
  361  * intersection points is given.
  362  * When a case is ambiguous, there is an auxiliary table that contains
  363  * the face number to test and the tiling table contains the specific
  364  * triangulations depending on the results
  365  * A minus sign means to invert the result of the test.
  366  */
  367 //-----------------------------------------------------------------------------
  368 static const TqInt tiling2[24][6] = {
  369 /*   3: 0, 1,                    */  {  1,  8,  3,  9,  8,  1 },
  370 /*   9: 0,       3,              */  {  0, 11,  2,  8, 11,  0 },
  371 /*  17: 0,          4,           */  {  4,  3,  0,  7,  3,  4 },
  372 /*   6:    1, 2,                 */  {  9,  2, 10,  0,  2,  9 },
  373 /*  34:    1,          5,        */  {  0,  5,  4,  1,  5,  0 },
  374 /*  12:       2, 3,              */  {  3, 10,  1, 11, 10,  3 },
  375 /*  68:       2,          6,     */  {  1,  6,  5,  2,  6,  1 },
  376 /* 136:          3,          7,  */  {  7,  2,  3,  6,  2,  7 },
  377 /*  48:             4, 5,        */  {  9,  7,  8,  5,  7,  9 },
  378 /* 144:             4,       7,  */  {  6,  8,  4, 11,  8,  6 },
  379 /*  96:                5, 6,     */  { 10,  4,  9,  6,  4, 10 },
  380 /* 192:                   6, 7,  */  { 11,  5, 10,  7,  5, 11 },
  381 /*  63: 0, 1, 2, 3, 4, 5,        */  { 11, 10,  5,  7, 11,  5 },
  382 /* 159: 0, 1, 2, 3, 4,       7,  */  { 10,  9,  4,  6, 10,  4 },
  383 /* 111: 0, 1, 2, 3,    5, 6,     */  {  6,  4,  8, 11,  6,  8 },
  384 /* 207: 0, 1, 2, 3,       6, 7,  */  {  9,  8,  7,  5,  9,  7 },
  385 /* 119: 0, 1, 2,    4, 5, 6,     */  {  7,  3,  2,  6,  7,  2 },
  386 /* 187: 0, 1,    3, 4, 5,    7,  */  {  1,  5,  6,  2,  1,  6 },
  387 /* 243: 0, 1,       4, 5, 6, 7,  */  {  3,  1, 10, 11,  3, 10 },
  388 /* 221: 0,    2, 3, 4,    6, 7,  */  {  0,  4,  5,  1,  0,  5 },
  389 /* 249: 0,       3, 4, 5, 6, 7,  */  {  9, 10,  2,  0,  9,  2 },
  390 /* 238:    1, 2, 3,    5, 6, 7,  */  {  4,  0,  3,  7,  4,  3 },
  391 /* 246:    1, 2,    4, 5, 6, 7,  */  {  0,  2, 11,  8,  0, 11 },
  392 /* 252:       2, 3, 4, 5, 6, 7,  */  {  1,  3,  8,  9,  1,  8 }
  393 };
  394 //_____________________________________________________________________________
  395 
  396 //_____________________________________________________________________________
  397 /**
  398  * \brief test table for case 3
  399  * One face to test
  400  * When the test on the specified face is positive : 4 first triangles
  401  * When the test on the specified face is negative : 2 last triangles
  402  *
  403  * For each of the case above, the specific triangulation of the edge
  404  * intersection points is given.
  405  * When a case is ambiguous, there is an auxiliary table that contains
  406  * the face number to test and the tiling table contains the specific
  407  * triangulations depending on the results
  408  * A minus sign means to invert the result of the test.
  409  */
  410 //-----------------------------------------------------------------------------
  411 static const TqInt test3[24] = {
  412 /*   5: 0,    2,                 */    5,
  413 /*  33: 0,             5,        */    1,
  414 /* 129: 0,                   7,  */    4,
  415 /*  10:    1,    3,              */    5,
  416 /*  18:    1,       4,           */    1,
  417 /*  66:    1,             6,     */    2,
  418 /*  36:       2,       5,        */    2,
  419 /* 132:       2,             7,  */    3,
  420 /*  24:          3, 4,           */    4,
  421 /*  72:          3,       6,     */    3,
  422 /*  80:             4,    6,     */    6,
  423 /* 160:                5,    7,  */    6,
  424 /*  95: 0, 1, 2, 3, 4,    6,     */   -6,
  425 /* 175: 0, 1, 2, 3,    5,    7,  */   -6,
  426 /* 183: 0, 1, 2,    4, 5,    7,  */   -3,
  427 /* 231: 0, 1, 2,       5, 6, 7,  */   -4,
  428 /* 123: 0, 1,    3, 4, 5, 6,     */   -3,
  429 /* 219: 0, 1,    3, 4,    6, 7,  */   -2,
  430 /* 189: 0,    2, 3, 4, 5,    7,  */   -2,
  431 /* 237: 0,    2, 3,    5, 6, 7,  */   -1,
  432 /* 245: 0,    2,    4, 5, 6, 7,  */   -5,
  433 /* 126:    1, 2, 3, 4, 5, 6,     */   -4,
  434 /* 222:    1, 2, 3, 4,    6, 7,  */   -1,
  435 /* 250:    1,    3, 4, 5, 6, 7,  */   -5
  436 };
  437 
  438 //_____________________________________________________________________________
  439 /**
  440  * \brief tiling table for case 3.1
  441  * For each of the case above, the specific triangulation of the edge
  442  * intersection points is given.
  443  * When a case is ambiguous, there is an auxiliary table that contains
  444  * the face number to test and the tiling table contains the specific
  445  * triangulations depending on the results
  446  * A minus sign means to invert the result of the test.
  447  */
  448 //-----------------------------------------------------------------------------
  449 static const TqInt tiling3_1[24][6] = {
  450 /*   5: 0,    2,                 */  {  0,  8,  3,  1,  2, 10 },
  451 /*  33: 0,             5,        */  {  9,  5,  4,  0,  8,  3 },
  452 /* 129: 0,                   7,  */  {  3,  0,  8, 11,  7,  6 },
  453 /*  10:    1,    3,              */  {  1,  9,  0,  2,  3, 11 },
  454 /*  18:    1,       4,           */  {  0,  1,  9,  8,  4,  7 },
  455 /*  66:    1,             6,     */  {  9,  0,  1,  5, 10,  6 },
  456 /*  36:       2,       5,        */  {  1,  2, 10,  9,  5,  4 },
  457 /* 132:       2,             7,  */  { 10,  1,  2,  6, 11,  7 },
  458 /*  24:          3, 4,           */  {  8,  4,  7,  3, 11,  2 },
  459 /*  72:          3,       6,     */  {  2,  3, 11, 10,  6,  5 },
  460 /*  80:             4,    6,     */  {  5, 10,  6,  4,  7,  8 },
  461 /* 160:                5,    7,  */  {  4,  9,  5,  7,  6, 11 },
  462 /*  95: 0, 1, 2, 3, 4,    6,     */  {  5,  9,  4, 11,  6,  7 },
  463 /* 175: 0, 1, 2, 3,    5,    7,  */  {  6, 10,  5,  8,  7,  4 },
  464 /* 183: 0, 1, 2,    4, 5,    7,  */  { 11,  3,  2,  5,  6, 10 },
  465 /* 231: 0, 1, 2,       5, 6, 7,  */  {  7,  4,  8,  2, 11,  3 },
  466 /* 123: 0, 1,    3, 4, 5, 6,     */  {  2,  1, 10,  7, 11,  6 },
  467 /* 219: 0, 1,    3, 4,    6, 7,  */  { 10,  2,  1,  4,  5,  9 },
  468 /* 189: 0,    2, 3, 4, 5,    7,  */  {  1,  0,  9,  6, 10,  5 },
  469 /* 237: 0,    2, 3,    5, 6, 7,  */  {  9,  1,  0,  7,  4,  8 },
  470 /* 245: 0,    2,    4, 5, 6, 7,  */  {  0,  9,  1, 11,  3,  2 },
  471 /* 126:    1, 2, 3, 4, 5, 6,     */  {  8,  0,  3,  6,  7, 11 },
  472 /* 222:    1, 2, 3, 4,    6, 7,  */  {  4,  5,  9,  3,  8,  0 },
  473 /* 250:    1,    3, 4, 5, 6, 7,  */  {  3,  8,  0, 10,  2,  1 }
  474 };
  475 
  476 //_____________________________________________________________________________
  477 /**
  478  * \brief tiling table for case 3.2
  479  * For each of the case above, the specific triangulation of the edge
  480  * intersection points is given.
  481  * When a case is ambiguous, there is an auxiliary table that contains
  482  * the face number to test and the tiling table contains the specific
  483  * triangulations depending on the results
  484  * A minus sign means to invert the result of the test.
  485  */
  486 //-----------------------------------------------------------------------------
  487 static const TqInt tiling3_2[24][12] = {
  488 /*   5: 0,    2,                 */  { 10,  3,  2, 10,  8,  3, 10,  1,  0,  8, 10,  0 },
  489 /*  33: 0,             5,        */  {  3,  4,  8,  3,  5,  4,  3,  0,  9,  5,  3,  9 },
  490 /* 129: 0,                   7,  */  {  6,  8,  7,  6,  0,  8,  6, 11,  3,  0,  6,  3 },
  491 /*  10:    1,    3,              */  { 11,  0,  3, 11,  9,  0, 11,  2,  1,  9, 11,  1 },
  492 /*  18:    1,       4,           */  {  7,  9,  4,  7,  1,  9,  7,  8,  0,  1,  7,  0 },
  493 /*  66:    1,             6,     */  {  6,  1, 10,  6,  0,  1,  9,  0,  6,  9,  6,  5 },
  494 /*  36:       2,       5,        */  {  4, 10,  5,  4,  2, 10,  4,  9,  1,  2,  4,  1 },
  495 /* 132:       2,             7,  */  {  7,  2, 11,  7,  1,  2,  7,  6, 10,  1,  7, 10 },
  496 /*  24:          3, 4,           */  {  2,  7, 11,  2,  4,  7,  2,  3,  8,  4,  2,  8 },
  497 /*  72:          3,       6,     */  {  5, 11,  6,  5,  3, 11,  5, 10,  2,  3,  5,  2 },
  498 /*  80:             4,    6,     */  {  8,  6,  7,  8, 10,  6,  8,  4,  5, 10,  8,  5 },
  499 /* 160:                5,    7,  */  { 11,  5,  6, 11,  9,  5, 11,  7,  4,  9, 11,  4 },
  500 /*  95: 0, 1, 2, 3, 4,    6,     */  {  6,  5, 11,  5,  9, 11,  4,  7, 11,  4, 11,  9 },
  501 /* 175: 0, 1, 2, 3,    5,    7,  */  {  7,  6,  8,  6, 10,  8,  5,  4,  8,  5,  8, 10 },
  502 /* 183: 0, 1, 2,    4, 5,    7,  */  {  6, 11,  5, 11,  3,  5,  2, 10,  5,  2,  5,  3 },
  503 /* 231: 0, 1, 2,       5, 6, 7,  */  { 11,  7,  2,  7,  4,  2,  8,  3,  2,  8,  2,  4 },
  504 /* 123: 0, 1,    3, 4, 5, 6,     */  { 11,  2,  7,  2,  1,  7, 10,  6,  7, 10,  7,  1 },
  505 /* 219: 0, 1,    3, 4,    6, 7,  */  {  5, 10,  4, 10,  2,  4,  1,  9,  4,  1,  4,  2 },
  506 /* 189: 0,    2, 3, 4, 5,    7,  */  { 10,  1,  6,  1,  0,  6,  6,  0,  9,  5,  6,  9 },
  507 /* 237: 0,    2, 3,    5, 6, 7,  */  {  4,  9,  7,  9,  1,  7,  0,  8,  7,  0,  7,  1 },
  508 /* 245: 0,    2,    4, 5, 6, 7,  */  {  3,  0, 11,  0,  9, 11,  1,  2, 11,  1, 11,  9 },
  509 /* 126:    1, 2, 3, 4, 5, 6,     */  {  7,  8,  6,  8,  0,  6,  3, 11,  6,  3,  6,  0 },
  510 /* 222:    1, 2, 3, 4,    6, 7,  */  {  8,  4,  3,  4,  5,  3,  9,  0,  3,  9,  3,  5 },
  511 /* 250:    1,    3, 4, 5, 6, 7,  */  {  2,  3, 10,  3,  8, 10,  0,  1, 10,  0, 10,  8 }
  512 };
  513 //_____________________________________________________________________________
  514 
  515 
  516 
  517 //_____________________________________________________________________________
  518 /**
  519  * \brief test table for case 4
  520  * Interior to test
  521  * When the test on the interior is negative : 2 first triangles
  522  * When the test on the interior is positive : 6 last triangles
  523  *
  524  * For each of the case above, the specific triangulation of the edge
  525  * intersection points is given.
  526  * When a case is ambiguous, there is an auxiliary table that contains
  527  * the face number to test and the tiling table contains the specific
  528  * triangulations depending on the results
  529  * A minus sign means to invert the result of the test.
  530  */
  531 //-----------------------------------------------------------------------------
  532 static const TqInt test4[8] = {
  533 /*  65: 0,                6,     */   7,
  534 /* 130:    1,                7,  */   7,
  535 /*  20:       2,    4,           */   7,
  536 /*  40:          3,    5,        */   7,
  537 /* 215: 0, 1, 2,    4,    6, 7,  */  -7,
  538 /* 235: 0, 1,    3,    5, 6, 7,  */  -7,
  539 /* 125: 0,    2, 3, 4, 5, 6,     */  -7,
  540 /* 190:    1, 2, 3, 4, 5,    7,  */  -7
  541 };
  542 
  543 //_____________________________________________________________________________
  544 /**
  545  * \brief tiling table for case 4.1
  546  * For each of the case above, the specific triangulation of the edge
  547  * intersection points is given.
  548  * When a case is ambiguous, there is an auxiliary table that contains
  549  * the face number to test and the tiling table contains the specific
  550  * triangulations depending on the results
  551  * A minus sign means to invert the result of the test.
  552  */
  553 //-----------------------------------------------------------------------------
  554 static const TqInt tiling4_1[8][6] = {
  555 /*  65: 0,                6,     */  {  0,  8,  3,  5, 10,  6 },
  556 /* 130:    1,                7,  */  {  0,  1,  9, 11,  7,  6 },
  557 /*  20:       2,    4,           */  {  1,  2, 10,  8,  4,  7 },
  558 /*  40:          3,    5,        */  {  9,  5,  4,  2,  3, 11 },
  559 /* 215: 0, 1, 2,    4,    6, 7,  */  {  4,  5,  9, 11,  3,  2 },
  560 /* 235: 0, 1,    3,    5, 6, 7,  */  { 10,  2,  1,  7,  4,  8 },
  561 /* 125: 0,    2, 3, 4, 5, 6,     */  {  9,  1,  0,  6,  7, 11 },
  562 /* 190:    1, 2, 3, 4, 5,    7,  */  {  3,  8,  0,  6, 10,  5 }
  563 };
  564 
  565 //_____________________________________________________________________________
  566 /**
  567  * \brief tiling table for case 4.2
  568  * For each of the case above, the specific triangulation of the edge
  569  * intersection points is given.
  570  * When a case is ambiguous, there is an auxiliary table that contains
  571  * the face number to test and the tiling table contains the specific
  572  * triangulations depending on the results
  573  * A minus sign means to invert the result of the test.
  574  */
  575 //-----------------------------------------------------------------------------
  576 static const TqInt tiling4_2[8][18] = {
  577 /*  65: 0,                6,     */  {  8,  5,  0,  5,  8,  6,  3,  6,  8,  6,  3, 10,  0, 10,  3, 10,  0,  5 },
  578 /* 130:    1,                7,  */  {  9,  6,  1,  6,  9,  7,  0,  7,  9,  7,  0, 11,  1, 11,  0, 11,  1,  6 },
  579 /*  20:       2,    4,           */  { 10,  7,  2,  7, 10,  4,  1,  4, 10,  4,  1,  8,  2,  8,  1,  8,  2,  7 },
  580 /*  40:          3,    5,        */  { 11,  4,  3,  4, 11,  5,  2,  5, 11,  5,  2,  9,  3,  9,  2,  9,  3,  4 },
  581 /* 215: 0, 1, 2,    4,    6, 7,  */  {  3,  4, 11,  5, 11,  4, 11,  5,  2,  9,  2,  5,  2,  9,  3,  4,  3,  9 },
  582 /* 235: 0, 1,    3,    5, 6, 7,  */  {  2,  7, 10,  4, 10,  7, 10,  4,  1,  8,  1,  4,  1,  8,  2,  7,  2,  8 },
  583 /* 125: 0,    2, 3, 4, 5, 6,     */  {  1,  6,  9,  7,  9,  6,  9,  7,  0, 11,  0,  7,  0, 11,  1,  6,  1, 11 },
  584 /* 190:    1, 2, 3, 4, 5,    7,  */  {  0,  5,  8,  6,  8,  5,  8,  6,  3, 10,  3,  6,  3, 10,  0,  5,  0, 10 }
  585 };
  586 //_____________________________________________________________________________
  587 
  588 
  589 //_____________________________________________________________________________
  590 /**
  591  * \brief tiling table for case 5
  592  * For each of the case above, the specific triangulation of the edge
  593  * intersection points is given.
  594  * When a case is ambiguous, there is an auxiliary table that contains
  595  * the face number to test and the tiling table contains the specific
  596  * triangulations depending on the results
  597  * A minus sign means to invert the result of the test.
  598  */
  599 //-----------------------------------------------------------------------------
  600 static const TqInt tiling5[48][9] = {
  601 /*   7: 0, 1, 2,                 */  {  2,  8,  3,  2, 10,  8, 10,  9,  8 },
  602 /*  11: 0, 1,    3,              */  {  1, 11,  2,  1,  9, 11,  9,  8, 11 },
  603 /*  19: 0, 1,       4,           */  {  4,  1,  9,  4,  7,  1,  7,  3,  1 },
  604 /*  35: 0, 1,          5,        */  {  8,  5,  4,  8,  3,  5,  3,  1,  5 },
  605 /*  13: 0,    2, 3,              */  {  0, 10,  1,  0,  8, 10,  8, 11, 10 },
  606 /*  25: 0,       3, 4,           */  { 11,  4,  7, 11,  2,  4,  2,  0,  4 },
  607 /* 137: 0,       3,          7,  */  {  7,  0,  8,  7,  6,  0,  6,  2,  0 },
  608 /*  49: 0,          4, 5,        */  {  9,  3,  0,  9,  5,  3,  5,  7,  3 },
  609 /* 145: 0,          4,       7,  */  {  3,  6, 11,  3,  0,  6,  0,  4,  6 },
  610 /*  14:    1, 2, 3,              */  {  3,  9,  0,  3, 11,  9, 11, 10,  9 },
  611 /*  38:    1, 2,       5,        */  {  5,  2, 10,  5,  4,  2,  4,  0,  2 },
  612 /*  70:    1, 2,          6,     */  {  9,  6,  5,  9,  0,  6,  0,  2,  6 },
  613 /*  50:    1,       4, 5,        */  {  0,  7,  8,  0,  1,  7,  1,  5,  7 },
  614 /*  98:    1,          5, 6,     */  { 10,  0,  1, 10,  6,  0,  6,  4,  0 },
  615 /*  76:       2, 3,       6,     */  {  6,  3, 11,  6,  5,  3,  5,  1,  3 },
  616 /* 140:       2, 3,          7,  */  { 10,  7,  6, 10,  1,  7,  1,  3,  7 },
  617 /* 100:       2,       5, 6,     */  {  1,  4,  9,  1,  2,  4,  2,  6,  4 },
  618 /* 196:       2,          6, 7,  */  { 11,  1,  2, 11,  7,  1,  7,  5,  1 },
  619 /* 152:          3, 4,       7,  */  {  8,  2,  3,  8,  4,  2,  4,  6,  2 },
  620 /* 200:          3,       6, 7,  */  {  2,  5, 10,  2,  3,  5,  3,  7,  5 },
  621 /* 112:             4, 5, 6,     */  {  7, 10,  6,  7,  8, 10,  8,  9, 10 },
  622 /* 176:             4, 5,    7,  */  {  6,  9,  5,  6, 11,  9, 11,  8,  9 },
  623 /* 208:             4,    6, 7,  */  {  5,  8,  4,  5, 10,  8, 10, 11,  8 },
  624 /* 224:                5, 6, 7,  */  {  4, 11,  7,  4,  9, 11,  9, 10, 11 },
  625 /*  31: 0, 1, 2, 3, 4,           */  {  4,  7, 11,  4, 11,  9,  9, 11, 10 },
  626 /*  47: 0, 1, 2, 3,    5,        */  {  5,  4,  8,  5,  8, 10, 10,  8, 11 },
  627 /*  79: 0, 1, 2, 3,       6,     */  {  6,  5,  9,  6,  9, 11, 11,  9,  8 },
  628 /* 143: 0, 1, 2, 3,          7,  */  {  7,  6, 10,  7, 10,  8,  8, 10,  9 },
  629 /*  55: 0, 1, 2,    4, 5,        */  {  2, 10,  5,  2,  5,  3,  3,  5,  7 },
  630 /* 103: 0, 1, 2,       5, 6,     */  {  8,  3,  2,  8,  2,  4,  4,  2,  6 },
  631 /*  59: 0, 1,    3, 4, 5,        */  { 11,  2,  1, 11,  1,  7,  7,  1,  5 },
  632 /* 155: 0, 1,    3, 4,       7,  */  {  1,  9,  4,  1,  4,  2,  2,  4,  6 },
  633 /* 115: 0, 1,       4, 5, 6,     */  { 10,  6,  7, 10,  7,  1,  1,  7,  3 },
  634 /* 179: 0, 1,       4, 5,    7,  */  {  6, 11,  3,  6,  3,  5,  5,  3,  1 },
  635 /* 157: 0,    2, 3, 4,       7,  */  { 10,  1,  0, 10,  0,  6,  6,  0,  4 },
  636 /* 205: 0,    2, 3,       6, 7,  */  {  0,  8,  7,  0,  7,  1,  1,  7,  5 },
  637 /* 185: 0,       3, 4, 5,    7,  */  {  9,  5,  6,  9,  6,  0,  0,  6,  2 },
  638 /* 217: 0,       3, 4,    6, 7,  */  {  5, 10,  2,  5,  2,  4,  4,  2,  0 },
  639 /* 241: 0,          4, 5, 6, 7,  */  {  3,  0,  9,  3,  9, 11, 11,  9, 10 },
  640 /* 110:    1, 2, 3,    5, 6,     */  {  3, 11,  6,  3,  6,  0,  0,  6,  4 },
  641 /* 206:    1, 2, 3,       6, 7,  */  {  9,  0,  3,  9,  3,  5,  5,  3,  7 },
  642 /* 118:    1, 2,    4, 5, 6,     */  {  7,  8,  0,  7,  0,  6,  6,  0,  2 },
  643 /* 230:    1, 2,       5, 6, 7,  */  { 11,  7,  4, 11,  4,  2,  2,  4,  0 },
  644 /* 242:    1,       4, 5, 6, 7,  */  {  0,  1, 10,  0, 10,  8,  8, 10, 11 },
  645 /* 220:       2, 3, 4,    6, 7,  */  {  8,  4,  5,  8,  5,  3,  3,  5,  1 },
  646 /* 236:       2, 3,    5, 6, 7,  */  {  4,  9,  1,  4,  1,  7,  7,  1,  3 },
  647 /* 244:       2,    4, 5, 6, 7,  */  {  1,  2, 11,  1, 11,  9,  9, 11,  8 },
  648 /* 248:          3, 4, 5, 6, 7,  */  {  2,  3,  8,  2,  8, 10, 10,  8,  9 }
  649 };
  650 //_____________________________________________________________________________
  651 
  652 
  653 //_____________________________________________________________________________
  654 /**
  655  * \brief test table for case 6
  656  * 1 face to test + eventually the interior
  657  * When the test on the specified face is positive : 5 first triangles
  658  * When the test on the specified face is negative :
  659  * - if the test on the interior is negative : 3 middle triangles
  660  * - if the test on the interior is positive : 8 last triangles
  661  * The support edge for the interior test is marked as the 3rd column.
  662  *
  663  * For each of the case above, the specific triangulation of the edge
  664  * intersection points is given.
  665  * When a case is ambiguous, there is an auxiliary table that contains
  666  * the face number to test and the tiling table contains the specific
  667  * triangulations depending on the results
  668  * A minus sign means to invert the result of the test.
  669  */
  670 //-----------------------------------------------------------------------------
  671 static const TqInt test6[48][3] = {
  672 /*  67: 0, 1,             6,     */  {  2,  7,  10  },
  673 /* 131: 0, 1,                7,  */  {  4,  7,  11  },
  674 /*  21: 0,    2,    4,           */  {  5,  7,   1  },
  675 /*  69: 0,    2,          6,     */  {  5,  7,   3  },
  676 /*  41: 0,       3,    5,        */  {  1,  7,   9  },
  677 /*  73: 0,       3,       6,     */  {  3,  7,  10  },
  678 /*  81: 0,          4,    6,     */  {  6,  7,   5  },
  679 /*  97: 0,             5, 6,     */  {  1,  7,   8  },
  680 /* 193: 0,                6, 7,  */  {  4,  7,   8  },
  681 /*  22:    1, 2,    4,           */  {  1,  7,   8  },
  682 /* 134:    1, 2,             7,  */  {  3,  7,  11  },
  683 /*  42:    1,    3,    5,        */  {  5,  7,   2  },
  684 /* 138:    1,    3,          7,  */  {  5,  7,   0  },
  685 /* 146:    1,       4,       7,  */  {  1,  7,   9  },
  686 /* 162:    1,          5,    7,  */  {  6,  7,   6  },
  687 /* 194:    1,             6, 7,  */  {  2,  7,   9  },
  688 /*  28:       2, 3, 4,           */  {  4,  7,   8  },
  689 /*  44:       2, 3,    5,        */  {  2,  7,   9  },
  690 /*  52:       2,    4, 5,        */  {  2,  7,  10  },
  691 /*  84:       2,    4,    6,     */  {  6,  7,   7  },
  692 /* 148:       2,    4,       7,  */  {  3,  7,  10  },
  693 /*  56:          3, 4, 5,        */  {  4,  7,  11  },
  694 /* 104:          3,    5, 6,     */  {  3,  7,  11  },
  695 /* 168:          3,    5,    7,  */  {  6,  7,   4  },
  696 /*  87: 0, 1, 2,    4,    6,     */  { -6, -7,   4  },
  697 /* 151: 0, 1, 2,    4,       7,  */  { -3, -7,  11  },
  698 /* 199: 0, 1, 2,          6, 7,  */  { -4, -7,  11  },
  699 /* 107: 0, 1,    3,    5, 6,     */  { -3, -7,  10  },
  700 /* 171: 0, 1,    3,    5,    7,  */  { -6, -7,   7  },
  701 /* 203: 0, 1,    3,       6, 7,  */  { -2, -7,  10  },
  702 /* 211: 0, 1,       4,    6, 7,  */  { -2, -7,   9  },
  703 /* 227: 0, 1,          5, 6, 7,  */  { -4, -7,   8  },
  704 /*  61: 0,    2, 3, 4, 5,        */  { -2, -7,   9  },
  705 /*  93: 0,    2, 3, 4,    6,     */  { -6, -7,   6  },
  706 /* 109: 0,    2, 3,    5, 6,     */  { -1, -7,   9  },
  707 /* 117: 0,    2,    4, 5, 6,     */  { -5, -7,   0  },
  708 /* 213: 0,    2,    4,    6, 7,  */  { -5, -7,   2  },
  709 /* 121: 0,       3, 4, 5, 6,     */  { -3, -7,  11  },
  710 /* 233: 0,       3,    5, 6, 7,  */  { -1, -7,   8  },
  711 /*  62:    1, 2, 3, 4, 5,        */  { -4, -7,   8  },
  712 /* 158:    1, 2, 3, 4,       7,  */  { -1, -7,   8  },
  713 /* 174:    1, 2, 3,    5,    7,  */  { -6, -7,   5  },
  714 /* 182:    1, 2,    4, 5,    7,  */  { -3, -7,  10  },
  715 /* 214:    1, 2,    4,    6, 7,  */  { -1, -7,   9  },
  716 /* 186:    1,    3, 4, 5,    7,  */  { -5, -7,   3  },
  717 /* 234:    1,    3,    5, 6, 7,  */  { -5, -7,   1  },
  718 /* 124:       2, 3, 4, 5, 6,     */  { -4, -7,  11  },
  719 /* 188:       2, 3, 4, 5,    7,  */  { -2, -7,  10  }
  720 };
  721 
  722 //_____________________________________________________________________________
  723 /**
  724  * \brief tiling table for case 6.1.1
  725  * For each of the case above, the specific triangulation of the edge
  726  * intersection points is given.
  727  * When a case is ambiguous, there is an auxiliary table that contains
  728  * the face number to test and the tiling table contains the specific
  729  * triangulations depending on the results
  730  * A minus sign means to invert the result of the test.
  731  */
  732 //-----------------------------------------------------------------------------
  733 static const TqInt tiling6_1_1[48][9] = {
  734 /*  67: 0, 1,             6,     */  {  6,  5, 10,  3,  1,  8,  9,  8,  1 },
  735 /* 131: 0, 1,                7,  */  { 11,  7,  6,  9,  3,  1,  3,  9,  8 },
  736 /*  21: 0,    2,    4,           */  {  1,  2, 10,  7,  0,  4,  0,  7,  3 },
  737 /*  69: 0,    2,          6,     */  {  3,  0,  8,  5,  2,  6,  2,  5,  1 },
  738 /*  41: 0,       3,    5,        */  {  5,  4,  9,  2,  0, 11,  8, 11,  0 },
  739 /*  73: 0,       3,       6,     */  { 10,  6,  5,  8,  2,  0,  2,  8, 11 },
  740 /*  81: 0,          4,    6,     */  { 10,  6,  5,  0,  4,  3,  7,  3,  4 },
  741 /*  97: 0,             5, 6,     */  {  3,  0,  8,  6,  4, 10,  9, 10,  4 },
  742 /* 193: 0,                6, 7,  */  {  8,  3,  0, 10,  7,  5,  7, 10, 11 },
  743 /*  22:    1, 2,    4,           */  {  8,  4,  7, 10,  0,  2,  0, 10,  9 },
  744 /* 134:    1, 2,             7,  */  {  7,  6, 11,  0,  2,  9, 10,  9,  2 },
  745 /*  42:    1,    3,    5,        */  {  2,  3, 11,  4,  1,  5,  1,  4,  0 },
  746 /* 138:    1,    3,          7,  */  {  0,  1,  9,  6,  3,  7,  3,  6,  2 },
  747 /* 146:    1,       4,       7,  */  {  9,  0,  1, 11,  4,  6,  4, 11,  8 },
  748 /* 162:    1,          5,    7,  */  { 11,  7,  6,  1,  5,  0,  4,  0,  5 },
  749 /* 194:    1,             6, 7,  */  {  0,  1,  9,  7,  5, 11, 10, 11,  5 },
  750 /*  28:       2, 3, 4,           */  {  4,  7,  8,  1,  3, 10, 11, 10,  3 },
  751 /*  44:       2, 3,    5,        */  {  9,  5,  4, 11,  1,  3,  1, 11, 10 },
  752 /*  52:       2,    4, 5,        */  { 10,  1,  2,  8,  5,  7,  5,  8,  9 },
  753 /*  84:       2,    4,    6,     */  {  8,  4,  7,  2,  6,  1,  5,  1,  6 },
  754 /* 148:       2,    4,       7,  */  {  1,  2, 10,  4,  6,  8, 11,  8,  6 },
  755 /*  56:          3, 4, 5,        */  {  2,  3, 11,  5,  7,  9,  8,  9,  7 },
  756 /* 104:          3,    5, 6,     */  { 11,  2,  3,  9,  6,  4,  6,  9, 10 },
  757 /* 168:          3,    5,    7,  */  {  9,  5,  4,  3,  7,  2,  6,  2,  7 },
  758 /*  87: 0, 1, 2,    4,    6,     */  {  4,  5,  9,  2,  7,  3,  7,  2,  6 },
  759 /* 151: 0, 1, 2,    4,       7,  */  {  3,  2, 11,  4,  6,  9, 10,  9,  6 },
  760 /* 199: 0, 1, 2,          6, 7,  */  { 11,  3,  2,  9,  7,  5,  7,  9,  8 },
  761 /* 107: 0, 1,    3,    5, 6,     */  { 10,  2,  1,  8,  6,  4,  6,  8, 11 },
  762 /* 171: 0, 1,    3,    5,    7,  */  {  7,  4,  8,  1,  6,  2,  6,  1,  5 },
  763 /* 203: 0, 1,    3,       6, 7,  */  {  2,  1, 10,  7,  5,  8,  9,  8,  5 },
  764 /* 211: 0, 1,       4,    6, 7,  */  {  4,  5,  9,  3,  1, 11, 10, 11,  1 },
  765 /* 227: 0, 1,          5, 6, 7,  */  {  8,  7,  4, 10,  3,  1,  3, 10, 11 },
  766 /*  61: 0,    2, 3, 4, 5,        */  {  9,  1,  0, 11,  5,  7,  5, 11, 10 },
  767 /*  93: 0,    2, 3, 4,    6,     */  {  6,  7, 11,  0,  5,  1,  5,  0,  4 },
  768 /* 109: 0,    2, 3,    5, 6,     */  {  1,  0,  9,  6,  4, 11,  8, 11,  4 },
  769 /* 117: 0,    2,    4, 5, 6,     */  {  9,  1,  0,  7,  3,  6,  2,  6,  3 },
  770 /* 213: 0,    2,    4,    6, 7,  */  { 11,  3,  2,  5,  1,  4,  0,  4,  1 },
  771 /* 121: 0,       3, 4, 5, 6,     */  { 11,  6,  7,  9,  2,  0,  2,  9, 10 },
  772 /* 233: 0,       3,    5, 6, 7,  */  {  7,  4,  8,  2,  0, 10,  9, 10,  0 },
  773 /*  62:    1, 2, 3, 4, 5,        */  {  0,  3,  8,  5,  7, 10, 11, 10,  7 },
  774 /* 158:    1, 2, 3, 4,       7,  */  {  8,  0,  3, 10,  4,  6,  4, 10,  9 },
  775 /* 174:    1, 2, 3,    5,    7,  */  {  5,  6, 10,  3,  4,  0,  4,  3,  7 },
  776 /* 182:    1, 2,    4, 5,    7,  */  {  5,  6, 10,  0,  2,  8, 11,  8,  2 },
  777 /* 214:    1, 2,    4,    6, 7,  */  {  9,  4,  5, 11,  0,  2,  0, 11,  8 },
  778 /* 186:    1,    3, 4, 5,    7,  */  {  8,  0,  3,  6,  2,  5,  1,  5,  2 },
  779 /* 234:    1,    3,    5, 6, 7,  */  { 10,  2,  1,  4,  0,  7,  3,  7,  0 },
  780 /* 124:       2, 3, 4, 5, 6,     */  {  6,  7, 11,  1,  3,  9,  8,  9,  3 },
  781 /* 188:       2, 3, 4, 5,    7,  */  { 10,  5,  6,  8,  1,  3,  1,  8,  9 }
  782 };
  783 
  784 //_____________________________________________________________________________
  785 /**
  786  * \brief tiling table for case 6.1.2
  787  * For each of the case above, the specific triangulation of the edge
  788  * intersection points is given.
  789  * When a case is ambiguous, there is an auxiliary table that contains
  790  * the face number to test and the tiling table contains the specific
  791  * triangulations depending on the results
  792  * A minus sign means to invert the result of the test.
  793  */
  794 //-----------------------------------------------------------------------------
  795 static const TqInt tiling6_1_2[48][21] = {
  796 /*  67: 0, 1,             6,     */  {  1, 10,  3,  6,  3, 10,  3,  6,  8,  5,  8,  6,  8,  5,  9,  1,  9,  5, 10,  1,  5 },
  797 /* 131: 0, 1,                7,  */  {  1, 11,  3, 11,  1,  6,  9,  6,  1,  6,  9,  7,  8,  7,  9,  7,  8,  3,  7,  3, 11 },
  798 /*  21: 0,    2,    4,           */  {  4,  1,  0,  1,  4, 10,  7, 10,  4, 10,  7,  2,  3,  2,  7,  2,  3,  0,  2,  0,  1 },
  799 /*  69: 0,    2,          6,     */  {  6,  3,  2,  3,  6,  8,  5,  8,  6,  8,  5,  0,  1,  0,  5,  0,  1,  2,  0,  2,  3 },
  800 /*  41: 0,       3,    5,        */  {  0,  9,  2,  5,  2,  9,  2,  5, 11,  4, 11,  5, 11,  4,  8,  0,  8,  4,  9,  0,  4 },
  801 /*  73: 0,       3,       6,     */  {  0, 10,  2, 10,  0,  5,  8,  5,  0,  5,  8,  6, 11,  6,  8,  6, 11,  2,  6,  2, 10 },
  802 /*  81: 0,          4,    6,     */  {  4,  5,  0, 10,  0,  5,  0, 10,  3,  6,  3, 10,  3,  6,  7,  4,  7,  6,  5,  4,  6 },
  803 /*  97: 0,             5, 6,     */  {  4,  8,  6,  3,  6,  8,  6,  3, 10,  0, 10,  3, 10,  0,  9,  4,  9,  0,  8,  4,  0 },
  804 /* 193: 0,                6, 7,  */  {  5,  8,  7,  8,  5,  0, 10,  0,  5,  0, 10,  3, 11,  3, 10,  3, 11,  7,  3,  7,  8 },
  805 /*  22:    1, 2,    4,           */  {  2,  8,  0,  8,  2,  7, 10,  7,  2,  7, 10,  4,  9,  4, 10,  4,  9,  0,  4,  0,  8 },
  806 /* 134:    1, 2,             7,  */  {  2, 11,  0,  7,  0, 11,  0,  7,  9,  6,  9,  7,  9,  6, 10,  2, 10,  6, 11,  2,  6 },
  807 /*  42:    1,    3,    5,        */  {  5,  2,  1,  2,  5, 11,  4, 11,  5, 11,  4,  3,  0,  3,  4,  3,  0,  1,  3,  1,  2 },
  808 /* 138:    1,    3,          7,  */  {  7,  0,  3,  0,  7,  9,  6,  9,  7,  9,  6,  1,  2,  1,  6,  1,  2,  3,  1,  3,  0 },
  809 /* 146:    1,       4,       7,  */  {  6,  9,  4,  9,  6,  1, 11,  1,  6,  1, 11,  0,  8,  0, 11,  0,  8,  4,  0,  4,  9 },
  810 /* 162:    1,          5,    7,  */  {  5,  6,  1, 11,  1,  6,  1, 11,  0,  7,  0, 11,  0,  7,  4,  5,  4,  7,  6,  5,  7 },
  811 /* 194:    1,             6, 7,  */  {  5,  9,  7,  0,  7,  9,  7,  0, 11,  1, 11,  0, 11,  1, 10,  5, 10,  1,  9,  5,  1 },
  812 /*  28:       2, 3, 4,           */  {  3,  8,  1,  4,  1,  8,  1,  4, 10,  7, 10,  4, 10,  7, 11,  3, 11,  7,  8,  3,  7 },
  813 /*  44:       2, 3,    5,        */  {  3,  9,  1,  9,  3,  4, 11,  4,  3,  4, 11,  5, 10,  5, 11,  5, 10,  1,  5,  1,  9 },
  814 /*  52:       2,    4, 5,        */  {  7, 10,  5, 10,  7,  2,  8,  2,  7,  2,  8,  1,  9,  1,  8,  1,  9,  5,  1,  5, 10 },
  815 /*  84:       2,    4,    6,     */  {  6,  7,  2,  8,  2,  7,  2,  8,  1,  4,  1,  8,  1,  4,  5,  6,  5,  4,  7,  6,  4 },
  816 /* 148:       2,    4,       7,  */  {  6, 10,  4,  1,  4, 10,  4,  1,  8,  2,  8,  1,  8,  2, 11,  6, 11,  2, 10,  6,  2 },
  817 /*  56:          3, 4, 5,        */  {  7, 11,  5,  2,  5, 11,  5,  2,  9,  3,  9,  2,  9,  3,  8,  7,  8,  3, 11,  7,  3 },
  818 /* 104:          3,    5, 6,     */  {  4, 11,  6, 11,  4,  3,  9,  3,  4,  3,  9,  2, 10,  2,  9,  2, 10,  6,  2,  6, 11 },
  819 /* 168:          3,    5,    7,  */  {  7,  4,  3,  9,  3,  4,  3,  9,  2,  5,  2,  9,  2,  5,  6,  7,  6,  5,  4,  7,  5 },
  820 /*  87: 0, 1, 2,    4,    6,     */  {  3,  4,  7,  4,  3,  9,  2,  9,  3,  9,  2,  5,  6,  5,  2,  5,  6,  7,  5,  7,  4 },
  821 /* 151: 0, 1, 2,    4,       7,  */  {  6, 11,  4,  3,  4, 11,  4,  3,  9,  2,  9,  3,  9,  2, 10,  6, 10,  2, 11,  6,  2 },
  822 /* 199: 0, 1, 2,          6, 7,  */  {  5, 11,  7, 11,  5,  2,  9,  2,  5,  2,  9,  3,  8,  3,  9,  3,  8,  7,  3,  7, 11 },
  823 /* 107: 0, 1,    3,    5, 6,     */  {  4, 10,  6, 10,  4,  1,  8,  1,  4,  1,  8,  2, 11,  2,  8,  2, 11,  6,  2,  6, 10 },
  824 /* 171: 0, 1,    3,    5,    7,  */  {  2,  7,  6,  7,  2,  8,  1,  8,  2,  8,  1,  4,  5,  4,  1,  4,  5,  6,  4,  6,  7 },
  825 /* 203: 0, 1,    3,       6, 7,  */  {  5, 10,  7,  2,  7, 10,  7,  2,  8,  1,  8,  2,  8,  1,  9,  5,  9,  1, 10,  5,  1 },
  826 /* 211: 0, 1,       4,    6, 7,  */  {  1,  9,  3,  4,  3,  9,  3,  4, 11,  5, 11,  4, 11,  5, 10,  1, 10,  5,  9,  1,  5 },
  827 /* 227: 0, 1,          5, 6, 7,  */  {  1,  8,  3,  8,  1,  4, 10,  4,  1,  4, 10,  7, 11,  7, 10,  7, 11,  3,  7,  3,  8 },
  828 /*  61: 0,    2, 3, 4, 5,        */  {  7,  9,  5,  9,  7,  0, 11,  0,  7,  0, 11,  1, 10,  1, 11,  1, 10,  5,  1,  5,  9 },
  829 /*  93: 0,    2, 3, 4,    6,     */  {  1,  6,  5,  6,  1, 11,  0, 11,  1, 11,  0,  7,  4,  7,  0,  7,  4,  5,  7,  5,  6 },
  830 /* 109: 0,    2, 3,    5, 6,     */  {  4,  9,  6,  1,  6,  9,  6,  1, 11,  0, 11,  1, 11,  0,  8,  4,  8,  0,  9,  4,  0 },
  831 /* 117: 0,    2,    4, 5, 6,     */  {  3,  0,  7,  9,  7,  0,  7,  9,  6,  1,  6,  9,  6,  1,  2,  3,  2,  1,  0,  3,  1 },
  832 /* 213: 0,    2,    4,    6, 7,  */  {  1,  2,  5, 11,  5,  2,  5, 11,  4,  3,  4, 11,  4,  3,  0,  1,  0,  3,  2,  1,  3 },
  833 /* 121: 0,       3, 4, 5, 6,     */  {  0, 11,  2, 11,  0,  7,  9,  7,  0,  7,  9,  6, 10,  6,  9,  6, 10,  2,  6,  2, 11 },
  834 /* 233: 0,       3,    5, 6, 7,  */  {  0,  8,  2,  7,  2,  8,  2,  7, 10,  4, 10,  7, 10,  4,  9,  0,  9,  4,  8,  0,  4 },
  835 /*  62:    1, 2, 3, 4, 5,        */  {  7,  8,  5,  0,  5,  8,  5,  0, 10,  3, 10,  0, 10,  3, 11,  7, 11,  3,  8,  7,  3 },
  836 /* 158:    1, 2, 3, 4,       7,  */  {  6,  8,  4,  8,  6,  3, 10,  3,  6,  3, 10,  0,  9,  0, 10,  0,  9,  4,  0,  4,  8 },
  837 /* 174:    1, 2, 3,    5,    7,  */  {  0,  5,  4,  5,  0, 10,  3, 10,  0, 10,  3,  6,  7,  6,  3,  6,  7,  4,  6,  4,  5 },
  838 /* 182:    1, 2,    4, 5,    7,  */  {  2, 10,  0,  5,  0, 10,  0,  5,  8,  6,  8,  5,  8,  6, 11,  2, 11,  6, 10,  2,  6 },
  839 /* 214:    1, 2,    4,    6, 7,  */  {  2,  9,  0,  9,  2,  5, 11,  5,  2,  5, 11,  4,  8,  4, 11,  4,  8,  0,  4,  0,  9 },
  840 /* 186:    1,    3, 4, 5,    7,  */  {  2,  3,  6,  8,  6,  3,  6,  8,  5,  0,  5,  8,  5,  0,  1,  2,  1,  0,  3,  2,  0 },
  841 /* 234:    1,    3,    5, 6, 7,  */  {  0,  1,  4, 10,  4,  1,  4, 10,  7,  2,  7, 10,  7,  2,  3,  0,  3,  2,  1,  0,  2 },
  842 /* 124:       2, 3, 4, 5, 6,     */  {  3, 11,  1,  6,  1, 11,  1,  6,  9,  7,  9,  6,  9,  7,  8,  3,  8,  7, 11,  3,  7 },
  843 /* 188:       2, 3, 4, 5,    7,  */  {  3, 10,  1, 10,  3,  6,  8,  6,  3,  6,  8,  5,  9,  5,  8,  5,  9,  1,  5,  1, 10 }
  844 };
  845 
  846 //_____________________________________________________________________________
  847 /**
  848  * \brief tiling table for case 6.2
  849  * For each of the case above, the specific triangulation of the edge
  850  * intersection points is given.
  851  * When a case is ambiguous, there is an auxiliary table that contains
  852  * the face number to test and the tiling table contains the specific
  853  * triangulations depending on the results
  854  * A minus sign means to invert the result of the test.
  855  */
  856 //-----------------------------------------------------------------------------
  857 static const TqInt tiling6_2[48][15] = {
  858 /*  67: 0, 1,             6,     */  {  1, 10,  3,  6,  3, 10,  3,  6,  8,  5,  8,  6,  8,  5,  9 },
  859 /* 131: 0, 1,                7,  */  {  1, 11,  3, 11,  1,  6,  9,  6,  1,  6,  9,  7,  8,  7,  9 },
  860 /*  21: 0,    2,    4,           */  {  4,  1,  0,  1,  4, 10,  7, 10,  4, 10,  7,  2,  3,  2,  7 },
  861 /*  69: 0,    2,          6,     */  {  6,  3,  2,  3,  6,  8,  5,  8,  6,  8,  5,  0,  1,  0,  5 },
  862 /*  41: 0,       3,    5,        */  {  0,  9,  2,  5,  2,  9,  2,  5, 11,  4, 11,  5, 11,  4,  8 },
  863 /*  73: 0,       3,       6,     */  {  0, 10,  2, 10,  0,  5,  8,  5,  0,  5,  8,  6, 11,  6,  8 },
  864 /*  81: 0,          4,    6,     */  {  4,  5,  0, 10,  0,  5,  0, 10,  3,  6,  3, 10,  3,  6,  7 },
  865 /*  97: 0,             5, 6,     */  {  4,  8,  6,  3,  6,  8,  6,  3, 10,  0, 10,  3, 10,  0,  9 },
  866 /* 193: 0,                6, 7,  */  {  5,  8,  7,  8,  5,  0, 10,  0,  5,  0, 10,  3, 11,  3, 10 },
  867 /*  22:    1, 2,    4,           */  {  2,  8,  0,  8,  2,  7, 10,  7,  2,  7, 10,  4,  9,  4, 10 },
  868 /* 134:    1, 2,             7,  */  {  2, 11,  0,  7,  0, 11,  0,  7,  9,  6,  9,  7,  9,  6, 10 },
  869 /*  42:    1,    3,    5,        */  {  5,  2,  1,  2,  5, 11,  4, 11,  5, 11,  4,  3,  0,  3,  4 },
  870 /* 138:    1,    3,          7,  */  {  7,  0,  3,  0,  7,  9,  6,  9,  7,  9,  6,  1,  2,  1,  6 },
  871 /* 146:    1,       4,       7,  */  {  6,  9,  4,  9,  6,  1, 11,  1,  6,  1, 11,  0,  8,  0, 11 },
  872 /* 162:    1,          5,    7,  */  {  5,  6,  1, 11,  1,  6,  1, 11,  0,  7,  0, 11,  0,  7,  4 },
  873 /* 194:    1,             6, 7,  */  {  5,  9,  7,  0,  7,  9,  7,  0, 11,  1, 11,  0, 11,  1, 10 },
  874 /*  28:       2, 3, 4,           */  {  3,  8,  1,  4,  1,  8,  1,  4, 10,  7, 10,  4, 10,  7, 11 },
  875 /*  44:       2, 3,    5,        */  {  3,  9,  1,  9,  3,  4, 11,  4,  3,  4, 11,  5, 10,  5, 11 },
  876 /*  52:       2,    4, 5,        */  {  7, 10,  5, 10,  7,  2,  8,  2,  7,  2,  8,  1,  9,  1,  8 },
  877 /*  84:       2,    4,    6,     */  {  6,  7,  2,  8,  2,  7,  2,  8,  1,  4,  1,  8,  1,  4,  5 },
  878 /* 148:       2,    4,       7,  */  {  6, 10,  4,  1,  4, 10,  4,  1,  8,  2,  8,  1,  8,  2, 11 },
  879 /*  56:          3, 4, 5,        */  {  7, 11,  5,  2,  5, 11,  5,  2,  9,  3,  9,  2,  9,  3,  8 },
  880 /* 104:          3,    5, 6,     */  {  4, 11,  6, 11,  4,  3,  9,  3,  4,  3,  9,  2, 10,  2,  9 },
  881 /* 168:          3,    5,    7,  */  {  7,  4,  3,  9,  3,  4,  3,  9,  2,  5,  2,  9,  2,  5,  6 },
  882 /*  87: 0, 1, 2,    4,    6,     */  {  3,  4,  7,  4,  3,  9,  2,  9,  3,  9,  2,  5,  6,  5,  2 },
  883 /* 151: 0, 1, 2,    4,       7,  */  {  6, 11,  4,  3,  4, 11,  4,  3,  9,  2,  9,  3,  9,  2, 10 },
  884 /* 199: 0, 1, 2,          6, 7,  */  {  5, 11,  7, 11,  5,  2,  9,  2,  5,  2,  9,  3,  8,  3,  9 },
  885 /* 107: 0, 1,    3,    5, 6,     */  {  4, 10,  6, 10,  4,  1,  8,  1,  4,  1,  8,  2, 11,  2,  8 },
  886 /* 171: 0, 1,    3,    5,    7,  */  {  2,  7,  6,  7,  2,  8,  1,  8,  2,  8,  1,  4,  5,  4,  1 },
  887 /* 203: 0, 1,    3,       6, 7,  */  {  5, 10,  7,  2,  7, 10,  7,  2,  8,  1,  8,  2,  8,  1,  9 },
  888 /* 211: 0, 1,       4,    6, 7,  */  {  1,  9,  3,  4,  3,  9,  3,  4, 11,  5, 11,  4, 11,  5, 10 },
  889 /* 227: 0, 1,          5, 6, 7,  */  {  1,  8,  3,  8,  1,  4, 10,  4,  1,  4, 10,  7, 11,  7, 10 },
  890 /*  61: 0,    2, 3, 4, 5,        */  {  7,  9,  5,  9,  7,  0, 11,  0,  7,  0, 11,  1, 10,  1, 11 },
  891 /*  93: 0,    2, 3, 4,    6,     */  {  1,  6,  5,  6,  1, 11,  0, 11,  1, 11,  0,  7,  4,  7,  0 },
  892 /* 109: 0,    2, 3,    5, 6,     */  {  4,  9,  6,  1,  6,  9,  6,  1, 11,  0, 11,  1, 11,  0,  8 },
  893 /* 117: 0,    2,    4, 5, 6,     */  {  3,  0,  7,  9,  7,  0,  7,  9,  6,  1,  6,  9,  6,  1,  2 },
  894 /* 213: 0,    2,    4,    6, 7,  */  {  1,  2,  5, 11,  5,  2,  5, 11,  4,  3,  4, 11,  4,  3,  0 },
  895 /* 121: 0,       3, 4, 5, 6,     */  {  0, 11,  2, 11,  0,  7,  9,  7,  0,  7,  9,  6, 10,  6,  9 },
  896 /* 233: 0,       3,    5, 6, 7,  */  {  0,  8,  2,  7,  2,  8,  2,  7, 10,  4, 10,  7, 10,  4,  9 },
  897 /*  62:    1, 2, 3, 4, 5,        */  {  7,  8,  5,  0,  5,  8,  5,  0, 10,  3, 10,  0, 10,  3, 11 },
  898 /* 158:    1, 2, 3, 4,       7,  */  {  6,  8,  4,  8,  6,  3, 10,  3,  6,  3, 10,  0,  9,  0, 10 },
  899 /* 174:    1, 2, 3,    5,    7,  */  {  0,  5,  4,  5,  0, 10,  3, 10,  0, 10,  3,  6,  7,  6,  3 },
  900 /* 182:    1, 2,    4, 5,    7,  */  {  2, 10,  0,  5,  0, 10,  0,  5,  8,  6,  8,  5,  8,  6, 11 },
  901 /* 214:    1, 2,    4,    6, 7,  */  {  2,  9,  0,  9,  2,  5, 11,  5,  2,  5, 11,  4,  8,  4, 11 },
  902 /* 186:    1,    3, 4, 5,    7,  */  {  2,  3,  6,  8,  6,  3,  6,  8,  5,  0,  5,  8,  5,  0,  1 },
  903 /* 234:    1,    3,    5, 6, 7,  */  {  0,  1,  4, 10,  4,  1,  4, 10,  7,  2,  7, 10,  7,  2,  3 },
  904 /* 124:       2, 3, 4, 5, 6,     */  {  3, 11,  1,  6,  1, 11,  1,  6,  9,  7,  9,  6,  9,  7,  8 },
  905 /* 188:       2, 3, 4, 5,    7,  */  {  3, 10,  1, 10,  3,  6,  8,  6,  3,  6,  8,  5,  9,  5,  8 }
  906 };
  907 //_____________________________________________________________________________
  908 
  909 
  910 
  911 //_____________________________________________________________________________
  912 /**
  913  * \brief test table for case 7
  914  * 3 faces to test + eventually the interior
  915  * When the tests on the 3 specified faces are positive :
  916  * - if the test on the interior is positive : 5 first triangles
  917  * - if the test on the interior is negative : 9 next triangles
  918  * When the tests on the first  and the second specified faces are positive : 9 next triangles
  919  * When the tests on the first  and the third  specified faces are positive : 9 next triangles
  920  * When the tests on the second and the third  specified faces are positive : 9 next triangles
  921  * When the test on the first  specified face is positive : 5 next triangles
  922  * When the test on the second specified face is positive : 5 next triangles
  923  * When the test on the third  specified face is positive : 5 next triangles
  924  * When the tests on the 3 specified faces are negative : 3 last triangles
  925  * The support edge for the interior test is marked as the 5th column.
  926  *
  927  * For each of the case above, the specific triangulation of the edge
  928  * intersection points is given.
  929  * When a case is ambiguous, there is an auxiliary table that contains
  930  * the face number to test and the tiling table contains the specific
  931  * triangulations depending on the results
  932  * A minus sign means to invert the result of the test.
  933  */
  934 //-----------------------------------------------------------------------------
  935 static const TqInt test7[16][5] = {
  936 /*  37: 0,    2,       5,        */  {  1,  2,  5,  7,   1 },
  937 /* 133: 0,    2,             7,  */  {  3,  4,  5,  7,   3 },
  938 /* 161: 0,             5,    7,  */  {  4,  1,  6,  7,   4 },
  939 /*  26:    1,    3, 4,           */  {  4,  1,  5,  7,   0 },
  940 /*  74:    1,    3,       6,     */  {  2,  3,  5,  7,   2 },
  941 /*  82:    1,       4,    6,     */  {  1,  2,  6,  7,   5 },
  942 /* 164:       2,       5,    7,  */  {  2,  3,  6,  7,   6 },
  943 /*  88:          3, 4,    6,     */  {  3,  4,  6,  7,   7 },
  944 /* 167: 0, 1, 2,       5,    7,  */  { -3, -4, -6, -7,   7 },
  945 /*  91: 0, 1,    3, 4,    6,     */  { -2, -3, -6, -7,   6 },
  946 /* 173: 0,    2, 3,    5,    7,  */  { -1, -2, -6, -7,   5 },
  947 /* 181: 0,    2,    4, 5,    7,  */  { -2, -3, -5, -7,   2 },
  948 /* 229: 0,    2,       5, 6, 7,  */  { -4, -1, -5, -7,   0 },
  949 /*  94:    1, 2, 3, 4,    6,     */  { -4, -1, -6, -7,   4 },
  950 /* 122:    1,    3, 4, 5, 6,     */  { -3, -4, -5, -7,   3 },
  951 /* 218:    1,    3, 4,    6, 7,  */  { -1, -2, -5, -7,   1 }
  952 };
  953 
  954 //_____________________________________________________________________________
  955 /**
  956  * \brief tiling table for case 7.1
  957  * For each of the case above, the specific triangulation of the edge
  958  * intersection points is given.
  959  * When a case is ambiguous, there is an auxiliary table that contains
  960  * the face number to test and the tiling table contains the specific
  961  * triangulations depending on the results
  962  * A minus sign means to invert the result of the test.
  963  */
  964 //-----------------------------------------------------------------------------
  965 static const TqInt tiling7_1[16][9] = {
  966 /*  37: 0,    2,       5,        */  {  9,  5,  4, 10,  1,  2,  8,  3,  0 },
  967 /* 133: 0,    2,             7,  */  { 11,  7,  6,  8,  3,  0, 10,  1,  2 },
  968 /* 161: 0,             5,    7,  */  {  3,  0,  8,  5,  4,  9,  7,  6, 11 },
  969 /*  26:    1,    3, 4,           */  {  8,  4,  7,  9,  0,  1, 11,  2,  3 },
  970 /*  74:    1,    3,       6,     */  { 10,  6,  5, 11,  2,  3,  9,  0,  1 },
  971 /*  82:    1,       4,    6,     */  {  0,  1,  9,  6,  5, 10,  4,  7,  8 },
  972 /* 164:       2,       5,    7,  */  {  1,  2, 10,  7,  6, 11,  5,  4,  9 },
  973 /*  88:          3, 4,    6,     */  {  2,  3, 11,  4,  7,  8,  6,  5, 10 },
  974 /* 167: 0, 1, 2,       5,    7,  */  { 11,  3,  2,  8,  7,  4, 10,  5,  6 },
  975 /*  91: 0, 1,    3, 4,    6,     */  { 10,  2,  1, 11,  6,  7,  9,  4,  5 },
  976 /* 173: 0,    2, 3,    5,    7,  */  {  9,  1,  0, 10,  5,  6,  8,  7,  4 },
  977 /* 181: 0,    2,    4, 5,    7,  */  {  5,  6, 10,  3,  2, 11,  1,  0,  9 },
  978 /* 229: 0,    2,       5, 6, 7,  */  {  7,  4,  8,  1,  0,  9,  3,  2, 11 },
  979 /*  94:    1, 2, 3, 4,    6,     */  {  8,  0,  3,  9,  4,  5, 11,  6,  7 },
  980 /* 122:    1,    3, 4, 5, 6,     */  {  6,  7, 11,  0,  3,  8,  2,  1, 10 },
  981 /* 218:    1,    3, 4,    6, 7,  */  {  4,  5,  9,  2,  1, 10,  0,  3,  8 }
  982 };
  983 
  984 //_____________________________________________________________________________
  985 /**
  986  * \brief tiling table for case 7.2
  987  * For each of the case above, the specific triangulation of the edge
  988  * intersection points is given.
  989  * When a case is ambiguous, there is an auxiliary table that contains
  990  * the face number to test and the tiling table contains the specific
  991  * triangulations depending on the results
  992  * A minus sign means to invert the result of the test.
  993  */
  994 //-----------------------------------------------------------------------------
  995 static const TqInt tiling7_2[16][3][15] = {
  996 /*  37: 0,    2,       5,        */  {
  997  /* 1,0 */ {  1,  2, 10,  3,  4,  8,  4,  3,  5,  0,  5,  3,  5,  0,  9 },
  998  /* 0,1 */ {  3,  0,  8,  9,  1,  4,  2,  4,  1,  4,  2,  5, 10,  5,  2 },
  999  /* 1,1 */ {  9,  5,  4,  0, 10,  1, 10,  0,  8, 10,  8,  2,  3,  2,  8 }
 1000 },
 1001 /* 133: 0,    2,             7,  */  {
 1002  /* 1,0 */ {  3,  0,  8,  1,  6, 10,  6,  1,  7,  2,  7,  1,  7,  2, 11 },
 1003  /* 0,1 */ {  1,  2, 10, 11,  3,  6,  0,  6,  3,  6,  0,  7,  8,  7,  0 },
 1004  /* 1,1 */ { 11,  7,  6,  2,  8,  3,  8,  2, 10,  8, 10,  0,  1,  0, 10 }
 1005 },
 1006 /* 161: 0,             5,    7,  */  {
 1007  /* 1,0 */ {  9,  5,  4, 11,  3,  6,  0,  6,  3,  6,  0,  7,  8,  7,  0 },
 1008  /* 0,1 */ { 11,  7,  6,  3,  4,  8,  4,  3,  5,  0,  5,  3,  5,  0,  9 },
 1009  /* 1,1 */ {  3,  0,  8,  4,  9,  7, 11,  7,  9,  5, 11,  9, 11,  5,  6 }
 1010 },
 1011 /*  26:    1,    3, 4,           */  {
 1012  /* 1,0 */ {  0,  1,  9,  2,  7, 11,  7,  2,  4,  3,  4,  2,  4,  3,  8 },
 1013  /* 0,1 */ {  2,  3, 11,  8,  0,  7,  1,  7,  0,  7,  1,  4,  9,  4,  1 },
 1014  /* 1,1 */ {  8,  4,  7,  3,  9,  0,  9,  3, 11,  9, 11,  1,  2,  1, 11 }
 1015 },
 1016 /*  74:    1,    3,       6,     */  {
 1017  /* 1,0 */ {  2,  3, 11,  0,  5,  9,  5,  0,  6,  1,  6,  0,  6,  1, 10 },
 1018  /* 0,1 */ {  0,  1,  9, 10,  2,  5,  3,  5,  2,  5,  3,  6, 11,  6,  3 },
 1019  /* 1,1 */ {  6,  5, 10,  1, 11,  2, 11,  1,  9, 11,  9,  3,  0,  3,  9 }
 1020 },
 1021 /*  82:    1,       4,    6,     */  {
 1022  /* 1,0 */ {  6,  5, 10,  8,  0,  7,  1,  7,  0,  7,  1,  4,  9,  4,  1 },
 1023  /* 0,1 */ {  8,  4,  7,  0,  5,  9,  5,  0,  6,  1,  6,  0,  6,  1, 10 },
 1024  /* 1,1 */ {  0,  1,  9,  5, 10,  4,  8,  4, 10,  6,  8, 10,  8,  6,  7 }
 1025 },
 1026 /* 164:       2,       5,    7,  */  {
 1027  /* 1,0 */ { 11,  7,  6,  9,  1,  4,  2,  4,  1,  4,  2,  5, 10,  5,  2 },
 1028  /* 0,1 */ {  9,  5,  4,  1,  6, 10,  6,  1,  7,  2,  7,  1,  7,  2, 11 },
 1029  /* 1,1 */ {  1,  2, 10,  6, 11,  5,  9,  5, 11,  7,  9, 11,  9,  7,  4 }
 1030 },
 1031 /*  88:          3, 4,    6,     */  {
 1032  /* 1,0 */ {  8,  4,  7, 10,  2,  5,  3,  5,  2,  5,  3,  6, 11,  6,  3 },
 1033  /* 0,1 */ {  6,  5, 10,  2,  7, 11,  7,  2,  4,  3,  4,  2,  4,  3,  8 },
 1034  /* 1,1 */ {  2,  3, 11,  7,  8,  6, 10,  6,  8,  4, 10,  8, 10,  4,  5 }
 1035 },
 1036 /* 167: 0, 1, 2,       5,    7,  */  {
 1037  /* 1,0 */ {  7,  4,  8,  5,  2, 10,  2,  5,  3,  6,  3,  5,  3,  6, 11 },
 1038  /* 0,1 */ { 10,  5,  6, 11,  7,  2,  4,  2,  7,  2,  4,  3,  8,  3,  4 },
 1039  /* 1,1 */ { 11,  3,  2,  6,  8,  7,  8,  6, 10,  8, 10,  4,  5,  4, 10 }
 1040 },
 1041 /*  91: 0, 1,    3, 4,    6,     */  {
 1042  /* 1,0 */ {  6,  7, 11,  4,  1,  9,  1,  4,  2,  5,  2,  4,  2,  5, 10 },
 1043  /* 0,1 */ {  4,  5,  9, 10,  6,  1,  7,  1,  6,  1,  7,  2, 11,  2,  7 },
 1044  /* 1,1 */ { 10,  2,  1,  5, 11,  6, 11,  5,  9, 11,  9,  7,  4,  7,  9 }
 1045 },
 1046 /* 173: 0,    2, 3,    5,    7,  */  {
 1047  /* 1,0 */ { 10,  5,  6,  7,  0,  8,  0,  7,  1,  4,  1,  7,  1,  4,  9 },
 1048  /* 0,1 */ {  7,  4,  8,  9,  5,  0,  6,  0,  5,  0,  6,  1, 10,  1,  6 },
 1049  /* 1,1 */ {  9,  1,  0,  4, 10,  5, 10,  4,  8, 10,  8,  6,  7,  6,  8 }
 1050 },
 1051 /* 181: 0,    2,    4, 5,    7,  */  {
 1052  /* 1,0 */ { 11,  3,  2,  9,  5,  0,  6,  0,  5,  0,  6,  1, 10,  1,  6 },
 1053  /* 0,1 */ {  9,  1,  0,  5,  2, 10,  2,  5,  3,  6,  3,  5,  3,  6, 11 },
 1054  /* 1,1 */ { 10,  5,  6,  2, 11,  1,  9,  1, 11,  3,  9, 11,  9,  3,  0 }
 1055 },
 1056 /* 229: 0,    2,       5, 6, 7,  */  {
 1057  /* 1,0 */ {  9,  1,  0, 11,  7,  2,  4,  2,  7,  2,  4,  3,  8,  3,  4 },
 1058  /* 0,1 */ { 11,  3,  2,  7,  0,  8,  0,  7,  1,  4,  1,  7,  1,  4,  9 },
 1059  /* 1,1 */ {  7,  4,  8,  0,  9,  3, 11,  3,  9,  1, 11,  9, 11,  1,  2 }
 1060 },
 1061 /*  94:    1, 2, 3, 4,    6,     */  {
 1062  /* 1,0 */ {  4,  5,  9,  6,  3, 11,  3,  6,  0,  7,  0,  6,  0,  7,  8 },
 1063  /* 0,1 */ {  6,  7, 11,  8,  4,  3,  5,  3,  4,  3,  5,  0,  9,  0,  5 },
 1064  /* 1,1 */ {  8,  0,  3,  7,  9,  4,  9,  7, 11,  9, 11,  5,  6,  5, 11 }
 1065 },
 1066 /* 122:    1,    3, 4, 5, 6,     */  {
 1067  /* 1,0 */ {  8,  0,  3, 10,  6,  1,  7,  1,  6,  1,  7,  2, 11,  2,  7 },
 1068  /* 0,1 */ { 10,  2,  1,  6,  3, 11,  3,  6,  0,  7,  0,  6,  0,  7,  8 },
 1069  /* 1,1 */ {  6,  7, 11,  3,  8,  2, 10,  2,  8,  0, 10,  8, 10,  0,  1 }
 1070 },
 1071 /* 218:    1,    3, 4,    6, 7,  */  {
 1072  /* 1,0 */ { 10,  2,  1,  8,  4,  3,  5,  3,  4,  3,  5,  0,  9,  0,  5 },
 1073  /* 0,1 */ {  8,  0,  3,  4,  1,  9,  1,  4,  2,  5,  2,  4,  2,  5, 10 },
 1074  /* 1,1 */ {  4,  5,  9,  1, 10,  0,  8,  0, 10,  2,  8, 10,  8,  2,  3 } }
 1075 };
 1076 
 1077 //_____________________________________________________________________________
 1078 /**
 1079  * \brief tiling table for case 7.3
 1080  * For each of the case above, the specific triangulation of the edge
 1081  * intersection points is given.
 1082  * When a case is ambiguous, there is an auxiliary table that contains
 1083  * the face number to test and the tiling table contains the specific
 1084  * triangulations depending on the results
 1085  * A minus sign means to invert the result of the test.
 1086  */
 1087 //-----------------------------------------------------------------------------
 1088 static const TqInt tiling7_3[16][3][27] = {
 1089 /*  37: 0,    2,       5,        */  {
 1090  /* 1,0 */ { 12,  2, 10, 12, 10,  5, 12,  5,  4, 12,  4,  8, 12,  8,  3, 12,  3,  0, 12,  0,  9, 12,  9,  1, 12,  1,  2 },
 1091  /* 0,1 */ { 12,  5,  4, 12,  4,  8, 12,  8,  3, 12,  3,  2, 12,  2, 10, 12, 10,  1, 12,  1,  0, 12,  0,  9, 12,  9,  5 },
 1092  /* 1,1 */ {  5,  4, 12, 10,  5, 12,  2, 10, 12,  3,  2, 12,  8,  3, 12,  0,  8, 12,  1,  0, 12,  9,  1, 12,  4,  9, 12 }
 1093 },
 1094 /* 133: 0,    2,             7,  */  {
 1095  /* 1,0 */ { 12,  0,  8, 12,  8,  7, 12,  7,  6, 12,  6, 10, 12, 10,  1, 12,  1,  2, 12,  2, 11, 12, 11,  3, 12,  3,  0 },
 1096  /* 0,1 */ { 12,  7,  6, 12,  6, 10, 12, 10,  1, 12,  1,  0, 12,  0,  8, 12,  8,  3, 12,  3,  2, 12,  2, 11, 12, 11,  7 },
 1097  /* 1,1 */ {  7,  6, 12,  8,  7, 12,  0,  8, 12,  1,  0, 12, 10,  1, 12,  2, 10, 12,  3,  2, 12, 11,  3, 12,  6, 11, 12 }
 1098 },
 1099 /* 161: 0,             5,    7,  */  {
 1100  /* 1,0 */ {  9,  5, 12,  0,  9, 12,  3,  0, 12, 11,  3, 12,  6, 11, 12,  7,  6, 12,  8,  7, 12,  4,  8, 12,  5,  4, 12 },
 1101  /* 0,1 */ {  3,  0, 12, 11,  3, 12,  6, 11, 12,  5,  6, 12,  9,  5, 12,  4,  9, 12,  7,  4, 12,  8,  7, 12,  0,  8, 12 },
 1102  /* 1,1 */ { 12,  3,  0, 12,  0,  9, 12,  9,  5, 12,  5,  6, 12,  6, 11, 12, 11,  7, 12,  7,  4, 12,  4,  8, 12,  8,  3 }
 1103 },
 1104 /*  26:    1,    3, 4,           */  {
 1105  /* 1,0 */ { 12,  1,  9, 12,  9,  4, 12,  4,  7, 12,  7, 11, 12, 11,  2, 12,  2,  3, 12,  3,  8, 12,  8,  0, 12,  0,  1 },
 1106  /* 0,1 */ { 12,  4,  7, 12,  7, 11, 12, 11,  2, 12,  2,  1, 12,  1,  9, 12,  9,  0, 12,  0,  3, 12,  3,  8, 12,  8,  4 },
 1107  /* 1,1 */ {  4,  7, 12,  9,  4, 12,  1,  9, 12,  2,  1, 12, 11,  2, 12,  3, 11, 12,  0,  3, 12,  8,  0, 12,  7,  8, 12 }
 1108 },
 1109 /*  74:    1,    3,       6,     */  {
 1110  /* 1,0 */ { 12,  3, 11, 12, 11,  6, 12,  6,  5, 12,  5,  9, 12,  9,  0, 12,  0,  1, 12,  1, 10, 12, 10,  2, 12,  2,  3 },
 1111  /* 0,1 */ { 12,  6,  5, 12,  5,  9, 12,  9,  0, 12,  0,  3, 12,  3, 11, 12, 11,  2, 12,  2,  1, 12,  1, 10, 12, 10,  6 },
 1112  /* 1,1 */ {  6,  5, 12, 11,  6, 12,  3, 11, 12,  0,  3, 12,  9,  0, 12,  1,  9, 12,  2,  1, 12, 10,  2, 12,  5, 10, 12 }
 1113 },
 1114 /*  82:    1,       4,    6,     */  {
 1115  /* 1,0 */ { 10,  6, 12,  1, 10, 12,  0,  1, 12,  8,  0, 12,  7,  8, 12,  4,  7, 12,  9,  4, 12,  5,  9, 12,  6,  5, 12 },
 1116  /* 0,1 */ {  0,  1, 12,  8,  0, 12,  7,  8, 12,  6,  7, 12, 10,  6, 12,  5, 10, 12,  4,  5, 12,  9,  4, 12,  1,  9, 12 },
 1117  /* 1,1 */ { 12,  0,  1, 12,  1, 10, 12, 10,  6, 12,  6,  7, 12,  7,  8, 12,  8,  4, 12,  4,  5, 12,  5,  9, 12,  9,  0 }
 1118 },
 1119 /* 164:       2,       5,    7,  */  {
 1120  /* 1,0 */ { 11,  7, 12,  2, 11, 12,  1,  2, 12,  9,  1, 12,  4,  9, 12,  5,  4, 12, 10,  5, 12,  6, 10, 12,  7,  6, 12 },
 1121  /* 0,1 */ {  1,  2, 12,  9,  1, 12,  4,  9, 12,  7,  4, 12, 11,  7, 12,  6, 11, 12,  5,  6, 12, 10,  5, 12,  2, 10, 12 },
 1122  /* 1,1 */ { 12,  1,  2, 12,  2, 11, 12, 11,  7, 12,  7,  4, 12,  4,  9, 12,  9,  5, 12,  5,  6, 12,  6, 10, 12, 10,  1 }
 1123 },
 1124 /*  88:          3, 4,    6,     */  {
 1125  /* 1,0 */ {  8,  4, 12,  3,  8, 12,  2,  3, 12, 10,  2, 12,  5, 10, 12,  6,  5, 12, 11,  6, 12,  7, 11, 12,  4,  7, 12 },
 1126  /* 0,1 */ {  2,  3, 12, 10,  2, 12,  5, 10, 12,  4,  5, 12,  8,  4, 12,  7,  8, 12,  6,  7, 12, 11,  6, 12,  3, 11, 12 },
 1127  /* 1,1 */ { 12,  2,  3, 12,  3,  8, 12,  8,  4, 12,  4,  5, 12,  5, 10, 12, 10,  6, 12,  6,  7, 12,  7, 11, 12, 11,  2 }
 1128 },
 1129 /* 167: 0, 1, 2,       5,    7,  */  {
 1130  /* 1,0 */ { 12,  4,  8, 12,  8,  3, 12,  3,  2, 12,  2, 10, 12, 10,  5, 12,  5,  6, 12,  6, 11, 12, 11,  7, 12,  7,  4 },
 1131  /* 0,1 */ { 12,  3,  2, 12,  2, 10, 12, 10,  5, 12,  5,  4, 12,  4,  8, 12,  8,  7, 12,  7,  6, 12,  6, 11, 12, 11,  3 },
 1132  /* 1,1 */ {  3,  2, 12,  8,  3, 12,  4,  8, 12,  5,  4, 12, 10,  5, 12,  6, 10, 12,  7,  6, 12, 11,  7, 12,  2, 11, 12 }
 1133 },
 1134 /*  91: 0, 1,    3, 4,    6,     */  {
 1135  /* 1,0 */ { 12,  7, 11, 12, 11,  2, 12,  2,  1, 12,  1,  9, 12,  9,  4, 12,  4,  5, 12,  5, 10, 12, 10,  6, 12,  6,  7 },
 1136  /* 0,1 */ { 12,  2,  1, 12,  1,  9, 12,  9,  4, 12,  4,  7, 12,  7, 11, 12, 11,  6, 12,  6,  5, 12,  5, 10, 12, 10,  2 },
 1137  /* 1,1 */ {  2,  1, 12, 11,  2, 12,  7, 11, 12,  4,  7, 12,  9,  4, 12,  5,  9, 12,  6,  5, 12, 10,  6, 12,  1, 10, 12 }
 1138 },
 1139 /* 173: 0,    2, 3,    5,    7,  */  {
 1140  /* 1,0 */ { 12,  6, 10, 12, 10,  1, 12,  1,  0, 12,  0,  8, 12,  8,  7, 12,  7,  4, 12,  4,  9, 12,  9,  5, 12,  5,  6 },
 1141  /* 0,1 */ { 12,  1,  0, 12,  0,  8, 12,  8,  7, 12,  7,  6, 12,  6, 10, 12, 10,  5, 12,  5,  4, 12,  4,  9, 12,  9,  1 },
 1142  /* 1,1 */ {  1,  0, 12, 10,  1, 12,  6, 10, 12,  7,  6, 12,  8,  7, 12,  4,  8, 12,  5,  4, 12,  9,  5, 12,  0,  9, 12 }
 1143 },
 1144 /* 181: 0,    2,    4, 5,    7,  */  {
 1145  /* 1,0 */ { 11,  3, 12,  6, 11, 12,  5,  6, 12,  9,  5, 12,  0,  9, 12,  1,  0, 12, 10,  1, 12,  2, 10, 12,  3,  2, 12 },
 1146  /* 0,1 */ {  5,  6, 12,  9,  5, 12,  0,  9, 12,  3,  0, 12, 11,  3, 12,  2, 11, 12,  1,  2, 12, 10,  1, 12,  6, 10, 12 },
 1147  /* 1,1 */ { 12,  5,  6, 12,  6, 11, 12, 11,  3, 12,  3,  0, 12,  0,  9, 12,  9,  1, 12,  1,  2, 12,  2, 10, 12, 10,  5 }
 1148 },
 1149 /* 229: 0,    2,       5, 6, 7,  */  {
 1150  /* 1,0 */ {  9,  1, 12,  4,  9, 12,  7,  4, 12, 11,  7, 12,  2, 11, 12,  3,  2, 12,  8,  3, 12,  0,  8, 12,  1,  0, 12 },
 1151  /* 0,1 */ {  7,  4, 12, 11,  7, 12,  2, 11, 12,  1,  2, 12,  9,  1, 12,  0,  9, 12,  3,  0, 12,  8,  3, 12,  4,  8, 12 },
 1152  /* 1,1 */ { 12,  7,  4, 12,  4,  9, 12,  9,  1, 12,  1,  2, 12,  2, 11, 12, 11,  3, 12,  3,  0, 12,  0,  8, 12,  8,  7 }
 1153 },
 1154 /*  94:    1, 2, 3, 4,    6,     */  {
 1155  /* 1,0 */ { 12,  5,  9, 12,  9,  0, 12,  0,  3, 12,  3, 11, 12, 11,  6, 12,  6,  7, 12,  7,  8, 12,  8,  4, 12,  4,  5 },
 1156  /* 0,1 */ { 12,  0,  3, 12,  3, 11, 12, 11,  6, 12,  6,  5, 12,  5,  9, 12,  9,  4, 12,  4,  7, 12,  7,  8, 12,  8,  0 },
 1157  /* 1,1 */ {  0,  3, 12,  9,  0, 12,  5,  9, 12,  6,  5, 12, 11,  6, 12,  7, 11, 12,  4,  7, 12,  8,  4, 12,  3,  8, 12 }
 1158 },
 1159 /* 122:    1,    3, 4, 5, 6,     */  {
 1160  /* 1,0 */ {  8,  0, 12,  7,  8, 12,  6,  7, 12, 10,  6, 12,  1, 10, 12,  2,  1, 12, 11,  2, 12,  3, 11, 12,  0,  3, 12 },
 1161  /* 0,1 */ {  6,  7, 12, 10,  6, 12,  1, 10, 12,  0,  1, 12,  8,  0, 12,  3,  8, 12,  2,  3, 12, 11,  2, 12,  7, 11, 12 },
 1162  /* 1,1 */ { 12,  6,  7, 12,  7,  8, 12,  8,  0, 12,  0,  1, 12,  1, 10, 12, 10,  2, 12,  2,  3, 12,  3, 11, 12, 11,  6 }
 1163 },
 1164 /* 218:    1,    3, 4,    6, 7,  */  {
 1165  /* 1,0 */ { 10,  2, 12,  5, 10, 12,  4,  5, 12,  8,  4, 12,  3,  8, 12,  0,  3, 12,  9,  0, 12,  1,  9, 12,  2,  1, 12 },
 1166  /* 0,1 */ {  4,  5, 12,  8,  4, 12,  3,  8, 12,  2,  3, 12, 10,  2, 12,  1, 10, 12,  0,  1, 12,  9,  0, 12,  5,  9, 12 },
 1167  /* 1,1 */ { 12,  4,  5, 12,  5, 10, 12, 10,  2, 12,  2,  3, 12,  3,  8, 12,  8,  0, 12,  0,  1, 12,  1,  9, 12,  9,  4 } }
 1168 };
 1169 
 1170 //_____________________________________________________________________________
 1171 /**
 1172  * \brief tiling table for case 7.4.1
 1173  * For each of the case above, the specific triangulation of the edge
 1174  * intersection points is given.
 1175  * When a case is ambiguous, there is an auxiliary table that contains
 1176  * the face number to test and the tiling table contains the specific
 1177  * triangulations depending on the results
 1178  * A minus sign means to invert the result of the test.
 1179  */
 1180 //-----------------------------------------------------------------------------
 1181 static const TqInt tiling7_4_1[16][15] = {
 1182 /*  37: 0,    2,       5,        */  {  3,  4,  8,  4,  3, 10,  2, 10,  3,  4, 10,  5,  9,  1,  0 },
 1183 /* 133: 0,    2,             7,  */  {  1,  6, 10,  6,  1,  8,  0,  8,  1,  6,  8,  7, 11,  3,  2 },
 1184 /* 161: 0,             5,    7,  */  { 11,  3,  6,  9,  6,  3,  6,  9,  5,  0,  9,  3,  7,  4,  8 },
 1185 /*  26:    1,    3, 4,           */  {  2,  7, 11,  7,  2,  9,  1,  9,  2,  7,  9,  4,  8,  0,  3 },
 1186 /*  74:    1,    3,       6,     */  {  0,  5,  9,  5,  0, 11,  3, 11,  0,  5, 11,  6, 10,  2,  1 },
 1187 /*  82:    1,       4,    6,     */  {  8,  0,  7, 10,  7,  0,  7, 10,  6,  1, 10,  0,  4,  5,  9 },
 1188 /* 164:       2,       5,    7,  */  {  9,  1,  4, 11,  4,  1,  4, 11,  7,  2, 11,  1,  5,  6, 10 },
 1189 /*  88:          3, 4,    6,     */  { 10,  2,  5,  8,  5,  2,  5,  8,  4,  3,  8,  2,  6,  7, 11 },
 1190 /* 167: 0, 1, 2,       5,    7,  */  {  5,  2, 10,  2,  5,  8,  4,  8,  5,  2,  8,  3, 11,  7,  6 },
 1191 /*  91: 0, 1,    3, 4,    6,     */  {  4,  1,  9,  1,  4, 11,  7, 11,  4,  1, 11,  2, 10,  6,  5 },
 1192 /* 173: 0,    2, 3,    5,    7,  */  {  7,  0,  8,  0,  7, 10,  6, 10,  7,  0, 10,  1,  9,  5,  4 },
 1193 /* 181: 0,    2,    4, 5,    7,  */  {  9,  5,  0, 11,  0,  5,  0, 11,  3,  6, 11,  5,  1,  2, 10 },
 1194 /* 229: 0,    2,       5, 6, 7,  */  { 11,  7,  2,  9,  2,  7,  2,  9,  1,  4,  9,  7,  3,  0,  8 },
 1195 /*  94:    1, 2, 3, 4,    6,     */  {  6,  3, 11,  3,  6,  9,  5,  9,  6,  3,  9,  0,  8,  4,  7 },
 1196 /* 122:    1,    3, 4, 5, 6,     */  { 10,  6,  1,  8,  1,  6,  1,  8,  0,  7,  8,  6,  2,  3, 11 },
 1197 /* 218:    1,    3, 4,    6, 7,  */  {  8,  4,  3, 10,  3,  4,  3, 10,  2,  5, 10,  4,  0,  1,  9 }
 1198 };
 1199 
 1200 //_____________________________________________________________________________
 1201 /**
 1202  * \brief tiling table for case 7.4.2
 1203  * For each of the case above, the specific triangulation of the edge
 1204  * intersection points is given.
 1205  * When a case is ambiguous, there is an auxiliary table that contains
 1206  * the face number to test and the tiling table contains the specific
 1207  * triangulations depending on the results
 1208  * A minus sign means to invert the result of the test.
 1209  */
 1210 //-----------------------------------------------------------------------------
 1211 static const TqInt tiling7_4_2[16][27] = {
 1212 /*  37: 0,    2,       5,        */  {   9,  4,  8,  4,  9,  5, 10,  5,  9,  1, 10,  9, 10,  1,  2,  0,  2,  1,  2,  0,  3,  8,  3,  0,  9,  8,  0 },
 1213 /* 133: 0,    2,             7,  */  {  11,  6, 10,  6, 11,  7,  8,  7, 11,  3,  8, 11,  8,  3,  0,  2,  0,  3,  0,  2,  1, 10,  1,  2, 11, 10,  2 },
 1214 /* 161: 0,             5,    7,  */  {  11,  3,  8,  0,  8,  3,  8,  0,  9,  8,  9,  4,  5,  4,  9,  4,  5,  7,  6,  7,  5,  7,  6, 11,  7, 11,  8 },
 1215 /*  26:    1,    3, 4,           */  {   8,  7, 11,  7,  8,  4,  9,  4,  8,  0,  9,  8,  9,  0,  1,  3,  1,  0,  1,  3,  2, 11,  2,  3,  8, 11,  3 },
 1216 /*  74:    1,    3,       6,     */  {  10,  5,  9,  5, 10,  6, 11,  6, 10,  2, 11, 10, 11,  2,  3,  1,  3,  2,  3,  1,  0,  9,  0,  1, 10,  9,  1 },
 1217 /*  82:    1,       4,    6,     */  {   8,  0,  9,  1,  9,  0,  9,  1, 10,  9, 10,  5,  6,  5, 10,  5,  6,  4,  7,  4,  6,  4,  7,  8,  4,  8,  9 },
 1218 /* 164:       2,       5,    7,  */  {   9,  1, 10,  2, 10,  1, 10,  2, 11, 10, 11,  6,  7,  6, 11,  6,  7,  5,  4,  5,  7,  5,  4,  9,  5,  9, 10 },
 1219 /*  88:          3, 4,    6,     */  {  10,  2, 11,  3, 11,  2, 11,  3,  8, 11,  8,  7,  4,  7,  8,  7,  4,  6,  5,  6,  4,  6,  5, 10,  6, 10, 11 },
 1220 /* 167: 0, 1, 2,       5,    7,  */  {  11,  2, 10,  2, 11,  3,  8,  3, 11,  7,  8, 11,  8,  7,  4,  6,  4,  7,  4,  6,  5, 10,  5,  6, 11, 10,  6 },
 1221 /*  91: 0, 1,    3, 4,    6,     */  {  10,  1,  9,  1, 10,  2, 11,  2, 10,  6, 11, 10, 11,  6,  7,  5,  7,  6,  7,  5,  4,  9,  4,  5, 10,  9,  5 },
 1222 /* 173: 0,    2, 3,    5,    7,  */  {   9,  0,  8,  0,  9,  1, 10,  1,  9,  5, 10,  9, 10,  5,  6,  4,  6,  5,  6,  4,  7,  8,  7,  4,  9,  8,  4 },
 1223 /* 181: 0,    2,    4, 5,    7,  */  {   9,  5, 10,  6, 10,  5, 10,  6, 11, 10, 11,  2,  3,  2, 11,  2,  3,  1,  0,  1,  3,  1,  0,  9,  1,  9, 10 },
 1224 /* 229: 0,    2,       5, 6, 7,  */  {  11,  7,  8,  4,  8,  7,  8,  4,  9,  8,  9,  0,  1,  0,  9,  0,  1,  3,  2,  3,  1,  3,  2, 11,  3, 11,  8 },
 1225 /*  94:    1, 2, 3, 4,    6,     */  {   8,  3, 11,  3,  8,  0,  9,  0,  8,  4,  9,  8,  9,  4,  5,  7,  5,  4,  5,  7,  6, 11,  6,  7,  8, 11,  7 },
 1226 /* 122:    1,    3, 4, 5, 6,     */  {  10,  6, 11,  7, 11,  6, 11,  7,  8, 11,  8,  3,  0,  3,  8,  3,  0,  2,  1,  2,  0,  2,  1, 10,  2, 10, 11 },
 1227 /* 218:    1,    3, 4,    6, 7,  */  {   8,  4,  9,  5,  9,  4,  9,  5, 10,  9, 10,  1,  2,  1, 10,  1,  2,  0,  3,  0,  2,  0,  3,  8,  0,  8,  9 }
 1228 };
 1229 //_____________________________________________________________________________
 1230 
 1231 
 1232 //_____________________________________________________________________________
 1233 /**
 1234  * \brief tiling table for case 8
 1235  * For each of the case above, the specific triangulation of the edge
 1236  * intersection points is given.
 1237  * When a case is ambiguous, there is an auxiliary table that contains
 1238  * the face number to test and the tiling table contains the specific
 1239  * triangulations depending on the results
 1240  * A minus sign means to invert the result of the test.
 1241  */
 1242 //-----------------------------------------------------------------------------
 1243 static const TqInt tiling8[6][6] = {
 1244 /*  15: 0, 1, 2, 3,              */  { 9,  8, 10, 10,  8, 11 },
 1245 /*  51: 0, 1,       4, 5,        */  { 1,  5,  3,  3,  5,  7 },
 1246 /* 153: 0,       3, 4,       7,  */  { 0,  4,  2,  4,  6,  2 },
 1247 /* 102:    1, 2,       5, 6,     */  { 0,  2,  4,  4,  2,  6 },
 1248 /* 204:       2, 3,       6, 7,  */  { 1,  3,  5,  3,  7,  5 },
 1249 /* 240:             4, 5, 6, 7,  */  { 9, 10,  8, 10, 11,  8 }
 1250 };
 1251 //_____________________________________________________________________________
 1252 
 1253 
 1254 //_____________________________________________________________________________
 1255 /**
 1256  * \brief tiling table for case 9
 1257  * For each of the case above, the specific triangulation of the edge
 1258  * intersection points is given.
 1259  * When a case is ambiguous, there is an auxiliary table that contains
 1260  * the face number to test and the tiling table contains the specific
 1261  * triangulations depending on the results
 1262  * A minus sign means to invert the result of the test.
 1263  */
 1264 //-----------------------------------------------------------------------------
 1265 static const TqInt tiling9[8][12] = {
 1266 /*  39: 0, 1, 2,       5,        */  {  2, 10,  5,  3,  2,  5,  3,  5,  4,  3,  4,  8 },
 1267 /*  27: 0, 1,    3, 4,           */  {  4,  7, 11,  9,  4, 11,  9, 11,  2,  9,  2,  1 },
 1268 /* 141: 0,    2, 3,          7,  */  { 10,  7,  6,  1,  7, 10,  1,  8,  7,  1,  0,  8 },
 1269 /* 177: 0,          4, 5,    7,  */  {  3,  6, 11,  0,  6,  3,  0,  5,  6,  0,  9,  5 },
 1270 /*  78:    1, 2, 3,       6,     */  {  3, 11,  6,  0,  3,  6,  0,  6,  5,  0,  5,  9 },
 1271 /* 114:    1,       4, 5, 6,     */  { 10,  6,  7,  1, 10,  7,  1,  7,  8,  1,  8,  0 },
 1272 /* 228:       2,       5, 6, 7,  */  {  4, 11,  7,  9, 11,  4,  9,  2, 11,  9,  1,  2 },
 1273 /* 216:          3, 4,    6, 7,  */  {  2,  5, 10,  3,  5,  2,  3,  4,  5,  3,  8,  4 }
 1274 };
 1275 //_____________________________________________________________________________
 1276 
 1277 
 1278 
 1279 //_____________________________________________________________________________
 1280 /**
 1281  * \brief test table for case 10
 1282  * 2 faces to test + eventually the interior
 1283  * When the tests on both specified faces are positive : 4 middle triangles (1)
 1284  * When the test on the first  specified face is positive : 8 first triangles
 1285  * When the test on the second specified face is positive : 8 next triangles
 1286  * When the tests on both specified faces are negative :
 1287  * - if the test on the interior is negative : 4 middle triangles
 1288  * - if the test on the interior is positive : 8 last triangles
 1289  *
 1290  * For each of the case above, the specific triangulation of the edge
 1291  * intersection points is given.
 1292  * When a case is ambiguous, there is an auxiliary table that contains
 1293  * the face number to test and the tiling table contains the specific
 1294  * triangulations depending on the results
 1295  * A minus sign means to invert the result of the test.
 1296  */
 1297 //-----------------------------------------------------------------------------
 1298 static const TqInt test10[6][3] = {
 1299 /* 195: 0, 1,             6, 7,  */  {  2,  4,  7 },
 1300 /*  85: 0,    2,    4,    6,     */  {  5,  6,  7 },
 1301 /* 105: 0,       3,    5, 6,     */  {  1,  3,  7 },
 1302 /* 150:    1, 2,    4,       7,  */  {  1,  3,  7 },
 1303 /* 170:    1,    3,    5,    7,  */  {  5,  6,  7 },
 1304 /*  60:       2, 3, 4, 5,        */  {  2,  4,  7 }
 1305 };
 1306 
 1307 //_____________________________________________________________________________
 1308 /**
 1309  * \brief tiling table for case 10.1.1
 1310  * For each of the case above, the specific triangulation of the edge
 1311  * intersection points is given.
 1312  * When a case is ambiguous, there is an auxiliary table that contains
 1313  * the face number to test and the tiling table contains the specific
 1314  * triangulations depending on the results
 1315  * A minus sign means to invert the result of the test.
 1316  */
 1317 //-----------------------------------------------------------------------------
 1318 static const TqInt tiling10_1_1[6][12] = {
 1319 /* 195: 0, 1,             6, 7,  */  {  5, 10,  7, 11,  7, 10,  8,  1,  9,  1,  8,  3 },
 1320 /*  85: 0,    2,    4,    6,     */  {  1,  2,  5,  6,  5,  2,  4,  3,  0,  3,  4,  7 },
 1321 /* 105: 0,       3,    5, 6,     */  { 11,  0,  8,  0, 11,  2,  4,  9,  6, 10,  6,  9 },
 1322 /* 150:    1, 2,    4,       7,  */  {  9,  0, 10,  2, 10,  0,  6,  8,  4,  8,  6, 11 },
 1323 /* 170:    1,    3,    5,    7,  */  {  7,  2,  3,  2,  7,  6,  0,  1,  4,  5,  4,  1 },
 1324 /*  60:       2, 3, 4, 5,        */  {  7,  9,  5,  9,  7,  8, 10,  1, 11,  3, 11,  1 }
 1325 };
 1326 
 1327 //_____________________________________________________________________________
 1328 /**
 1329  * \brief tiling table for case 10.1.1 inverted
 1330  * For each of the case above, the specific triangulation of the edge
 1331  * intersection points is given.
 1332  * When a case is ambiguous, there is an auxiliary table that contains
 1333  * the face number to test and the tiling table contains the specific
 1334  * triangulations depending on the results
 1335  * A minus sign means to invert the result of the test.
 1336  */
 1337 //-----------------------------------------------------------------------------
 1338 static const TqInt tiling10_1_1_[6][12] = {
 1339 /* 195: 0, 1,             6, 7,  */  {  5,  9,  7,  8,  7,  9, 11,  1, 10,  1, 11,  3 },
 1340 /*  85: 0,    2,    4,    6,     */  {  3,  2,  7,  6,  7,  2,  4,  1,  0,  1,  4,  5 },
 1341 /* 105: 0,       3,    5, 6,     */  { 10,  0,  9,  0, 10,  2,  4,  8,  6, 11,  6,  8 },
 1342 /* 150:    1, 2,    4,       7,  */  {  8,  0, 11,  2, 11,  0,  6,  9,  4,  9,  6, 10 },
 1343 /* 170:    1,    3,    5,    7,  */  {  5,  2,  1,  2,  5,  6,  0,  3,  4,  7,  4,  3 },
 1344 /*  60:       2, 3, 4, 5,        */  {  7, 10,  5, 10,  7, 11,  9,  1,  8,  3,  8,  1 }
 1345 };
 1346 
 1347 //_____________________________________________________________________________
 1348 /**
 1349  * \brief tiling table for case 10.1.2
 1350  * For each of the case above, the specific triangulation of the edge
 1351  * intersection points is given.
 1352  * When a case is ambiguous, there is an auxiliary table that contains
 1353  * the face number to test and the tiling table contains the specific
 1354  * triangulations depending on the results
 1355  * A minus sign means to invert the result of the test.
 1356  */
 1357 //-----------------------------------------------------------------------------
 1358 static const TqInt tiling10_1_2[6][24] = {
 1359 /* 195: 0, 1,             6, 7,  */  {  3, 11,  7,  3,  7,  8,  9,  8,  7,  5,  9,  7,  9,  5, 10,  9, 10,  1,  3,  1, 10, 11,  3, 10 },
 1360 /*  85: 0,    2,    4,    6,     */  {  7,  6,  5,  7,  5,  4,  0,  4,  5,  1,  0,  5,  0,  1,  2,  0,  2,  3,  7,  3,  2,  6,  7,  2 },
 1361 /* 105: 0,       3,    5, 6,     */  { 11,  2, 10,  6, 11, 10, 11,  6,  4, 11,  4,  8,  0,  8,  4,  9,  0,  4,  0,  9, 10,  0, 10,  2 },
 1362 /* 150:    1, 2,    4,       7,  */  { 11,  2, 10, 11, 10,  6,  4,  6, 10,  9,  4, 10,  4,  9,  0,  4,  0,  8, 11,  8,  0,  2, 11,  0 },
 1363 /* 170:    1,    3,    5,    7,  */  {  7,  6,  5,  4,  7,  5,  7,  4,  0,  7,  0,  3,  2,  3,  0,  1,  2,  0,  2,  1,  5,  2,  5,  6 },
 1364 /*  60:       2, 3, 4, 5,        */  {  7,  8,  3, 11,  7,  3,  7, 11, 10,  7, 10,  5,  9,  5, 10,  1,  9, 10,  9,  1,  3,  9,  3,  8 }
 1365 };
 1366 
 1367 //_____________________________________________________________________________
 1368 /**
 1369  * \brief tiling table for case 10.2
 1370  * For each of the case above, the specific triangulation of the edge
 1371  * intersection points is given.
 1372  * When a case is ambiguous, there is an auxiliary table that contains
 1373  * the face number to test and the tiling table contains the specific
 1374  * triangulations depending on the results
 1375  * A minus sign means to invert the result of the test.
 1376  */
 1377 //-----------------------------------------------------------------------------
 1378 static const TqInt tiling10_2[6][24] = {
 1379 /* 195: 0, 1,             6, 7,  */  { 12,  5,  9, 12,  9,  8, 12,  8,  3, 12,  3,  1, 12,  1, 10, 12, 10, 11, 12, 11,  7, 12,  7,  5 },
 1380 /*  85: 0,    2,    4,    6,     */  { 12,  1,  0, 12,  0,  4, 12,  4,  7, 12,  7,  3, 12,  3,  2, 12,  2,  6, 12,  6,  5, 12,  5,  1 },
 1381 /* 105: 0,       3,    5, 6,     */  {  4,  8, 12,  6,  4, 12, 10,  6, 12,  9, 10, 12,  0,  9, 12,  2,  0, 12, 11,  2, 12,  8, 11, 12 },
 1382 /* 150:    1, 2,    4,       7,  */  { 12,  9,  4, 12,  4,  6, 12,  6, 11, 12, 11,  8, 12,  8,  0, 12,  0,  2, 12,  2, 10, 12, 10,  9 },
 1383 /* 170:    1,    3,    5,    7,  */  {  0,  3, 12,  4,  0, 12,  5,  4, 12,  1,  5, 12,  2,  1, 12,  6,  2, 12,  7,  6, 12,  3,  7, 12 },
 1384 /*  60:       2, 3, 4, 5,        */  { 10,  5, 12, 11, 10, 12,  3, 11, 12,  1,  3, 12,  9,  1, 12,  8,  9, 12,  7,  8, 12,  5,  7, 12 }
 1385 };
 1386 
 1387 //_____________________________________________________________________________
 1388 /**
 1389  * \brief tiling table for case 10.2 inverted
 1390  * For each of the case above, the specific triangulation of the edge
 1391  * intersection points is given.
 1392  * When a case is ambiguous, there is an auxiliary table that contains
 1393  * the face number to test and the tiling table contains the specific
 1394  * triangulations depending on the results
 1395  * A minus sign means to invert the result of the test.
 1396  */
 1397 //-----------------------------------------------------------------------------
 1398 static const TqInt tiling10_2_[6][24] = {
 1399 /* 195: 0, 1,             6, 7,  */  {  8,  7, 12,  9,  8, 12,  1,  9, 12,  3,  1, 12, 11,  3, 12, 10, 11, 12,  5, 10, 12,  7,  5, 12 },
 1400 /*  85: 0,    2,    4,    6,     */  {  4,  5, 12,  0,  4, 12,  3,  0, 12,  7,  3, 12,  6,  7, 12,  2,  6, 12,  1,  2, 12,  5,  1, 12 },
 1401 /* 105: 0,       3,    5, 6,     */  { 12, 11,  6, 12,  6,  4, 12,  4,  9, 12,  9, 10, 12, 10,  2, 12,  2,  0, 12,  0,  8, 12,  8, 11 },
 1402 /* 150:    1, 2,    4,       7,  */  {  6, 10, 12,  4,  6, 12,  8,  4, 12, 11,  8, 12,  2, 11, 12,  0,  2, 12,  9,  0, 12, 10,  9, 12 },
 1403 /* 170:    1,    3,    5,    7,  */  { 12,  7,  4, 12,  4,  0, 12,  0,  1, 12,  1,  5, 12,  5,  6, 12,  6,  2, 12,  2,  3, 12,  3,  7 },
 1404 /*  60:       2, 3, 4, 5,        */  { 12,  7, 11, 12, 11, 10, 12, 10,  1, 12,  1,  3, 12,  3,  8, 12,  8,  9, 12,  9,  5, 12,  5,  7 }
 1405 };
 1406 //_____________________________________________________________________________
 1407 
 1408 
 1409 //_____________________________________________________________________________
 1410 /**
 1411  * \brief tiling table for case 11
 1412  * For each of the case above, the specific triangulation of the edge
 1413  * intersection points is given.
 1414  * When a case is ambiguous, there is an auxiliary table that contains
 1415  * the face number to test and the tiling table contains the specific
 1416  * triangulations depending on the results
 1417  * A minus sign means to invert the result of the test.
 1418  */
 1419 //-----------------------------------------------------------------------------
 1420 static const TqInt tiling11[12][12] = {
 1421 /*  23: 0, 1, 2,    4,           */  { 2, 10,  9,  2,  9,  7,  2,  7,  3,  7,  9,  4 },
 1422 /* 139: 0, 1,    3,          7,  */  { 1,  6,  2,  1,  8,  6,  1,  9,  8,  8,  7,  6 },
 1423 /*  99: 0, 1,          5, 6,     */  { 8,  3,  1,  8,  1,  6,  8,  6,  4,  6,  1, 10 },
 1424 /*  77: 0,    2, 3,       6,     */  { 0,  8, 11,  0, 11,  5,  0,  5,  1,  5, 11,  6 },
 1425 /*  57: 0,       3, 4, 5,        */  { 9,  5,  7,  9,  7,  2,  9,  2,  0,  2,  7, 11 },
 1426 /* 209: 0,          4,    6, 7,  */  { 5,  0,  4,  5, 11,  0,  5, 10, 11, 11,  3,  0 },
 1427 /*  46:    1, 2, 3,    5,        */  { 5,  4,  0,  5,  0, 11,  5, 11, 10, 11,  0,  3 },
 1428 /* 198:    1, 2,          6, 7,  */  { 9,  7,  5,  9,  2,  7,  9,  0,  2,  2, 11,  7 },
 1429 /* 178:    1,       4, 5,    7,  */  { 0, 11,  8,  0,  5, 11,  0,  1,  5,  5,  6, 11 },
 1430 /* 156:       2, 3, 4,       7,  */  { 8,  1,  3,  8,  6,  1,  8,  4,  6,  6, 10,  1 },
 1431 /* 116:       2,    4, 5, 6,     */  { 1,  2,  6,  1,  6,  8,  1,  8,  9,  8,  6,  7 },
 1432 /* 232:          3,    5, 6, 7,  */  { 2,  9, 10,  2,  7,  9,  2,  3,  7,  7,  4,  9 }
 1433 };
 1434 //_____________________________________________________________________________
 1435 
 1436 
 1437 //_____________________________________________________________________________
 1438 /**
 1439  * \brief test table for case 12
 1440  * 2 faces to test + eventually the interior
 1441  * When the tests on both specified faces are positive : 4 middle triangles (1)
 1442  * When the test on the first  specified face is positive : 8 first triangles
 1443  * When the test on the second specified face is positive : 8 next triangles
 1444  * When the tests on both specified faces are negative :
 1445  * - if the test on the interior is negative : 4 middle triangles
 1446  * - if the test on the interior is positive : 8 last triangles
 1447  * The support edge for the interior test is marked as the 4th column.
 1448  *
 1449  * For each of the case above, the specific triangulation of the edge
 1450  * intersection points is given.
 1451  * When a case is ambiguous, there is an auxiliary table that contains
 1452  * the face number to test and the tiling table contains the specific
 1453  * triangulations depending on the results
 1454  * A minus sign means to invert the result of the test.
 1455  */
 1456 //-----------------------------------------------------------------------------
 1457 static const TqInt test12[24][4] = {
 1458 /* 135: 0, 1, 2,             7,  */  {  4,  3,  7,  11 },
 1459 /*  75: 0, 1,    3,       6,     */  {  3,  2,  7,  10 },
 1460 /*  83: 0, 1,       4,    6,     */  {  2,  6,  7,   5 },
 1461 /* 163: 0, 1,          5,    7,  */  {  6,  4,  7,   7 },
 1462 /*  45: 0,    2, 3,    5,        */  {  2,  1,  7,   9 },
 1463 /*  53: 0,    2,    4, 5,        */  {  5,  2,  7,   1 },
 1464 /* 149: 0,    2,    4,       7,  */  {  5,  3,  7,   2 },
 1465 /* 101: 0,    2,       5, 6,     */  {  5,  1,  7,   0 },
 1466 /* 197: 0,    2,          6, 7,  */  {  5,  4,  7,   3 },
 1467 /*  89: 0,       3, 4,    6,     */  {  6,  3,  7,   6 },
 1468 /* 169: 0,       3,    5,    7,  */  {  1,  6,  7,   4 },
 1469 /* 225: 0,             5, 6, 7,  */  {  1,  4,  7,   8 },
 1470 /*  30:    1, 2, 3, 4,           */  {  4,  1,  7,   8 },
 1471 /*  86:    1, 2,    4,    6,     */  {  6,  1,  7,   4 },
 1472 /* 166:    1, 2,       5,    7,  */  {  3,  6,  7,   6 },
 1473 /*  58:    1,    3, 4, 5,        */  {  4,  5,  7,   3 },
 1474 /* 154:    1,    3, 4,       7,  */  {  1,  5,  7,   0 },
 1475 /* 106:    1,    3,    5, 6,     */  {  3,  5,  7,   2 },
 1476 /* 202:    1,    3,       6, 7,  */  {  2,  5,  7,   1 },
 1477 /* 210:    1,       4,    6, 7,  */  {  1,  2,  7,   9 },
 1478 /*  92:       2, 3, 4,    6,     */  {  4,  6,  7,   7 },
 1479 /* 172:       2, 3,    5,    7,  */  {  6,  2,  7,   5 },
 1480 /* 180:       2,    4, 5,    7,  */  {  2,  3,  7,  10 },
 1481 /* 120:          3, 4, 5, 6,     */  {  3,  4,  7,  11 }
 1482 };
 1483 
 1484 //_____________________________________________________________________________
 1485 /**
 1486  * \brief tiling table for case 12.1.1
 1487  * For each of the case above, the specific triangulation of the edge
 1488  * intersection points is given.
 1489  * When a case is ambiguous, there is an auxiliary table that contains
 1490  * the face number to test and the tiling table contains the specific
 1491  * triangulations depending on the results
 1492  * A minus sign means to invert the result of the test.
 1493  */
 1494 //-----------------------------------------------------------------------------
 1495 static const TqInt tiling12_1_1[24][12] = {
 1496 /* 135: 0, 1, 2,             7,  */  {  7,  6, 11, 10,  3,  2,  3, 10,  8,  9,  8, 10 },
 1497 /*  75: 0, 1,    3,       6,     */  {  6,  5, 10,  9,  2,  1,  2,  9, 11,  8, 11,  9 },
 1498 /*  83: 0, 1,       4,    6,     */  { 10,  6,  5,  7,  9,  4,  9,  7,  1,  3,  1,  7 },
 1499 /* 163: 0, 1,          5,    7,  */  {  7,  6, 11,  4,  8,  5,  3,  5,  8,  5,  3,  1 },
 1500 /*  45: 0,    2, 3,    5,        */  {  5,  4,  9,  8,  1,  0,  1,  8, 10, 11, 10,  8 },
 1501 /*  53: 0,    2,    4, 5,        */  {  1,  2, 10,  0,  9,  3,  5,  3,  9,  3,  5,  7 },
 1502 /* 149: 0,    2,    4,       7,  */  { 10,  1,  2,  0, 11,  3, 11,  0,  6,  4,  6,  0 },
 1503 /* 101: 0,    2,       5, 6,     */  {  8,  3,  0,  2,  9,  1,  9,  2,  4,  6,  4,  2 },
 1504 /* 197: 0,    2,          6, 7,  */  {  3,  0,  8,  2, 11,  1,  7,  1, 11,  1,  7,  5 },
 1505 /*  89: 0,       3, 4,    6,     */  {  6,  5, 10,  7, 11,  4,  2,  4, 11,  4,  2,  0 },
 1506 /* 169: 0,       3,    5,    7,  */  {  9,  5,  4,  6,  8,  7,  8,  6,  0,  2,  0,  6 },
 1507 /* 225: 0,             5, 6, 7,  */  {  8,  3,  0,  7,  4, 11,  9, 11,  4, 11,  9, 10 },
 1508 /*  30:    1, 2, 3, 4,           */  {  4,  7,  8, 11,  0,  3,  0, 11,  9, 10,  9, 11 },
 1509 /*  86:    1, 2,    4,    6,     */  {  4,  7,  8,  5,  9,  6,  0,  6,  9,  6,  0,  2 },
 1510 /* 166:    1, 2,       5,    7,  */  { 11,  7,  6,  4, 10,  5, 10,  4,  2,  0,  2,  4 },
 1511 /*  58:    1,    3, 4, 5,        */  { 11,  2,  3,  1,  8,  0,  8,  1,  7,  5,  7,  1 },
 1512 /* 154:    1,    3, 4,       7,  */  {  0,  1,  9,  3,  8,  2,  4,  2,  8,  2,  4,  6 },
 1513 /* 106:    1,    3,    5, 6,     */  {  2,  3, 11,  1, 10,  0,  6,  0, 10,  0,  6,  4 },
 1514 /* 202:    1,    3,       6, 7,  */  {  9,  0,  1,  3, 10,  2, 10,  3,  5,  7,  5,  3 },
 1515 /* 210:    1,       4,    6, 7,  */  {  9,  0,  1,  4,  5,  8, 10,  8,  5,  8, 10, 11 },
 1516 /*  92:       2, 3, 4,    6,     */  {  8,  4,  7,  5, 11,  6, 11,  5,  3,  1,  3,  5 },
 1517 /* 172:       2, 3,    5,    7,  */  {  5,  4,  9,  6, 10,  7,  1,  7, 10,  7,  1,  3 },
 1518 /* 180:       2,    4, 5,    7,  */  { 10,  1,  2,  5,  6,  9, 11,  9,  6,  9, 11,  8 },
 1519 /* 120:          3, 4, 5, 6,     */  { 11,  2,  3,  6,  7, 10,  8, 10,  7, 10,  8,  9 }
 1520 };
 1521 
 1522 //_____________________________________________________________________________
 1523 /**
 1524  * \brief tiling table for case 12.1.1 inverted
 1525  * For each of the case above, the specific triangulation of the edge
 1526  * intersection points is given.
 1527  * When a case is ambiguous, there is an auxiliary table that contains
 1528  * the face number to test and the tiling table contains the specific
 1529  * triangulations depending on the results
 1530  * A minus sign means to invert the result of the test.
 1531  */
 1532 //-----------------------------------------------------------------------------
 1533 static const TqInt tiling12_1_1_[24][12] = {
 1534 /* 135: 0, 1, 2,             7,  */  {  3,  2, 11, 10,  7,  6,  7, 10,  8,  9,  8, 10 },
 1535 /*  75: 0, 1,    3,       6,     */  {  2,  1, 10,  9,  6,  5,  6,  9, 11,  8, 11,  9 },
 1536 /*  83: 0, 1,       4,    6,     */  {  9,  4,  5,  7, 10,  6, 10,  7,  1,  3,  1,  7 },
 1537 /* 163: 0, 1,          5,    7,  */  {  7,  4,  8,  6, 11,  5,  3,  5, 11,  5,  3,  1 },
 1538 /*  45: 0,    2, 3,    5,        */  {  1,  0,  9,  8,  5,  4,  5,  8, 10, 11, 10,  8 },
 1539 /*  53: 0,    2,    4, 5,        */  {  1,  0,  9,  2, 10,  3,  5,  3, 10,  3,  5,  7 },
 1540 /* 149: 0,    2,    4,       7,  */  { 11,  3,  2,  0, 10,  1, 10,  0,  6,  4,  6,  0 },
 1541 /* 101: 0,    2,       5, 6,     */  {  9,  1,  0,  2,  8,  3,  8,  2,  4,  6,  4,  2 },
 1542 /* 197: 0,    2,          6, 7,  */  {  3,  2, 11,  0,  8,  1,  7,  1,  8,  1,  7,  5 },
 1543 /*  89: 0,       3, 4,    6,     */  {  6,  7, 11,  5, 10,  4,  2,  4, 10,  4,  2,  0 },
 1544 /* 169: 0,       3,    5,    7,  */  {  8,  7,  4,  6,  9,  5,  9,  6,  0,  2,  0,  6 },
 1545 /* 225: 0,             5, 6, 7,  */  {  8,  7,  4,  3,  0, 11,  9, 11,  0, 11,  9, 10 },
 1546 /*  30:    1, 2, 3, 4,           */  {  0,  3,  8, 11,  4,  7,  4, 11,  9, 10,  9, 11 },
 1547 /*  86:    1, 2,    4,    6,     */  {  4,  5,  9,  7,  8,  6,  0,  6,  8,  6,  0,  2 },
 1548 /* 166:    1, 2,       5,    7,  */  { 10,  5,  6,  4, 11,  7, 11,  4,  2,  0,  2,  4 },
 1549 /*  58:    1,    3, 4, 5,        */  {  8,  0,  3,  1, 11,  2, 11,  1,  7,  5,  7,  1 },
 1550 /* 154:    1,    3, 4,       7,  */  {  0,  3,  8,  1,  9,  2,  4,  2,  9,  2,  4,  6 },
 1551 /* 106:    1,    3,    5, 6,     */  {  2,  1, 10,  3, 11,  0,  6,  0, 11,  0,  6,  4 },
 1552 /* 202:    1,    3,       6, 7,  */  { 10,  2,  1,  3,  9,  0,  9,  3,  5,  7,  5,  3 },
 1553 /* 210:    1,       4,    6, 7,  */  {  9,  4,  5,  0,  1,  8, 10,  8,  1,  8, 10, 11 },
 1554 /*  92:       2, 3, 4,    6,     */  { 11,  6,  7,  5,  8,  4,  8,  5,  3,  1,  3,  5 },
 1555 /* 172:       2, 3,    5,    7,  */  {  5,  6, 10,  4,  9,  7,  1,  7,  9,  7,  1,  3 },
 1556 /* 180:       2,    4, 5,    7,  */  { 10,  5,  6,  1,  2,  9, 11,  9,  2,  9, 11,  8 },
 1557 /* 120:          3, 4, 5, 6,     */  { 11,  6,  7,  2,  3, 10,  8, 10,  3, 10,  8,  9 }
 1558 };
 1559 
 1560 //_____________________________________________________________________________
 1561 /**
 1562  * \brief tiling table for case 12.1.2
 1563  * For each of the case above, the specific triangulation of the edge
 1564  * intersection points is given.
 1565  * When a case is ambiguous, there is an auxiliary table that contains
 1566  * the face number to test and the tiling table contains the specific
 1567  * triangulations depending on the results
 1568  * A minus sign means to invert the result of the test.
 1569  */
 1570 //-----------------------------------------------------------------------------
 1571 static const TqInt tiling12_1_2[24][24] = {
 1572 /* 135: 0, 1, 2,             7,  */  {  7,  3, 11,  3,  7,  8,  9,  8,  7,  6,  9,  7,  9,  6, 10,  2, 10,  6, 11,  2,  6,  2, 11,  3 },
 1573 /*  75: 0, 1,    3,       6,     */  {  6,  2, 10,  2,  6, 11,  8, 11,  6,  5,  8,  6,  8,  5,  9,  1,  9,  5, 10,  1,  5,  1, 10,  2 },
 1574 /*  83: 0, 1,       4,    6,     */  { 10,  9,  5,  9, 10,  1,  3,  1, 10,  6,  3, 10,  3,  6,  7,  4,  7,  6,  5,  4,  6,  4,  5,  9 },
 1575 /* 163: 0, 1,          5,    7,  */  {  7,  8, 11,  3, 11,  8, 11,  3,  1, 11,  1,  6,  5,  6,  1,  6,  5,  4,  6,  4,  7,  8,  7,  4 },
 1576 /*  45: 0,    2, 3,    5,        */  {  5,  1,  9,  1,  5, 10, 11, 10,  5,  4, 11,  5, 11,  4,  8,  0,  8,  4,  9,  0,  4,  0,  9,  1 },
 1577 /*  53: 0,    2,    4, 5,        */  {  1,  9, 10,  5, 10,  9, 10,  5,  7, 10,  7,  2,  3,  2,  7,  2,  3,  0,  2,  0,  1,  9,  1,  0 },
 1578 /* 149: 0,    2,    4,       7,  */  { 10, 11,  2, 11, 10,  6,  4,  6, 10,  1,  4, 10,  4,  1,  0,  3,  0,  1,  2,  3,  1,  3,  2, 11 },
 1579 /* 101: 0,    2,       5, 6,     */  {  8,  9,  0,  9,  8,  4,  6,  4,  8,  3,  6,  8,  6,  3,  2,  1,  2,  3,  0,  1,  3,  1,  0,  9 },
 1580 /* 197: 0,    2,          6, 7,  */  {  3, 11,  8,  7,  8, 11,  8,  7,  5,  8,  5,  0,  1,  0,  5,  0,  1,  2,  0,  2,  3, 11,  3,  2 },
 1581 /*  89: 0,       3, 4,    6,     */  {  6, 11, 10,  2, 10, 11, 10,  2,  0, 10,  0,  5,  4,  5,  0,  5,  4,  7,  5,  7,  6, 11,  6,  7 },
 1582 /* 169: 0,       3,    5,    7,  */  {  9,  8,  4,  8,  9,  0,  2,  0,  9,  5,  2,  9,  2,  5,  6,  7,  6,  5,  4,  7,  5,  7,  4,  8 },
 1583 /* 225: 0,             5, 6, 7,  */  {  8,  4,  0,  9,  0,  4,  0,  9, 10,  0, 10,  3, 11,  3, 10,  3, 11,  7,  3,  7,  8,  4,  8,  7 },
 1584 /*  30:    1, 2, 3, 4,           */  {  4,  0,  8,  0,  4,  9, 10,  9,  4,  7, 10,  4, 10,  7, 11,  3, 11,  7,  8,  3,  7,  3,  8,  0 },
 1585 /*  86:    1, 2,    4,    6,     */  {  4,  9,  8,  0,  8,  9,  8,  0,  2,  8,  2,  7,  6,  7,  2,  7,  6,  5,  7,  5,  4,  9,  4,  5 },
 1586 /* 166:    1, 2,       5,    7,  */  { 11, 10,  6, 10, 11,  2,  0,  2, 11,  7,  0, 11,  0,  7,  4,  5,  4,  7,  6,  5,  7,  5,  6, 10 },
 1587 /*  58:    1,    3, 4, 5,        */  { 11,  8,  3,  8, 11,  7,  5,  7, 11,  2,  5, 11,  5,  2,  1,  0,  1,  2,  3,  0,  2,  0,  3,  8 },
 1588 /* 154:    1,    3, 4,       7,  */  {  0,  8,  9,  4,  9,  8,  9,  4,  6,  9,  6,  1,  2,  1,  6,  1,  2,  3,  1,  3,  0,  8,  0,  3 },
 1589 /* 106:    1,    3,    5, 6,     */  {  2, 10, 11,  6, 11, 10, 11,  6,  4, 11,  4,  3,  0,  3,  4,  3,  0,  1,  3,  1,  2, 10,  2,  1 },
 1590 /* 202:    1,    3,       6, 7,  */  {  9, 10,  1, 10,  9,  5,  7,  5,  9,  0,  7,  9,  7,  0,  3,  2,  3,  0,  1,  2,  0,  2,  1, 10 },
 1591 /* 210:    1,       4,    6, 7,  */  {  9,  5,  1, 10,  1,  5,  1, 10, 11,  1, 11,  0,  8,  0, 11,  0,  8,  4,  0,  4,  9,  5,  9,  4 },
 1592 /*  92:       2, 3, 4,    6,     */  {  8, 11,  7, 11,  8,  3,  1,  3,  8,  4,  1,  8,  1,  4,  5,  6,  5,  4,  7,  6,  4,  6,  7, 11 },
 1593 /* 172:       2, 3,    5,    7,  */  {  5, 10,  9,  1,  9, 10,  9,  1,  3,  9,  3,  4,  7,  4,  3,  4,  7,  6,  4,  6,  5, 10,  5,  6 },
 1594 /* 180:       2,    4, 5,    7,  */  { 10,  6,  2, 11,  2,  6,  2, 11,  8,  2,  8,  1,  9,  1,  8,  1,  9,  5,  1,  5, 10,  6, 10,  5 },
 1595 /* 120:          3, 4, 5, 6,     */  { 11,  7,  3,  8,  3,  7,  3,  8,  9,  3,  9,  2, 10,  2,  9,  2, 10,  6,  2,  6, 11,  7, 11,  6 }
 1596 };
 1597 
 1598 //_____________________________________________________________________________
 1599 /**
 1600  * \brief tiling table for case 12.2
 1601  * For each of the case above, the specific triangulation of the edge
 1602  * intersection points is given.
 1603  * When a case is ambiguous, there is an auxiliary table that contains
 1604  * the face number to test and the tiling table contains the specific
 1605  * triangulations depending on the results
 1606  * A minus sign means to invert the result of the test.
 1607  */
 1608 //-----------------------------------------------------------------------------
 1609 static const TqInt tiling12_2[24][24] = {
 1610 /* 135: 0, 1, 2,             7,  */  {   9,  8, 12, 10,  9, 12,  2, 10, 12,  3,  2, 12, 11,  3, 12,  6, 11, 12,  7,  6, 12,  8,  7, 12 },
 1611 /*  75: 0, 1,    3,       6,     */  {   8, 11, 12,  9,  8, 12,  1,  9, 12,  2,  1, 12, 10,  2, 12,  5, 10, 12,  6,  5, 12, 11,  6, 12 },
 1612 /*  83: 0, 1,       4,    6,     */  {   3,  1, 12,  7,  3, 12,  4,  7, 12,  9,  4, 12,  5,  9, 12,  6,  5, 12, 10,  6, 12,  1, 10, 12 },
 1613 /* 163: 0, 1,          5,    7,  */  {  12,  3,  1, 12,  1,  5, 12,  5,  6, 12,  6, 11, 12, 11,  7, 12,  7,  4, 12,  4,  8, 12,  8,  3 },
 1614 /*  45: 0,    2, 3,    5,        */  {  11, 10, 12,  8, 11, 12,  0,  8, 12,  1,  0, 12,  9,  1, 12,  4,  9, 12,  5,  4, 12, 10,  5, 12 },
 1615 /*  53: 0,    2,    4, 5,        */  {  12,  5,  7, 12,  7,  3, 12,  3,  2, 12,  2, 10, 12, 10,  1, 12,  1,  0, 12,  0,  9, 12,  9,  5 },
 1616 /* 149: 0,    2,    4,       7,  */  {   4,  6, 12,  0,  4, 12,  1,  0, 12, 10,  1, 12,  2, 10, 12,  3,  2, 12, 11,  3, 12,  6, 11, 12 },
 1617 /* 101: 0,    2,       5, 6,     */  {   6,  4, 12,  2,  6, 12,  3,  2, 12,  8,  3, 12,  0,  8, 12,  1,  0, 12,  9,  1, 12,  4,  9, 12 },
 1618 /* 197: 0,    2,          6, 7,  */  {  12,  7,  5, 12,  5,  1, 12,  1,  0, 12,  0,  8, 12,  8,  3, 12,  3,  2, 12,  2, 11, 12, 11,  7 },
 1619 /*  89: 0,       3, 4,    6,     */  {  12,  2,  0, 12,  0,  4, 12,  4,  5, 12,  5, 10, 12, 10,  6, 12,  6,  7, 12,  7, 11, 12, 11,  2 },
 1620 /* 169: 0,       3,    5,    7,  */  {   2,  0, 12,  6,  2, 12,  7,  6, 12,  8,  7, 12,  4,  8, 12,  5,  4, 12,  9,  5, 12,  0,  9, 12 },
 1621 /* 225: 0,             5, 6, 7,  */  {  12,  9, 10, 12, 10, 11, 12, 11,  7, 12,  7,  4, 12,  4,  8, 12,  8,  3, 12,  3,  0, 12,  0,  9 },
 1622 /*  30:    1, 2, 3, 4,           */  {  10,  9, 12, 11, 10, 12,  7, 11, 12,  4,  7, 12,  8,  4, 12,  3,  8, 12,  0,  3, 12,  9,  0, 12 },
 1623 /*  86:    1, 2,    4,    6,     */  {  12,  0,  2, 12,  2,  6, 12,  6,  7, 12,  7,  8, 12,  8,  4, 12,  4,  5, 12,  5,  9, 12,  9,  0 },
 1624 /* 166:    1, 2,       5,    7,  */  {   0,  2, 12,  4,  0, 12,  5,  4, 12, 10,  5, 12,  6, 10, 12,  7,  6, 12, 11,  7, 12,  2, 11, 12 },
 1625 /*  58:    1,    3, 4, 5,        */  {   5,  7, 12,  1,  5, 12,  0,  1, 12,  8,  0, 12,  3,  8, 12,  2,  3, 12, 11,  2, 12,  7, 11, 12 },
 1626 /* 154:    1,    3, 4,       7,  */  {  12,  4,  6, 12,  6,  2, 12,  2,  3, 12,  3,  8, 12,  8,  0, 12,  0,  1, 12,  1,  9, 12,  9,  4 },
 1627 /* 106:    1,    3,    5, 6,     */  {  12,  6,  4, 12,  4,  0, 12,  0,  1, 12,  1, 10, 12, 10,  2, 12,  2,  3, 12,  3, 11, 12, 11,  6 },
 1628 /* 202:    1,    3,       6, 7,  */  {   7,  5, 12,  3,  7, 12,  2,  3, 12, 10,  2, 12,  1, 10, 12,  0,  1, 12,  9,  0, 12,  5,  9, 12 },
 1629 /* 210:    1,       4,    6, 7,  */  {  12, 10, 11, 12, 11,  8, 12,  8,  0, 12,  0,  1, 12,  1,  9, 12,  9,  4, 12,  4,  5, 12,  5, 10 },
 1630 /*  92:       2, 3, 4,    6,     */  {   1,  3, 12,  5,  1, 12,  6,  5, 12, 11,  6, 12,  7, 11, 12,  4,  7, 12,  8,  4, 12,  3,  8, 12 },
 1631 /* 172:       2, 3,    5,    7,  */  {  12,  1,  3, 12,  3,  7, 12,  7,  4, 12,  4,  9, 12,  9,  5, 12,  5,  6, 12,  6, 10, 12, 10,  1 },
 1632 /* 180:       2,    4, 5,    7,  */  {  12, 11,  8, 12,  8,  9, 12,  9,  1, 12,  1,  2, 12,  2, 10, 12, 10,  5, 12,  5,  6, 12,  6, 11 },
 1633 /* 120:          3, 4, 5, 6,     */  {  12,  8,  9, 12,  9, 10, 12, 10,  2, 12,  2,  3, 12,  3, 11, 12, 11,  6, 12,  6,  7, 12,  7,  8 }
 1634 };
 1635 
 1636 //_____________________________________________________________________________
 1637 /**
 1638  * \brief tiling table for case 12.2 inverted
 1639  * For each of the case above, the specific triangulation of the edge
 1640  * intersection points is given.
 1641  * When a case is ambiguous, there is an auxiliary table that contains
 1642  * the face number to test and the tiling table contains the specific
 1643  * triangulations depending on the results
 1644  * A minus sign means to invert the result of the test.
 1645  */
 1646 //-----------------------------------------------------------------------------
 1647 static const TqInt tiling12_2_[24][24] = {
 1648 /* 135: 0, 1, 2,             7,  */  { 12,  2, 11, 12, 11,  7, 12,  7,  6, 12,  6, 10, 12, 10,  9, 12,  9,  8, 12,  8,  3, 12,  3,  2 },
 1649 /*  75: 0, 1,    3,       6,     */  { 12,  1, 10, 12, 10,  6, 12,  6,  5, 12,  5,  9, 12,  9,  8, 12,  8, 11, 12, 11,  2, 12,  2,  1 },
 1650 /*  83: 0, 1,       4,    6,     */  { 12,  4,  5, 12,  5, 10, 12, 10,  6, 12,  6,  7, 12,  7,  3, 12,  3,  1, 12,  1,  9, 12,  9,  4 },
 1651 /* 163: 0, 1,          5,    7,  */  {  7,  6, 12,  8,  7, 12,  4,  8, 12,  5,  4, 12,  1,  5, 12,  3,  1, 12, 11,  3, 12,  6, 11, 12 },
 1652 /*  45: 0,    2, 3,    5,        */  { 12,  0,  9, 12,  9,  5, 12,  5,  4, 12,  4,  8, 12,  8, 11, 12, 11, 10, 12, 10,  1, 12,  1,  0 },
 1653 /*  53: 0,    2,    4, 5,        */  {  1,  2, 12,  9,  1, 12,  0,  9, 12,  3,  0, 12,  7,  3, 12,  5,  7, 12, 10,  5, 12,  2, 10, 12 },
 1654 /* 149: 0,    2,    4,       7,  */  { 12,  1,  2, 12,  2, 11, 12, 11,  3, 12,  3,  0, 12,  0,  4, 12,  4,  6, 12,  6, 10, 12, 10,  1 },
 1655 /* 101: 0,    2,       5, 6,     */  { 12,  3,  0, 12,  0,  9, 12,  9,  1, 12,  1,  2, 12,  2,  6, 12,  6,  4, 12,  4,  8, 12,  8,  3 },
 1656 /* 197: 0,    2,          6, 7,  */  {  3,  0, 12, 11,  3, 12,  2, 11, 12,  1,  2, 12,  5,  1, 12,  7,  5, 12,  8,  7, 12,  0,  8, 12 },
 1657 /*  89: 0,       3, 4,    6,     */  {  6,  5, 12, 11,  6, 12,  7, 11, 12,  4,  7, 12,  0,  4, 12,  2,  0, 12, 10,  2, 12,  5, 10, 12 },
 1658 /* 169: 0,       3,    5,    7,  */  { 12,  7,  4, 12,  4,  9, 12,  9,  5, 12,  5,  6, 12,  6,  2, 12,  2,  0, 12,  0,  8, 12,  8,  7 },
 1659 /* 225: 0,             5, 6, 7,  */  {  8,  7, 12,  0,  8, 12,  3,  0, 12, 11,  3, 12, 10, 11, 12,  9, 10, 12,  4,  9, 12,  7,  4, 12 },
 1660 /*  30:    1, 2, 3, 4,           */  { 12,  7,  8, 12,  8,  0, 12,  0,  3, 12,  3, 11, 12, 11, 10, 12, 10,  9, 12,  9,  4, 12,  4,  7 },
 1661 /*  86:    1, 2,    4,    6,     */  {  4,  7, 12,  9,  4, 12,  5,  9, 12,  6,  5, 12,  2,  6, 12,  0,  2, 12,  8,  0, 12,  7,  8, 12 },
 1662 /* 166:    1, 2,       5,    7,  */  { 12,  5,  6, 12,  6, 11, 12, 11,  7, 12,  7,  4, 12,  4,  0, 12,  0,  2, 12,  2, 10, 12, 10,  5 },
 1663 /*  58:    1,    3, 4, 5,        */  { 12,  0,  3, 12,  3, 11, 12, 11,  2, 12,  2,  1, 12,  1,  5, 12,  5,  7, 12,  7,  8, 12,  8,  0 },
 1664 /* 154:    1,    3, 4,       7,  */  {  0,  3, 12,  9,  0, 12,  1,  9, 12,  2,  1, 12,  6,  2, 12,  4,  6, 12,  8,  4, 12,  3,  8, 12 },
 1665 /* 106:    1,    3,    5, 6,     */  {  2,  1, 12, 11,  2, 12,  3, 11, 12,  0,  3, 12,  4,  0, 12,  6,  4, 12, 10,  6, 12,  1, 10, 12 },
 1666 /* 202:    1,    3,       6, 7,  */  { 12,  2,  1, 12,  1,  9, 12,  9,  0, 12,  0,  3, 12,  3,  7, 12,  7,  5, 12,  5, 10, 12, 10,  2 },
 1667 /* 210:    1,       4,    6, 7,  */  {  9,  0, 12,  5,  9, 12,  4,  5, 12,  8,  4, 12, 11,  8, 12, 10, 11, 12,  1, 10, 12,  0,  1, 12 },
 1668 /*  92:       2, 3, 4,    6,     */  { 12,  6,  7, 12,  7,  8, 12,  8,  4, 12,  4,  5, 12,  5,  1, 12,  1,  3, 12,  3, 11, 12, 11,  6 },
 1669 /* 172:       2, 3,    5,    7,  */  {  5,  4, 12, 10,  5, 12,  6, 10, 12,  7,  6, 12,  3,  7, 12,  1,  3, 12,  9,  1, 12,  4,  9, 12 },
 1670 /* 180:       2,    4, 5,    7,  */  { 10,  1, 12,  6, 10, 12,  5,  6, 12,  9,  5, 12,  8,  9, 12, 11,  8, 12,  2, 11, 12,  1,  2, 12 },
 1671 /* 120:          3, 4, 5, 6,     */  { 11,  2, 12,  7, 11, 12,  6,  7, 12, 10,  6, 12,  9, 10, 12,  8,  9, 12,  3,  8, 12,  2,  3, 12 }
 1672 };
 1673 //_____________________________________________________________________________
 1674 
 1675 
 1676 
 1677 //_____________________________________________________________________________
 1678 /**
 1679  * \brief test table for case 13
 1680  * All faces are to be tested
 1681  *
 1682  * For each of the case above, the specific triangulation of the edge
 1683  * intersection points is given.
 1684  * When a case is ambiguous, there is an auxiliary table that contains
 1685  * the face number to test and the tiling table contains the specific
 1686  * triangulations depending on the results
 1687  * A minus sign means to invert the result of the test.
 1688  */
 1689 //-----------------------------------------------------------------------------
 1690 /* 13: face test */
 1691 static const TqInt test13[2][7] = {
 1692 /* 165: 0,    2,       5,    7,  */  { 1,2,3,4,5,6,7 },
 1693 /*  90:    1,    3, 4,    6,     */  { 2,3,4,1,5,6,7 },
 1694 };
 1695 
 1696 
 1697 
 1698 //_____________________________________________________________________________
 1699 /**
 1700  * \brief subconfiguration table for case 13
 1701  * Hard-coded tests for the subconfiguration determination
 1702  *
 1703  * For each of the case above, the specific triangulation of the edge
 1704  * intersection points is given.
 1705  * When a case is ambiguous, there is an auxiliary table that contains
 1706  * the face number to test and the tiling table contains the specific
 1707  * triangulations depending on the results
 1708  * A minus sign means to invert the result of the test.
 1709  */
 1710 //-----------------------------------------------------------------------------
 1711 /* 13: sub configs */
 1712 static const TqInt subconfig13[64] = {
 1713 /*  0: 0,0,0,0,0,0 */   0,
 1714 /*  1: 1,0,0,0,0,0 */   1,
 1715 /*  2: 0,1,0,0,0,0 */   2,
 1716 /*  3: 1,1,0,0,0,0 */   7,
 1717 /*  4: 0,0,1,0,0,0 */   3,
 1718 /*  5: 1,0,1,0,0,0 */  -1,
 1719 /*  6: 0,1,1,0,0,0 */  11,
 1720 /*  7: 1,1,1,0,0,0 */  -1,
 1721 /*  8: 0,0,0,1,0,0 */   4,
 1722 /*  9: 1,0,0,1,0,0 */   8,
 1723 /* 10: 0,1,0,1,0,0 */  -1,
 1724 /* 11: 1,1,0,1,0,0 */  -1,
 1725 /* 12: 0,0,1,1,0,0 */  14,
 1726 /* 13: 1,0,1,1,0,0 */  -1,
 1727 /* 14: 0,1,1,1,0,0 */  -1,
 1728 /* 15: 1,1,1,1,0,0 */  -1,
 1729 /* 16: 0,0,0,0,1,0 */   5,
 1730 /* 17: 1,0,0,0,1,0 */   9,
 1731 /* 18: 0,1,0,0,1,0 */  12,
 1732 /* 19: 1,1,0,0,1,0 */  23,
 1733 /* 20: 0,0,1,0,1,0 */  15,
 1734 /* 21: 1,0,1,0,1,0 */  -1,
 1735 /* 22: 0,1,1,0,1,0 */  21,
 1736 /* 23: 1,1,1,0,1,0 */  38,
 1737 /* 24: 0,0,0,1,1,0 */  17,
 1738 /* 25: 1,0,0,1,1,0 */  20,
 1739 /* 26: 0,1,0,1,1,0 */  -1,
 1740 /* 27: 1,1,0,1,1,0 */  36,
 1741 /* 28: 0,0,1,1,1,0 */  26,
 1742 /* 29: 1,0,1,1,1,0 */  33,
 1743 /* 30: 0,1,1,1,1,0 */  30,
 1744 /* 31: 1,1,1,1,1,0 */  44,
 1745 /* 32: 0,0,0,0,0,1 */   6,
 1746 /* 33: 1,0,0,0,0,1 */  10,
 1747 /* 34: 0,1,0,0,0,1 */  13,
 1748 /* 35: 1,1,0,0,0,1 */  19,
 1749 /* 36: 0,0,1,0,0,1 */  16,
 1750 /* 37: 1,0,1,0,0,1 */  -1,
 1751 /* 38: 0,1,1,0,0,1 */  25,
 1752 /* 39: 1,1,1,0,0,1 */  37,
 1753 /* 40: 0,0,0,1,0,1 */  18,
 1754 /* 41: 1,0,0,1,0,1 */  24,
 1755 /* 42: 0,1,0,1,0,1 */  -1,
 1756 /* 43: 1,1,0,1,0,1 */  35,
 1757 /* 44: 0,0,1,1,0,1 */  22,
 1758 /* 45: 1,0,1,1,0,1 */  32,
 1759 /* 46: 0,1,1,1,0,1 */  29,
 1760 /* 47: 1,1,1,1,0,1 */  43,
 1761 /* 48: 0,0,0,0,1,1 */  -1,
 1762 /* 49: 1,0,0,0,1,1 */  -1,
 1763 /* 50: 0,1,0,0,1,1 */  -1,
 1764 /* 51: 1,1,0,0,1,1 */  34,
 1765 /* 52: 0,0,1,0,1,1 */  -1,
 1766 /* 53: 1,0,1,0,1,1 */  -1,
 1767 /* 54: 0,1,1,0,1,1 */  28,
 1768 /* 55: 1,1,1,0,1,1 */  42,
 1769 /* 56: 0,0,0,1,1,1 */  -1,
 1770 /* 57: 1,0,0,1,1,1 */  31,
 1771 /* 58: 0,1,0,1,1,1 */  -1,
 1772 /* 59: 1,1,0,1,1,1 */  41,
 1773 /* 60: 0,0,1,1,1,1 */  27,
 1774 /* 61: 1,0,1,1,1,1 */  40,
 1775 /* 62: 0,1,1,1,1,1 */  39,
 1776 /* 63: 1,1,1,1,1,1 */  45,
 1777 };
 1778 
 1779 
 1780 //_____________________________________________________________________________
 1781 /**
 1782  * \brief tiling table for case 13.1
 1783  * For each of the case above, the specific triangulation of the edge
 1784  * intersection points is given.
 1785  * When a case is ambiguous, there is an auxiliary table that contains
 1786  * the face number to test and the tiling table contains the specific
 1787  * triangulations depending on the results
 1788  * A minus sign means to invert the result of the test.
 1789  */
 1790 //-----------------------------------------------------------------------------
 1791 /* 13.1 */
 1792 static const TqInt tiling13_1[2][12] = {
 1793 /* 165: 0,    2,       5,    7,  */  { 11,  7,  6,  1,  2, 10,  8,  3,  0,  9,  5, 4 },
 1794 /*  90:    1,    3, 4,    6,     */  {  8,  4,  7,  2,  3, 11,  9,  0,  1, 10,  6, 5 }
 1795 };
 1796 
 1797 //_____________________________________________________________________________
 1798 /**
 1799  * \brief tiling table for case 13.1 inverted
 1800  * For each of the case above, the specific triangulation of the edge
 1801  * intersection points is given.
 1802  * When a case is ambiguous, there is an auxiliary table that contains
 1803  * the face number to test and the tiling table contains the specific
 1804  * triangulations depending on the results
 1805  * A minus sign means to invert the result of the test.
 1806  */
 1807 //-----------------------------------------------------------------------------
 1808 /* 13.1 */
 1809 static const TqInt tiling13_1_[2][12] = {
 1810 /* 165: 0,    2,       5,    7,  */  { 7,  4,  8, 11,  3,  2,  1,  0,  9,  5,  6, 10 },
 1811 /*  90:    1,    3, 4,    6,     */  { 6,  7, 11, 10,  2,  1,  0,  3,  8,  4,  5,  9 }
 1812 };
 1813 
 1814 //_____________________________________________________________________________
 1815 /**
 1816  * \brief tiling table for case 13.2
 1817  * For each of the case above, the specific triangulation of the edge
 1818  * intersection points is given.
 1819  * When a case is ambiguous, there is an auxiliary table that contains
 1820  * the face number to test and the tiling table contains the specific
 1821  * triangulations depending on the results
 1822  * A minus sign means to invert the result of the test.
 1823  */
 1824 //-----------------------------------------------------------------------------
 1825 /* 13.2 */
 1826 static const TqInt tiling13_2[2][6][18] = {
 1827 /* 165: 0,    2,       5,    7,  */  {
 1828  /* 1 */ { 1,  2, 10, 11,  7,  6,  3,  4,  8,  4,  3,  5,  0,  5,  3,  5,  0,  9 },
 1829  /* 2 */ { 8,  3,  0, 11,  7,  6,  9,  1,  4,  2,  4,  1,  4,  2,  5, 10,  5,  2 },
 1830  /* 3 */ { 9,  5,  4,  8,  3,  0,  1,  6, 10,  6,  1,  7,  2,  7,  1,  7,  2, 11 },
 1831  /* 4 */ { 9,  5,  4,  1,  2, 10, 11,  3,  6,  0,  6,  3,  6,  0,  7,  8,  7,  0 },
 1832  /* 5 */ { 9,  5,  4, 11,  7,  6,  0, 10,  1, 10,  0,  8, 10,  8,  2,  3,  2,  8 },
 1833  /* 6 */ { 1,  2, 10,  3,  0,  8,  4,  9,  7, 11,  7,  9,  5, 11,  9, 11,  5,  6 }
 1834 },
 1835 /*  90:    1,    3, 4,    6,     */  {
 1836  /* 1 */ { 2,  3, 11,  8,  4,  7,  0,  5,  9,  5,  0,  6,  1,  6,  0,  6,  1, 10 },
 1837  /* 2 */ { 9,  0,  1,  8,  4,  7, 10,  2,  5,  3,  5,  2,  5,  3,  6, 11,  6,  3 },
 1838  /* 3 */ { 6,  5, 10,  9,  0,  1,  2,  7, 11,  7,  2,  4,  3,  4,  2,  4,  3,  8 },
 1839  /* 4 */ { 6,  5, 10,  2,  3, 11,  8,  0,  7,  1,  7,  0,  7,  1,  4,  9,  4,  1 },
 1840  /* 5 */ { 6,  5, 10,  8,  4,  7,  1, 11,  2, 11,  1,  9, 11,  9,  3,  0,  3,  9 },
 1841  /* 6 */ { 2,  3, 11,  0,  1,  9,  5, 10,  4,  8,  4, 10,  6,  8, 10,  8,  6,  7 }
 1842 } };
 1843 
 1844 //_____________________________________________________________________________
 1845 /**
 1846  * \brief tiling table for case 13.2 inverted
 1847  * For each of the case above, the specific triangulation of the edge
 1848  * intersection points is given.
 1849  * When a case is ambiguous, there is an auxiliary table that contains
 1850  * the face number to test and the tiling table contains the specific
 1851  * triangulations depending on the results
 1852  * A minus sign means to invert the result of the test.
 1853  */
 1854 //-----------------------------------------------------------------------------
 1855 /* 13.2 */
 1856 static const TqInt tiling13_2_[2][6][18] = {
 1857 /* 165: 0,    2,       5,    7,  */  {
 1858  /* 1 */ { 10,  5,  6, 11,  3,  2,  7,  0,  8,  0,  7,  1,  4,  1,  7,  1,  4,  9 },
 1859  /* 2 */ { 11,  3,  2,  7,  4,  8,  9,  5,  0,  6,  0,  5,  0,  6,  1, 10,  1,  6 },
 1860  /* 3 */ {  1,  0,  9,  7,  4,  8,  5,  2, 10,  2,  5,  3,  6,  3,  5,  3,  6, 11 },
 1861  /* 4 */ { 10,  5,  6,  1,  0,  9, 11,  7,  2,  4,  2,  7,  2,  4,  3,  8,  3,  4 },
 1862  /* 5 */ { 10,  5,  6,  7,  4,  8,  2, 11,  1,  9,  1, 11,  3,  9, 11,  9,  3,  0 },
 1863  /* 6 */ { 11,  3,  2,  9,  1,  0,  4, 10,  5, 10,  4,  8, 10,  8,  6,  7,  6,  8 }
 1864 },
 1865 /*  90:    1,    3, 4,    6,     */  {
 1866  /* 1 */ {  6,  7, 11,  8,  0,  3,  4,  1,  9,  1,  4,  2,  5,  2,  4,  2,  5, 10 },
 1867  /* 2 */ {  8,  0,  3,  4,  5,  9, 10,  6,  1,  7,  1,  6,  1,  7,  2, 11,  2,  7 },
 1868  /* 3 */ {  2,  1, 10,  4,  5,  9,  6,  3, 11,  3,  6,  0,  7,  0,  6,  0,  7,  8 },
 1869  /* 4 */ {  6,  7, 11,  2,  1, 10,  8,  4,  3,  5,  3,  4,  3,  5,  0,  9,  0,  5 },
 1870  /* 5 */ {  6,  7, 11,  4,  5,  9,  3,  8,  2, 10,  2,  8,  0, 10,  8, 10,  0,  1 },
 1871  /* 6 */ {  8,  0,  3, 10,  2,  1,  5, 11,  6, 11,  5,  9, 11,  9,  7,  4,  7,  9 }
 1872 } };
 1873 
 1874 //_____________________________________________________________________________
 1875 /**
 1876  * \brief tiling table for case 13.3
 1877  * For each of the case above, the specific triangulation of the edge
 1878  * intersection points is given.
 1879  * When a case is ambiguous, there is an auxiliary table that contains
 1880  * the face number to test and the tiling table contains the specific
 1881  * triangulations depending on the results
 1882  * A minus sign means to invert the result of the test.
 1883  */
 1884 //-----------------------------------------------------------------------------
 1885 /* 13.3 */
 1886 static const TqInt tiling13_3[2][12][30] = {
 1887 /* 165: 0,    2,       5,    7,  */  {
 1888  /* 1,2 */ { 11,  7,  6, 12,  2, 10, 12, 10,  5, 12,  5,  4, 12,  4,  8, 12,  8,  3, 12,  3,  0, 12,  0,  9, 12,  9,  1, 12,  1,  2 },
 1889  /* 1,4 */ {  1,  2, 10,  9,  5, 12,  0,  9, 12,  3,  0, 12, 11,  3, 12,  6, 11, 12,  7,  6, 12,  8,  7, 12,  4,  8, 12,  5,  4, 12 },
 1890  /* 1,5 */ { 11,  7,  6, 12,  5,  4, 12,  4,  8, 12,  8,  3, 12,  3,  2, 12,  2, 10, 12, 10,  1, 12,  1,  0, 12,  0,  9, 12,  9,  5 },
 1891  /* 1,6 */ {  1,  2, 10, 12,  3,  0, 12,  0,  9, 12,  9,  5, 12,  5,  6, 12,  6, 11, 12, 11,  7, 12,  7,  4, 12,  4,  8, 12,  8,  3 },
 1892  /* 2,3 */ {  8,  3,  0, 11,  7, 12,  2, 11, 12,  1,  2, 12,  9,  1, 12,  4,  9, 12,  5,  4, 12, 10,  5, 12,  6, 10, 12,  7,  6, 12 },
 1893  /* 2,5 */ { 11,  7,  6,  5,  4, 12, 10,  5, 12,  2, 10, 12,  3,  2, 12,  8,  3, 12,  0,  8, 12,  1,  0, 12,  9,  1, 12,  4,  9, 12 },
 1894  /* 2,6 */ {  8,  3,  0,  1,  2, 12,  9,  1, 12,  4,  9, 12,  7,  4, 12, 11,  7, 12,  6, 11, 12,  5,  6, 12, 10,  5, 12,  2, 10, 12 },
 1895  /* 3,4 */ {  9,  5,  4, 12,  0,  8, 12,  8,  7, 12,  7,  6, 12,  6, 10, 12, 10,  1, 12,  1,  2, 12,  2, 11, 12, 11,  3, 12,  3,  0 },
 1896  /* 3,5 */ {  9,  5,  4, 12,  7,  6, 12,  6, 10, 12, 10,  1, 12,  1,  0, 12,  0,  8, 12,  8,  3, 12,  3,  2, 12,  2, 11, 12, 11,  7 },
 1897  /* 3,6 */ {  8,  3,  0, 12,  1,  2, 12,  2, 11, 12, 11,  7, 12,  7,  4, 12,  4,  9, 12,  9,  5, 12,  5,  6, 12,  6, 10, 12, 10,  1 },
 1898  /* 4,5 */ {  9,  5,  4,  7,  6, 12,  8,  7, 12,  0,  8, 12,  1,  0, 12, 10,  1, 12,  2, 10, 12,  3,  2, 12, 11,  3, 12,  6, 11, 12 },
 1899  /* 4,6 */ {  1,  2, 10,  3,  0, 12, 11,  3, 12,  6, 11, 12,  5,  6, 12,  9,  5, 12,  4,  9, 12,  7,  4, 12,  8,  7, 12,  0,  8, 12 }
 1900 },
 1901 /*  90:    1,    3, 4,    6,     */  {
 1902  /* 1,2 */ {  8,  4,  7, 12,  3, 11, 12, 11,  6, 12,  6,  5, 12,  5,  9, 12,  9,  0, 12,  0,  1, 12,  1, 10, 12, 10,