commit 516451c4045bc750ae3550f4cde09e1f6e37fe55
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Thu Jun 17 17:35:08 2021 +0200

    Correct the Redmi mesh to eliminate the visible seams.

diff --git a/src/main/java/org/distorted/objects/TwistyRedi.java b/src/main/java/org/distorted/objects/TwistyRedi.java
index 4b2a4703..97d230e9 100644
--- a/src/main/java/org/distorted/objects/TwistyRedi.java
+++ b/src/main/java/org/distorted/objects/TwistyRedi.java
@@ -40,7 +40,7 @@ import java.util.Random;
 
 public class TwistyRedi extends TwistyObject
 {
-  private static final int FACES_PER_CUBIT =6;
+  private static final int FACES_PER_CUBIT =9;
 
   // the four rotation axis of a RubikRedi. Must be normalized.
   static final Static3D[] ROT_AXIS = new Static3D[]
@@ -112,31 +112,29 @@ public class TwistyRedi extends TwistyObject
   // YELLOW 6 WHITE 7 BLUE 8 GREEN 9 RED 10 ORANGE 11
   private static final int[][] mFaceMap = new int[][]
          {
-           {  4, 2, 0,12,12,12 },
-           {  2, 5, 0,12,12,12 },
-           {  3, 4, 0,12,12,12 },
-           {  5, 3, 0,12,12,12 },
-           {  1, 2, 4,12,12,12 },
-           {  5, 2, 1,12,12,12 },
-           {  4, 3, 1,12,12,12 },
-           {  1, 3, 5,12,12,12 },
-
-           { 10, 8,12,12,12,12 },
-           {  6,10,12,12,12,12 },
-           { 10, 9,12,12,12,12 },
-           {  7,10,12,12,12,12 },
-           {  8, 6,12,12,12,12 },
-           {  9, 6,12,12,12,12 },
-           {  9, 7,12,12,12,12 },
-           {  8, 7,12,12,12,12 },
-           { 11, 8,12,12,12,12 },
-           {  6,11,12,12,12,12 },
-           { 11, 9,12,12,12,12 },
-           {  7,11,12,12,12,12 },
+           {  4, 2, 0 },
+           {  2, 5, 0 },
+           {  3, 4, 0 },
+           {  5, 3, 0 },
+           {  1, 2, 4 },
+           {  5, 2, 1 },
+           {  4, 3, 1 },
+           {  1, 3, 5 },
+
+           { 10, 8,12 },
+           {  6,10,12 },
+           { 10, 9,12 },
+           {  7,10,12 },
+           {  8, 6,12 },
+           {  9, 6,12 },
+           {  9, 7,12 },
+           {  8, 7,12 },
+           { 11, 8,12 },
+           {  6,11,12 },
+           { 11, 9,12 },
+           {  7,11,12 },
          };
 
-  private static final float G = 0.72f;
-
   private static final double[][] VERTICES_CORNER = new double[][]
           {
              { 0.0f, 0.0f, 0.0f },
@@ -147,19 +145,6 @@ public class TwistyRedi extends TwistyObject
              { 0.5f, 0.5f,-0.5f },
              { 0.5f,-0.5f,-0.5f },
              {-0.5f, 0.5f,-0.5f },
-
-             {-0.5f, 0.5f*G, 0.5f },
-             {-0.5f,-0.5f*G, 0.5f },
-             {-0.5f*G,-0.5f, 0.5f },
-             { 0.5f*G,-0.5f, 0.5f },
-             { 0.5f,-0.5f, 0.5f*G },
-             { 0.5f,-0.5f,-0.5f*G },
-             { 0.5f,-0.5f*G,-0.5f },
-             { 0.5f, 0.5f*G,-0.5f },
-             { 0.5f*G, 0.5f,-0.5f },
-             {-0.5f*G, 0.5f,-0.5f },
-             {-0.5f, 0.5f,-0.5f*G },
-             {-0.5f, 0.5f, 0.5f*G },
           };
 
   private static final int[][] VERT_INDEXES_CORNER = new int[][]
@@ -168,9 +153,12 @@ public class TwistyRedi extends TwistyObject
              { 1,3,5,7 },
              { 4,6,5,3 },
 
-             { 2,10,11,4,0,5,16,17,7,0},
-             { 4,12,13,6,0,7,18,19,1,0},
-             { 1, 8, 9,2,0,6,14,15,5,0}
+             { 2,4,0 },
+             { 5,7,0 },
+             { 4,6,0 },
+             { 7,1,0 },
+             { 1,2,0 },
+             { 6,5,0 }
           };
 
   private static final double[][] VERTICES_EDGE = new double[][]
@@ -247,7 +235,7 @@ public class TwistyRedi extends TwistyObject
 
   int getNumStickerTypes(int numLayers)
     {
-    return 2;
+    return STICKERS.length;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -323,14 +311,14 @@ public class TwistyRedi extends TwistyObject
         {
         float[][] bands= new float[][]
           {
-             {0.06f,35,0.5f,0.7f,6,2,2},
-             {0.00f, 0,1.0f,0.0f,2,0,0}
+             {0.06f,35,0.5f,0.7f,5,2,2},
+             {0.01f,35,0.2f,0.4f,5,2,2}
           };
-        int[] bandIndexes   = new int[] { 0,0,0,1,1,1 };
+        int[] bandIndexes   = new int[] { 0,0,0,1,1,1,1,1,1 };
         float[][] corners   = new float[][] { {0.06f,0.12f} };
-        int[] cornerIndexes = new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
+        int[] cornerIndexes = new int[]  { -1,0,-1,0,0,0,-1,-1 };
         float[][] centers   = new float[][] { { 0.0f, 0.0f, 0.0f} };
-        int[] centerIndexes = new int[] { -1,0,-1,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 };
+        int[] centerIndexes = new int[] { -1,0,-1,0,0,0,-1,-1 };
 
         FactoryCubit factory = FactoryCubit.getInstance();
         factory.createNewFaceTransform(VERTICES_CORNER,VERT_INDEXES_CORNER);
@@ -379,7 +367,7 @@ public class TwistyRedi extends TwistyObject
 
   int getFaceColor(int cubit, int cubitface, int size)
     {
-    return mFaceMap[cubit][cubitface];
+    return cubitface<3 ? mFaceMap[cubit][cubitface] : STICKERS.length*FACE_COLORS.length;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/res/raw/redi.dmesh b/src/main/res/raw/redi.dmesh
index 359ffc5f..4d30d35e 100644
Binary files a/src/main/res/raw/redi.dmesh and b/src/main/res/raw/redi.dmesh differ
