commit dad33773f1406c76af3af2663d0e3f43a9a89c20
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Sun Dec 13 13:11:29 2020 +0100

    Progress with the Rex Cube (stickers)

diff --git a/src/main/java/org/distorted/objects/FactorySticker.java b/src/main/java/org/distorted/objects/FactorySticker.java
index 849e57e1..b1ce2d0b 100644
--- a/src/main/java/org/distorted/objects/FactorySticker.java
+++ b/src/main/java/org/distorted/objects/FactorySticker.java
@@ -27,11 +27,15 @@ import static org.distorted.objects.TwistyObject.COLOR_BLACK;
 import static org.distorted.objects.FactoryCubit.IVY_D;
 import static org.distorted.objects.FactoryCubit.IVY_C;
 import static org.distorted.objects.FactoryCubit.IVY_M;
+import static org.distorted.objects.FactoryCubit.REX_D;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 class FactorySticker
   {
+  private static final float SQ2 = (float)Math.sqrt(2);
+  private static final float SQ3 = (float)Math.sqrt(3);
+
   private static FactorySticker mThis;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -248,16 +252,77 @@ class FactorySticker
     paint.setColor(color);
     paint.setStyle(Paint.Style.FILL);
     canvas.drawRect(left,top,left+TEXTURE_HEIGHT,top+TEXTURE_HEIGHT,paint);
+
+    paint.setColor(COLOR_BLACK);
+    paint.setStyle(Paint.Style.STROKE);
+    paint.setStrokeWidth(stroke*TEXTURE_HEIGHT);
+
+    float T  = (0.5f-REX_D)*SQ2*(SQ3-1);
+    float H1 = T*(1.0f + 2*SQ3/3);
+    float H2 = T*(0.5f +   SQ3/6);
+    float D  = H2*SQ3;
+
+    float cx1 = left+ TEXTURE_HEIGHT*0.5f;
+    float cy1 = top + TEXTURE_HEIGHT*(0.5f+H1);
+    float cx2 = left+ TEXTURE_HEIGHT*(0.5f-D);
+    float cy2 = top + TEXTURE_HEIGHT*(0.5f+H2);
+    float cx3 = left+ TEXTURE_HEIGHT*(0.5f+D);
+    float cy3 = top + TEXTURE_HEIGHT*(0.5f+H2);
+
+    float R1= TEXTURE_HEIGHT*(1-2*REX_D);
+
+    canvas.drawArc( cx1-R1, cy1-R1, cx1+R1, cy1+R1, 255, 30, false ,paint);
+    canvas.drawArc( cx2-R1, cy2-R1, cx2+R1, cy2+R1, 315, 30, false ,paint);
+    canvas.drawArc( cx3-R1, cy3-R1, cx3+R1, cy3+R1, 195, 30, false ,paint);
+/*
+    float cx   = left+ TEXTURE_HEIGHT*0.5f;
+    float cy   = top + TEXTURE_HEIGHT*0.5f;
+    float R2   = radius*TEXTURE_HEIGHT;
+    float dist = ( (0.5f-REX_D)*(SQ3-1) - (2*SQ3/3)*radius )*TEXTURE_HEIGHT;
+
+    canvas.drawArc( cx+dist-R2, cy-R2, cx+dist+R2, cy+R2, 330, 60, false ,paint);
+    canvas.drawArc( cx-R2, cy+dist-R2, cx+R2, cy+dist+R2,  60, 60, false ,paint);
+    canvas.drawArc( cx-dist-R2, cy-R2, cx-dist+R2, cy+R2, 150, 60, false ,paint);
+    canvas.drawArc( cx-R2, cy-dist-R2, cx+R2, cy-dist+R2, 240, 60, false ,paint);
+ */
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
-// TODO
 
   void drawRexFaceSticker(Canvas canvas, Paint paint, int left, int top, int color, float stroke, float radius)
     {
     paint.setColor(color);
     paint.setStyle(Paint.Style.FILL);
     canvas.drawRect(left,top,left+TEXTURE_HEIGHT,top+TEXTURE_HEIGHT,paint);
+
+    paint.setColor(COLOR_BLACK);
+    paint.setStyle(Paint.Style.STROKE);
+    paint.setStrokeWidth(stroke*TEXTURE_HEIGHT);
+
+    float cx1 = left+ TEXTURE_HEIGHT*REX_D;
+    float cy1 = top + TEXTURE_HEIGHT*(1-REX_D);
+    float cx2 = left+ TEXTURE_HEIGHT*REX_D;
+    float cy2 = top + TEXTURE_HEIGHT*REX_D;
+    float cx3 = left+ TEXTURE_HEIGHT*(1-REX_D);
+    float cy3 = top + TEXTURE_HEIGHT*REX_D;
+    float cx4 = left+ TEXTURE_HEIGHT*(1-REX_D);
+    float cy4 = top + TEXTURE_HEIGHT*(1-REX_D);
+    float R1  = TEXTURE_HEIGHT*(1-2*REX_D);
+
+    canvas.drawArc( cx1-R1, cy1-R1, cx1+R1, cy1+R1, 300, 30, false ,paint);
+    canvas.drawArc( cx2-R1, cy2-R1, cx2+R1, cy2+R1,  30, 30, false ,paint);
+    canvas.drawArc( cx3-R1, cy3-R1, cx3+R1, cy3+R1, 120, 30, false ,paint);
+    canvas.drawArc( cx4-R1, cy4-R1, cx4+R1, cy4+R1, 210, 30, false ,paint);
+
+    float cx   = left+ TEXTURE_HEIGHT*0.5f;
+    float cy   = top + TEXTURE_HEIGHT*0.5f;
+    float R2   = radius*TEXTURE_HEIGHT;
+    float dist = ( (0.5f-REX_D)*(SQ3-1) - (2*SQ3/3)*radius )*TEXTURE_HEIGHT;
+
+    canvas.drawArc( cx+dist-R2, cy-R2, cx+dist+R2, cy+R2, 330, 60, false ,paint);
+    canvas.drawArc( cx-R2, cy+dist-R2, cx+R2, cy+dist+R2,  60, 60, false ,paint);
+    canvas.drawArc( cx-dist-R2, cy-R2, cx-dist+R2, cy+R2, 150, 60, false ,paint);
+    canvas.drawArc( cx-R2, cy-dist-R2, cx+R2, cy-dist+R2, 240, 60, false ,paint);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/objects/TwistyRex.java b/src/main/java/org/distorted/objects/TwistyRex.java
index c316a1e9..beccc19b 100644
--- a/src/main/java/org/distorted/objects/TwistyRex.java
+++ b/src/main/java/org/distorted/objects/TwistyRex.java
@@ -112,18 +112,18 @@ public class TwistyRex extends TwistyObject
            { 10, 18,18,18 },
            { 11, 18,18,18 },
 
-           {  4, 2, 18,18 },
-           {  4, 0, 18,18 },
-           {  4, 3, 18,18 },
-           {  4, 1, 18,18 },
-           {  0, 2, 18,18 },
-           {  3, 0, 18,18 },
-           {  3, 1, 18,18 },
-           {  1, 2, 18,18 },
-           {  2, 5, 18,18 },
-           {  0, 5, 18,18 },
-           {  5, 3, 18,18 },
-           {  1, 5, 18,18 },
+           { 16,14, 18,18 },
+           { 16,12, 18,18 },
+           { 16,15, 18,18 },
+           { 16,13, 18,18 },
+           { 12,14, 18,18 },
+           { 15,12, 18,18 },
+           { 15,13, 18,18 },
+           { 13,14, 18,18 },
+           { 14,17, 18,18 },
+           { 12,17, 18,18 },
+           { 17,15, 18,18 },
+           { 13,17, 18,18 },
          };
 
   private static MeshBase mCornerMesh, mFaceMesh, mEdgeMesh;
