commit b89898c5e10ed3c1666b5d38ffc92e2a6a0d6c6d
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Fri Oct 16 13:11:10 2020 +0100

    Progress with Skewb familty; separate StickerFactory class.

diff --git a/src/main/java/org/distorted/objects/CubitFactory.java b/src/main/java/org/distorted/objects/CubitFactory.java
deleted file mode 100644
index f70bff45..00000000
--- a/src/main/java/org/distorted/objects/CubitFactory.java
+++ /dev/null
@@ -1,1148 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Copyright 2020 Leszek Koltunski                                                               //
-//                                                                                               //
-// This file is part of Magic Cube.                                                              //
-//                                                                                               //
-// Magic Cube is free software: you can redistribute it and/or modify                            //
-// it under the terms of the GNU General Public License as published by                          //
-// the Free Software Foundation, either version 2 of the License, or                             //
-// (at your option) any later version.                                                           //
-//                                                                                               //
-// Magic Cube is distributed in the hope that it will be useful,                                 //
-// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
-// GNU General Public License for more details.                                                  //
-//                                                                                               //
-// You should have received a copy of the GNU General Public License                             //
-// along with Magic Cube.  If not, see <http://www.gnu.org/licenses/>.                           //
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-package org.distorted.objects;
-
-import org.distorted.library.effect.VertexEffect;
-import org.distorted.library.effect.VertexEffectDeform;
-import org.distorted.library.effect.VertexEffectMove;
-import org.distorted.library.effect.VertexEffectRotate;
-import org.distorted.library.effect.VertexEffectScale;
-import org.distorted.library.mesh.MeshBase;
-import org.distorted.library.mesh.MeshJoined;
-import org.distorted.library.mesh.MeshPolygon;
-import org.distorted.library.type.Static1D;
-import org.distorted.library.type.Static3D;
-import org.distorted.library.type.Static4D;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-public class CubitFactory
-  {
-  private static final float SQ2 = (float)Math.sqrt(2);
-  private static final float SQ3 = (float)Math.sqrt(3);
-  private static final float SQ6 = (float)Math.sqrt(6);
-
-  private static final Static1D RADIUS = new Static1D(1);
-
-  private static CubitFactory mThis;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private CubitFactory()
-    {
-
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public static CubitFactory getInstance()
-    {
-    if( mThis==null ) mThis = new CubitFactory();
-
-    return mThis;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// H - height of the band in the middle
-// alpha - angle of the edge  [0,90]
-// dist - often in a polygon the distance from edge to center is not 1, but something else.
-// This is the distance.
-// K - where to begin the second, much more flat part of the band. [0,1]
-// N - number of bands. N>=3
-//
-// theory: two distinct parts to the band:
-// 1) (0,B) - steep
-// 2) (B,1) - flat
-//
-// In first part, we have y = g(x) ; in second - y = g(f(x)) where
-//
-// g(x) = sqrt( R^2 - (x-D)^2 ) - R*cos(alpha)
-// f(x) = ((D-B)/(1-B)*x + B*(1-D)/(1-B)
-// h(x) = R*(sin(alpha) - sin(x))
-// R = H/(1-cos(alpha))
-// D = H*sin(alpha)
-// B = h(K*alpha)
-//
-// The N points are taken at:
-//
-// 1) in the second part, there are K2 = (N-3)/3 such points
-// 2) in the first - K1 = (N-3) - K2
-// 3) also, the 3 points 0,B,1
-//
-// so we have the sequence A[i] of N points
-//
-// 0
-// h((i+1)*(1-K)*alpha/(K1+1)) (i=0,1,...,K1-1)
-// B
-// (1-B)*(i+1)/(K2+1) + B   (i=0,i,...,K2-1)
-// 1
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private float f(float D, float B, float x)
-    {
-    return ((D-B)*x + B*(1-D))/(1-B);
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private float g(float R, float D, float x, float cosAlpha)
-    {
-    float d = x-D;
-    return (float)(Math.sqrt(R*R-d*d)-R*cosAlpha);
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private float h(float R, float sinAlpha, float x)
-    {
-    return R*(sinAlpha-(float)Math.sin(x));
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private float[] computeBands(float H, int alpha, float dist, float K, int N)
-    {
-    float[] bands = new float[2*N];
-
-    bands[0] = 1.0f;
-    bands[1] = 0.0f;
-
-    float beta = (float)Math.atan(dist*Math.tan(Math.PI*alpha/180));
-    float sinBeta = (float)Math.sin(beta);
-    float cosBeta = (float)Math.cos(beta);
-    float R = cosBeta<1.0f ? H/(1.0f-cosBeta) : 0.0f;
-    float D = R*sinBeta;
-    float B = h(R,sinBeta,K*beta);
-
-    if( D>1.0f )
-      {
-      for(int i=1; i<N; i++)
-        {
-        bands[2*i  ] = (float)(N-1-i)/(N-1);
-        bands[2*i+1] = H*(1-bands[2*i]);
-        }
-      }
-    else
-      {
-      int K2 = (int)((N-3)*K);
-      int K1 = (N-3)-K2;
-
-      for(int i=0; i<=K1; i++)
-        {
-        float angle = K*beta + (1-K)*beta*(K1-i)/(K1+1);
-        float x = h(R,sinBeta,angle);
-        bands[2*i+2] = 1.0f - x;
-        bands[2*i+3] = g(R,D,x,cosBeta);
-        }
-
-      for(int i=0; i<=K2; i++)
-        {
-        float x = (1-B)*(i+1)/(K2+1) + B;
-        bands[2*K1+2 + 2*i+2] = 1.0f - x;
-        bands[2*K1+2 + 2*i+3] = g(R,D,f(D,B,x),cosBeta);
-        }
-      }
-
-    bands[2*N-2] = 0.0f;
-    bands[2*N-1] =    H;
-
-    return bands;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private void roundCorners(MeshBase mesh, Static3D center, Static3D[] vertices, float strength, float regionRadius)
-    {
-    Static4D reg= new Static4D(0,0,0,regionRadius);
-
-    float centX = center.get0();
-    float centY = center.get1();
-    float centZ = center.get2();
-
-    for (Static3D vertex : vertices)
-      {
-      float x = strength*(centX - vertex.get0());
-      float y = strength*(centY - vertex.get1());
-      float z = strength*(centZ - vertex.get2());
-
-      VertexEffect effect = new VertexEffectDeform(new Static3D(x,y,z), RADIUS, vertex, reg);
-      mesh.apply(effect);
-      }
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  MeshBase createFacesCube(int sizeIndex)
-    {
-    MeshBase[] meshes = new MeshPolygon[6];
-
-    float E = 0.5f;
-    int extraI, extraV, num;
-
-    switch(sizeIndex)
-      {
-      case 0 : num = 6; extraI = 2; extraV = 2; break;
-      case 1 : num = 5; extraI = 2; extraV = 2; break;
-      case 2 : num = 5; extraI = 1; extraV = 2; break;
-      default: num = 4; extraI = 1; extraV = 1; break;
-      }
-
-    float[] vertices = { -E,-E, +E,-E, +E,+E, -E,+E };
-    float[] bands = computeBands(0.048f,35,E,0.7f,num);
-
-    meshes[0] = new MeshPolygon(vertices,bands,extraI,extraV);
-    meshes[0].setEffectAssociation(0,1,0);
-    meshes[1] = meshes[0].copy(true);
-    meshes[1].setEffectAssociation(0,2,0);
-    meshes[2] = meshes[0].copy(true);
-    meshes[2].setEffectAssociation(0,4,0);
-    meshes[3] = meshes[0].copy(true);
-    meshes[3].setEffectAssociation(0,8,0);
-    meshes[4] = meshes[0].copy(true);
-    meshes[4].setEffectAssociation(0,16,0);
-    meshes[5] = meshes[0].copy(true);
-    meshes[5].setEffectAssociation(0,32,0);
-
-    return new MeshJoined(meshes);
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  MeshBase createFacesSkewbCorner()
-    {
-    MeshBase[] meshes = new MeshBase[6];
-
-    float E = 0.5f;
-    float F = SQ2/2;
-    float[] vertices0 = { -E+E/4,E/4, E/4,-E+E/4, E/4,E/4};
-    float[] bands0 = computeBands(0.028f,35,E/3,0.7f,7);
-
-    meshes[0] = new MeshPolygon(vertices0, bands0, 3, 3);
-    meshes[0].setEffectAssociation(0,1,0);
-    meshes[1] = meshes[0].copy(true);
-    meshes[1].setEffectAssociation(0,2,0);
-    meshes[2] = meshes[0].copy(true);
-    meshes[2].setEffectAssociation(0,4,0);
-
-    float[] vertices1 = { 0,0, F,0, 7*F/8,(SQ3/8)*F, 5*F/8,(3*SQ3/8)*F, F/2,(SQ3/2)*F };
-    float[] bands1 = computeBands(0,0,1,0,3);
-
-    meshes[3] = new MeshPolygon(vertices1,bands1,1,5);
-    meshes[3].setEffectAssociation(0,8,0);
-    meshes[4] = meshes[3].copy(true);
-    meshes[4].setEffectAssociation(0,16,0);
-    meshes[5] = meshes[3].copy(true);
-    meshes[5].setEffectAssociation(0,32,0);
-
-    return new MeshJoined(meshes);
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  MeshBase createFacesSkewbFace()
-    {
-    MeshBase[] meshes = new MeshBase[5];
-
-    float E = SQ2/4;
-    float[] vertices0 = { -E,-E, +E,-E, +E,+E, -E,+E };
-    float[] bands0 = computeBands(0.051f,35,E/2,0.9f,7);
-
-    meshes[0] = new MeshPolygon(vertices0, bands0, 3, 3);
-    meshes[0].setEffectAssociation(0,1,0);
-
-    float[] vertices1 = { -E,-SQ3*E, -E*0.7f,-SQ3*E, +E*0.7f,-SQ3*E, +E,-SQ3*E, 0,0 };
-    float[] bands1 = computeBands(0,0,1,0,3);
-
-    meshes[1] = new MeshPolygon(vertices1,bands1,0,0);
-    meshes[1].setEffectAssociation(0,2,0);
-    meshes[2] = meshes[1].copy(true);
-    meshes[2].setEffectAssociation(0,4,0);
-    meshes[3] = meshes[1].copy(true);
-    meshes[3].setEffectAssociation(0,8,0);
-    meshes[4] = meshes[1].copy(true);
-    meshes[4].setEffectAssociation(0,16,0);
-
-    return new MeshJoined(meshes);
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  MeshBase createFacesOcta()
-    {
-    MeshBase[] meshes = new MeshPolygon[8];
-
-    float E = SQ3/2;
-    float F = 0.5f;
-    float[] vertices = { -F,-E/3, +F,-E/3, 0.0f,2*E/3};
-    float[] bands = computeBands(0.05f,35,F,0.8f,6);
-
-    meshes[0] = new MeshPolygon(vertices, bands, 2,2);
-    meshes[0].setEffectAssociation(0,1,0);
-    meshes[1] = meshes[0].copy(true);
-    meshes[1].setEffectAssociation(0,2,0);
-    meshes[2] = meshes[0].copy(true);
-    meshes[2].setEffectAssociation(0,4,0);
-    meshes[3] = meshes[0].copy(true);
-    meshes[3].setEffectAssociation(0,8,0);
-    meshes[4] = meshes[0].copy(true);
-    meshes[4].setEffectAssociation(0,16,0);
-    meshes[5] = meshes[0].copy(true);
-    meshes[5].setEffectAssociation(0,32,0);
-    meshes[6] = meshes[0].copy(true);
-    meshes[6].setEffectAssociation(0,64,0);
-    meshes[7] = meshes[0].copy(true);
-    meshes[7].setEffectAssociation(0,128,0);
-
-    return new MeshJoined(meshes);
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  MeshBase createFacesTetra()
-    {
-    MeshBase[] meshes = new MeshBase[4];
-
-    float E = SQ3/2;
-    float F = 0.5f;
-    float[] vertices = { -F,-E/3, +F,-E/3, 0.0f,2*E/3};
-    float[] bands = computeBands(0.05f,35,F,0.8f,6);
-
-    meshes[0] = new MeshPolygon(vertices, bands, 2,2);
-    meshes[0].setEffectAssociation(0,1,0);
-    meshes[1] = meshes[0].copy(true);
-    meshes[1].setEffectAssociation(0,2,0);
-    meshes[2] = meshes[0].copy(true);
-    meshes[2].setEffectAssociation(0,4,0);
-    meshes[3] = meshes[0].copy(true);
-    meshes[3].setEffectAssociation(0,8,0);
-
-    return new MeshJoined(meshes);
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  MeshBase createFacesDino()
-    {
-    MeshBase[] meshes = new MeshPolygon[4];
-
-    float E = 0.5f*SQ2;
-    float F = 0.5f;
-    float[] vertices0 = { -F,F/3, 0,-2*F/3, +F,F/3 };
-    float[] bands0 = computeBands(0.028f,30,F/3,0.8f,7);
-
-    meshes[0] = new MeshPolygon(vertices0, bands0, 2, 5);
-    meshes[0].setEffectAssociation(0,1,0);
-    meshes[1] = meshes[0].copy(true);
-    meshes[1].setEffectAssociation(0,2,0);
-
-    float[] vertices1 = { -E/2,-E*(SQ3/6), E/2,-E*(SQ3/6), 0,E*(SQ3/3) };
-    float[] bands1 = computeBands(0.02f,45,F/3,0.2f,3);
-
-    meshes[2] = new MeshPolygon(vertices1, bands1, 1, 2);
-    meshes[2].setEffectAssociation(0,4,0);
-    meshes[3] = meshes[2].copy(true);
-    meshes[3].setEffectAssociation(0,8,0);
-
-    return new MeshJoined(meshes);
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  MeshBase createFacesHelicopterCorner()
-    {
-    MeshBase[] meshes = new MeshBase[6];
-
-    float E = 0.5f;
-    float F = SQ2/4;
-    float G = 1.0f/12;
-    float[] vertices0 = { -E+E/4,E/4, E/4,-E+E/4, E/4,E/4};
-    float[] bands0 = computeBands(0.028f,35,E/4,0.7f,7);
-
-    meshes[0] = new MeshPolygon(vertices0, bands0, 3, 3);
-    meshes[0].setEffectAssociation(0,1,0);
-    meshes[1] = meshes[0].copy(true);
-    meshes[1].setEffectAssociation(0,2,0);
-    meshes[2] = meshes[0].copy(true);
-    meshes[2].setEffectAssociation(0,4,0);
-
-    float[] vertices1 = { -F,-G, 0,-G, +F,-G, 0,2*G };
-    float[] bands1 = computeBands(0.00f,0,0,0.0f,3);
-    meshes[3] = new MeshPolygon(vertices1,bands1,1,5);
-    meshes[3].setEffectAssociation(0,8,0);
-    meshes[4] = meshes[3].copy(true);
-    meshes[4].setEffectAssociation(0,16,0);
-    meshes[5] = meshes[3].copy(true);
-    meshes[5].setEffectAssociation(0,32,0);
-
-    return new MeshJoined(meshes);
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  MeshBase createFacesHelicopterFace()
-    {
-    MeshBase[] meshes = new MeshBase[4];
-
-    float E = 0.5f;
-    float F = SQ2/4;
-    float G = 1.0f/12;
-    float[] vertices0 = { -E+E/4,E/4, E/4,-E+E/4, E/4,E/4};
-    float[] bands0 = computeBands(0.028f,35,E/4,0.7f,7);
-
-    meshes[0] = new MeshPolygon(vertices0, bands0, 3, 3);
-    meshes[0].setEffectAssociation(0,1,0);
-
-    float[] vertices1 = { -F,-G, +F,-G, 0,2*G};
-    float[] bands1 = computeBands(0.01f,45,F,0.0f,3);
-
-    meshes[1] = new MeshPolygon(vertices1, bands1, 1, 3);
-    meshes[1].setEffectAssociation(0,2,0);
-
-    float[] vertices2 = { -E/2,-F/3, +E/2,-F/3, 0,2*F/3};
-
-    meshes[2] = new MeshPolygon(vertices2, bands1, 1, 3);
-    meshes[2].setEffectAssociation(0,4,0);
-    meshes[3] = meshes[2].copy(true);
-    meshes[3].setEffectAssociation(0,8,0);
-
-    return new MeshJoined(meshes);
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  MeshBase createFacesRediEdge()
-    {
-    MeshBase[] meshes = new MeshPolygon[6];
-
-    float F = 0.25f;
-    float[] vertices0 = { -F,+F, -F,-F, 0, -2*F, +F,-F, +F,+F };
-    float[] bands0 = computeBands(0.038f,35,F,0.7f,7);
-
-    meshes[0] = new MeshPolygon(vertices0, bands0, 2, 2);
-    meshes[0].setEffectAssociation(0,1,0);
-    meshes[1] = meshes[0].copy(true);
-    meshes[1].setEffectAssociation(0,2,0);
-
-    float[] bands1 = computeBands(0.02f,35,F/2,0.2f,3);
-    float[] vertices1 = { -F/2, +F/2, -F/2, -1.5f*F, 1.5f*F, +F/2 };
-
-    meshes[2] = new MeshPolygon(vertices1, bands1, 1, 2);
-    meshes[2].setEffectAssociation(0,4,0);
-    meshes[3] = meshes[2].copy(true);
-    meshes[3].setEffectAssociation(0,8,0);
-
-    float X = 0.25f*SQ2;
-    float Y = SQ6/16;
-    float[] vertices2 = { -X, Y, -1.5f*X, -Y, +1.5f*X, -Y, +X, Y };
-
-    meshes[4] = new MeshPolygon(vertices2, bands1, 1, 1);
-    meshes[4].setEffectAssociation(0,16,0);
-    meshes[5] = meshes[4].copy(true);
-    meshes[5].setEffectAssociation(0,32,0);
-
-    return new MeshJoined(meshes);
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  MeshBase createFacesRediCorner()
-    {
-    MeshBase[] meshes = new MeshBase[6];
-
-    float E = 0.5f;
-    float[] vertices0 = { -E,-E, +E,-E, +E,+E, -E,+E };
-    float[] bands0 = computeBands(0.06f,35,E,0.7f,6);
-
-    meshes[0] = new MeshPolygon(vertices0,bands0,2,2);
-    meshes[0].setEffectAssociation(0,1,0);
-    meshes[1] = meshes[0].copy(true);
-    meshes[1].setEffectAssociation(0,2,0);
-    meshes[2] = meshes[0].copy(true);
-    meshes[2].setEffectAssociation(0,4,0);
-
-    float F = SQ2/2;
-    float X = 0.5f;
-    float G = 0.72f;
-    float[] vertices1 = { -E,+F, -E+X,0, -E,-F, -E*G,-F, +E*G,-F, +E,-F, +E-X,0, +E,+F, +E*G,+F, -E*G,+F };
-    float[] bands1 = computeBands(0.0f,0,1.0f,0.0f,2);
-
-    meshes[3] = new MeshPolygon(vertices1,bands1,0,0);
-    meshes[3].setEffectAssociation(0,8,0);
-    meshes[4] = meshes[3].copy(true);
-    meshes[4].setEffectAssociation(0,16,0);
-    meshes[5] = meshes[3].copy(true);
-    meshes[5].setEffectAssociation(0,32,0);
-
-    return new MeshJoined(meshes);
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// EFFECTS
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  VertexEffect[] createVertexEffectsCube()
-    {
-    Static3D axisY   = new Static3D(0,1,0);
-    Static3D axisX   = new Static3D(1,0,0);
-    Static3D center  = new Static3D(0,0,0);
-    Static1D angle90 = new Static1D(90);
-    Static1D angle180= new Static1D(180);
-    Static1D angle270= new Static1D(270);
-
-    VertexEffect[] effect = new VertexEffect[6];
-
-    effect[0] = new VertexEffectMove(new Static3D(0,0,+0.5f));
-    effect[1] = new VertexEffectRotate( angle180, axisX, center );
-    effect[2] = new VertexEffectRotate( angle90 , axisX, center );
-    effect[3] = new VertexEffectRotate( angle270, axisX, center );
-    effect[4] = new VertexEffectRotate( angle270, axisY, center );
-    effect[5] = new VertexEffectRotate( angle90 , axisY, center );
-
-    effect[0].setMeshAssociation(63,-1);  // all 6 sides
-    effect[1].setMeshAssociation(32,-1);  // back
-    effect[2].setMeshAssociation( 8,-1);  // bottom
-    effect[3].setMeshAssociation( 4,-1);  // top
-    effect[4].setMeshAssociation( 2,-1);  // left
-    effect[5].setMeshAssociation( 1,-1);  // right
-
-    return effect;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  VertexEffect[] createVertexEffectsSkewbCorner()
-    {
-    float E = 0.5f;
-
-    Static3D axisX  = new Static3D(1,0,0);
-    Static3D axisY  = new Static3D(0,1,0);
-    Static3D axis0  = new Static3D(-SQ2/2,0,SQ2/2);
-    Static3D axis1  = new Static3D(+SQ3/3,+SQ3/3,+SQ3/3);
-    Static1D angle1 = new Static1D(+90);
-    Static1D angle2 = new Static1D(-90);
-    Static1D angle3 = new Static1D(-15);
-    Static1D angle4 = new Static1D((float)((180.0f/Math.PI)*Math.acos(SQ3/3)));
-    Static1D angle5 = new Static1D(120);
-    Static1D angle6 = new Static1D(240);
-    Static3D center1= new Static3D(0,0,0);
-    Static3D center2= new Static3D(-0.5f,-0.5f,-0.5f);
-    Static3D move1  = new Static3D(-E/4,-E/4,0);
-    Static3D move2  = new Static3D(-0.5f,-0.5f,-0.5f);
-
-    VertexEffect[] effect = new VertexEffect[10];
-
-    effect[0] = new VertexEffectMove(move1);
-    effect[1] = new VertexEffectScale(new Static3D(1,1,-1));
-    effect[2] = new VertexEffectRotate(angle1,axisX,center1);
-    effect[3] = new VertexEffectRotate(angle2,axisY,center1);
-    effect[4] = new VertexEffectMove(move2);
-    effect[5] = new VertexEffectRotate(angle1,axisX,center2);
-    effect[6] = new VertexEffectRotate(angle3,axisY,center2);
-    effect[7] = new VertexEffectRotate(angle4,axis0,center2);
-    effect[8] = new VertexEffectRotate(angle5,axis1,center2);
-    effect[9] = new VertexEffectRotate(angle6,axis1,center2);
-
-    effect[0].setMeshAssociation( 7,-1);  // meshes 0,1,2
-    effect[1].setMeshAssociation( 6,-1);  // meshes 1,2
-    effect[2].setMeshAssociation( 2,-1);  // mesh 1
-    effect[3].setMeshAssociation( 4,-1);  // mesh 2
-    effect[4].setMeshAssociation(56,-1);  // meshes 3,4,5
-    effect[5].setMeshAssociation(56,-1);  // meshes 3,4,5
-    effect[6].setMeshAssociation(56,-1);  // meshes 3,4,5
-    effect[7].setMeshAssociation(56,-1);  // meshes 3,4,5
-    effect[8].setMeshAssociation(16,-1);  // mesh 4
-    effect[9].setMeshAssociation(32,-1);  // mesh 5
-
-    return effect;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  VertexEffect[] createVertexEffectsSkewbFace()
-    {
-    Static3D center = new Static3D(0,0,0);
-    Static3D axisX  = new Static3D(1,0,0);
-    Static3D axisZ  = new Static3D(0,0,1);
-    float angle = -(float)((180.0f/Math.PI)*Math.acos(SQ3/3));
-
-    VertexEffect[] effect = new VertexEffect[6];
-
-    effect[0] = new VertexEffectRotate( new Static1D(angle), axisX, center);
-    effect[1] = new VertexEffectRotate( new Static1D(  135), axisZ, center);
-    effect[2] = new VertexEffectRotate( new Static1D(   45), axisZ, center);
-    effect[3] = new VertexEffectRotate( new Static1D(  -45), axisZ, center);
-    effect[4] = new VertexEffectRotate( new Static1D( -135), axisZ, center);
-    effect[5] = new VertexEffectMove( new Static3D(0,0,-0.5f) );
-
-    effect[0].setMeshAssociation(30,-1);  // meshes 1,2,3,4
-    effect[1].setMeshAssociation( 2,-1);  // mesh 1
-    effect[2].setMeshAssociation( 5,-1);  // meshes 0,2
-    effect[3].setMeshAssociation( 8,-1);  // mesh 3
-    effect[4].setMeshAssociation(16,-1);  // mesh 4
-    effect[5].setMeshAssociation(30,-1);  // meshes 1,2,3,4
-
-    return effect;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  VertexEffect[] createVertexEffectsOcta()
-    {
-    Static1D alpha = new Static1D((float)(-(180/Math.PI)*Math.asin(SQ3/3)));
-    Static1D angle1= new Static1D( 90);
-    Static1D angle2= new Static1D(180);
-    Static1D angle3= new Static1D(270);
-    Static3D move1 = new Static3D(0,SQ2/2-SQ3/3,0);
-    Static3D axisX = new Static3D(1,0,0);
-    Static3D axisY = new Static3D(0,1,0);
-    Static3D cent0 = new Static3D(0,0,0);
-    Static3D cent1 = new Static3D(0,SQ2/2,0);
-    Static3D flipY = new Static3D( 1,-1, 1);
-
-    VertexEffect[] effect = new VertexEffect[6];
-
-    effect[0] = new VertexEffectMove(move1);
-    effect[1] = new VertexEffectRotate(alpha , axisX, cent1);
-    effect[2] = new VertexEffectRotate(angle1, axisY, cent0);
-    effect[3] = new VertexEffectRotate(angle2, axisY, cent0);
-    effect[4] = new VertexEffectRotate(angle3, axisY, cent0);
-    effect[5] = new VertexEffectScale(flipY);
-
-    effect[2].setMeshAssociation ( 34,-1); // apply to meshes 1 & 5
-    effect[3].setMeshAssociation ( 68,-1); // apply to meshes 2 & 6
-    effect[4].setMeshAssociation (136,-1); // apply to meshes 3 & 7
-    effect[5].setMeshAssociation (240,-1); // apply to meshes 4,5,6,7
-
-    return effect;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  VertexEffect[] createVertexEffectsTetra()
-    {
-    Static3D flipZ = new Static3D( 1, 1,-1);
-
-    Static1D alpha = new Static1D((float)(-(180/Math.PI)*Math.asin(SQ3/3)));
-    Static1D angle1= new Static1D( 90);
-    Static1D angle2= new Static1D(180);
-    Static3D move1 = new Static3D(0,SQ2/4-SQ3/6,0);
-
-    Static3D axisX = new Static3D(1,0,0);
-    Static3D axisY = new Static3D(0,1,0);
-    Static3D axisZ = new Static3D(0,0,1);
-
-    Static3D cent0 = new Static3D(0,0,0);
-    Static3D cent1 = new Static3D(0,SQ2/4,0);
-
-    VertexEffect[] effect = new VertexEffect[6];
-
-    effect[0] = new VertexEffectRotate(angle2, axisZ, cent0);
-    effect[1] = new VertexEffectMove(move1);
-    effect[2] = new VertexEffectRotate(alpha , axisX, cent1);
-    effect[3] = new VertexEffectScale(flipZ);
-    effect[4] = new VertexEffectRotate(angle1, axisY, cent0);
-    effect[5] = new VertexEffectRotate(angle2, axisZ, cent0);
-
-    effect[0].setMeshAssociation(15,-1); // meshes 0,1,2,3
-    effect[1].setMeshAssociation(15,-1); // meshes 0,1,2,3
-    effect[2].setMeshAssociation(15,-1); // meshes 0,1,2,3
-    effect[3].setMeshAssociation(10,-1); // meshes 1 & 3
-    effect[4].setMeshAssociation(12,-1); // meshes 2 & 3
-    effect[5].setMeshAssociation(12,-1); // meshes 2 & 3
-
-    return effect;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  VertexEffect[] createVertexEffectsDino()
-    {
-    float E = 0.5f*SQ2;
-    float F = 0.5f;
-    final float ANGLE = (float)((180/Math.PI)*(Math.atan(SQ2)));
-
-    Static1D angle1 = new Static1D(-ANGLE);
-    Static1D angle2 = new Static1D(+ANGLE);
-    Static3D axisX  = new Static3D(1,0,0);
-    Static3D axisY  = new Static3D(0,1,0);
-    Static3D axisZ  = new Static3D(0,-1,1);
-    Static3D center0= new Static3D(0,0,0);
-    Static3D center1= new Static3D(0,-3*F,0);
-
-    VertexEffect[] effect = new VertexEffect[10];
-
-    effect[0] = new VertexEffectScale ( new Static3D(3,3,3) );
-    effect[1] = new VertexEffectMove  ( new Static3D(0,-F,0) );
-    effect[2] = new VertexEffectRotate( new Static1D(90), axisX, center0 );
-    effect[3] = new VertexEffectScale ( new Static3D(1,-1,1) );
-    effect[4] = new VertexEffectMove  ( new Static3D(3*E/2,E*(SQ3/2)-3*F,0) );
-    effect[5] = new VertexEffectRotate( new Static1D(+90), axisY, center1 );
-    effect[6] = new VertexEffectScale ( new Static3D(-1,1,1) );
-    effect[7] = new VertexEffectRotate( new Static1D( 45), axisX, center1 );
-    effect[8] = new VertexEffectRotate( angle1           , axisZ, center1 );
-    effect[9] = new VertexEffectRotate( angle2           , axisZ, center1 );
-
-    effect[0].setMeshAssociation(15,-1);  // apply to meshes 0,1,2,3
-    effect[1].setMeshAssociation( 3,-1);  // apply to meshes 0,1
-    effect[2].setMeshAssociation( 2,-1);  // apply to mesh 1
-    effect[3].setMeshAssociation( 2,-1);  // apply to mesh 0
-    effect[4].setMeshAssociation(12,-1);  // apply to meshes 2,3
-    effect[5].setMeshAssociation(12,-1);  // apply to meshes 2,3
-    effect[6].setMeshAssociation( 8,-1);  // apply to mesh 3
-    effect[7].setMeshAssociation(12,-1);  // apply to meshes 2,3
-    effect[8].setMeshAssociation( 4,-1);  // apply to mesh 2
-    effect[9].setMeshAssociation( 8,-1);  // apply to mesh 3
-
-    return effect;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  VertexEffect[] createVertexEffectsHelicopterCorner()
-    {
-    float E = 0.5f;
-
-    Static3D axisX  = new Static3D(1,0,0);
-    Static3D axisY  = new Static3D(0,1,0);
-    Static3D axis0  = new Static3D(-SQ2/2,0,SQ2/2);
-    Static3D axis1  = new Static3D(+SQ3/3,+SQ3/3,+SQ3/3);
-    Static1D angle1 = new Static1D(+90);
-    Static1D angle2 = new Static1D(-90);
-    Static1D angle3 = new Static1D(-135);
-    Static1D angle4 = new Static1D(90);
-    Static1D angle5 = new Static1D(120);
-    Static1D angle6 = new Static1D(240);
-    Static3D center1= new Static3D(0,0,0);
-    Static3D center2= new Static3D(-0.25f,-0.25f,-0.25f);
-    Static3D move1  = new Static3D(-E/4,-E/4,0);
-    Static3D move2  = new Static3D(-0.25f,(-1.0f/6)-0.25f,-0.25f);
-
-    VertexEffect[] effect = new VertexEffect[10];
-
-    effect[0] = new VertexEffectMove(move1);
-    effect[1] = new VertexEffectScale(new Static3D(1,1,-1));
-    effect[2] = new VertexEffectRotate(angle1,axisX,center1);
-    effect[3] = new VertexEffectRotate(angle2,axisY,center1);
-    effect[4] = new VertexEffectMove(move2);
-    effect[5] = new VertexEffectRotate(angle1,axisX,center2);
-    effect[6] = new VertexEffectRotate(angle3,axisY,center2);
-    effect[7] = new VertexEffectRotate(angle4,axis0,center2);
-    effect[8] = new VertexEffectRotate(angle5,axis1,center2);
-    effect[9] = new VertexEffectRotate(angle6,axis1,center2);
-
-    effect[0].setMeshAssociation( 7,-1);  // meshes 0,1,2
-    effect[1].setMeshAssociation( 6,-1);  // meshes 1,2
-    effect[2].setMeshAssociation( 2,-1);  // mesh 1
-    effect[3].setMeshAssociation( 4,-1);  // mesh 2
-    effect[4].setMeshAssociation(56,-1);  // meshes 3,4,5
-    effect[5].setMeshAssociation(56,-1);  // meshes 3,4,5
-    effect[6].setMeshAssociation(56,-1);  // meshes 3,4,5
-    effect[7].setMeshAssociation(56,-1);  // meshes 3,4,5
-    effect[8].setMeshAssociation(16,-1);  // mesh 4
-    effect[9].setMeshAssociation(32,-1);  // mesh 5
-
-    return effect;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  VertexEffect[] createVertexEffectsHelicopterFace()
-    {
-    float E = 0.5f;
-    float F = SQ2/4;
-
-    Static3D move0  = new Static3D(-E/4, -E/4, 0);
-    Static3D move1  = new Static3D(-(SQ2/24)-E/2, -(SQ2/24)-E/2, 0);
-    Static3D move2  = new Static3D(-E/2, F/3, 0);
-    Static3D move3  = new Static3D(+E/2, F/3, 0);
-    Static3D move4  = new Static3D(+E/3,+E/3, 0);
-    Static1D angle1 = new Static1D(135);
-    Static1D angle2 = new Static1D(90);
-    Static1D angle3 = new Static1D(-90);
-    Static1D angle4 = new Static1D(-135);
-    Static3D axisX  = new Static3D(1,0,0);
-    Static3D axisY  = new Static3D(0,1,0);
-    Static3D axisZ  = new Static3D(0,0,1);
-    Static3D axis1  = new Static3D(1,-1,0);
-    Static3D center = new Static3D(0,0,0);
-    Static3D center1= new Static3D(-E/2,-E/2,0);
-
-    VertexEffect[] effect = new VertexEffect[10];
-
-    effect[0] = new VertexEffectMove(move0);
-    effect[1] = new VertexEffectRotate(angle1, axisZ, center);
-    effect[2] = new VertexEffectMove(move1);
-    effect[3] = new VertexEffectRotate(angle2, axis1, center1);
-    effect[4] = new VertexEffectMove(move2);
-    effect[5] = new VertexEffectMove(move3);
-    effect[6] = new VertexEffectRotate(angle3, axisZ, center);
-    effect[7] = new VertexEffectRotate(angle4, axisX, center);
-    effect[8] = new VertexEffectRotate(angle1, axisY, center);
-    effect[9] = new VertexEffectMove(move4);
-
-    effect[0].setMeshAssociation( 1,-1);  // mesh 0
-    effect[1].setMeshAssociation( 2,-1);  // mesh 1
-    effect[2].setMeshAssociation( 2,-1);  // mesh 1
-    effect[3].setMeshAssociation( 2,-1);  // mesh 1
-    effect[4].setMeshAssociation( 4,-1);  // mesh 2
-    effect[5].setMeshAssociation( 8,-1);  // mesh 3
-    effect[6].setMeshAssociation( 8,-1);  // mesh 3
-    effect[7].setMeshAssociation( 4,-1);  // mesh 2
-    effect[8].setMeshAssociation( 8,-1);  // mesh 3
-    effect[9].setMeshAssociation(15,-1);  // meshes 0,1,2,3
-
-    return effect;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  VertexEffect[] createVertexEffectsRediEdge()
-    {
-    Static3D move0 = new Static3D(0.0f, -0.5f, 0.0f);
-    Static3D move1 = new Static3D(0.25f, -0.25f, 0.0f);
-    Static3D move2 = new Static3D(0.5f, 0.0f, 0.0f);
-    Static3D move3 = new Static3D(0.0f, (SQ3-6)/8, (SQ3-6)/8);
-    Static3D flipZ = new Static3D(1,1,-1);
-    Static3D flipX = new Static3D(-1,1,1);
-    Static3D scale = new Static3D(2,2,2);
-    Static3D cent0 = new Static3D(0,0, 0);
-    Static3D cent1 = new Static3D(0,0, -1.5f);
-    Static3D axisX = new Static3D(1,0, 0);
-    Static3D axisY = new Static3D(0,1, 0);
-    Static3D axis  = new Static3D(0,SQ2/2,-SQ2/2);
-    Static1D angle1= new Static1D(90);
-    Static1D angle2= new Static1D(45);
-    Static1D angle3= new Static1D( (float)(180/Math.PI*Math.acos(SQ3/3)) );
-
-    VertexEffect[] effect = new VertexEffect[12];
-
-    effect[0] = new VertexEffectScale(scale);
-    effect[1] = new VertexEffectMove(move0);
-    effect[2] = new VertexEffectScale(flipZ);
-    effect[3] = new VertexEffectRotate(angle1,axisX,cent0);
-    effect[4] = new VertexEffectMove(move1);
-    effect[5] = new VertexEffectRotate(angle1,axisY,cent0);
-    effect[6] = new VertexEffectMove(move2);
-    effect[7] = new VertexEffectScale(flipX);
-    effect[8] = new VertexEffectRotate(angle2,axisX,cent0);
-    effect[9] = new VertexEffectMove(move3);
-    effect[10]= new VertexEffectRotate(angle3,axis ,cent1);
-    effect[11]= new VertexEffectScale(flipX);
-
-    effect[0].setMeshAssociation(63,-1);  // meshes 0,1,2,3,4,5
-    effect[1].setMeshAssociation( 3,-1);  // meshes 0,1
-    effect[2].setMeshAssociation( 2,-1);  // mesh 1
-    effect[3].setMeshAssociation( 2,-1);  // mesh 1
-    effect[4].setMeshAssociation(12,-1);  // meshes 2,3
-    effect[5].setMeshAssociation(60,-1);  // meshes 2,3,4,5
-    effect[6].setMeshAssociation(12,-1);  // meshes 2,3
-    effect[7].setMeshAssociation( 8,-1);  // mesh 3
-    effect[8].setMeshAssociation(48,-1);  // meshes 4,5
-    effect[9].setMeshAssociation(48,-1);  // meshes 4,5
-    effect[10].setMeshAssociation(48,-1); // meshes 4,5
-    effect[11].setMeshAssociation(32,-1); // mesh 5
-
-    return effect;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  VertexEffect[] createVertexEffectsRediCorner()
-    {
-    Static3D axisY   = new Static3D(0,1,0);
-    Static3D axisX   = new Static3D(1,0,0);
-    Static3D axisZ   = new Static3D(0,0,1);
-    Static3D center  = new Static3D(0,0,0);
-    Static1D angle90 = new Static1D(90);
-    Static1D angle270= new Static1D(270);
-    Static1D angle45 = new Static1D(-45);
-
-    VertexEffect[] effect = new VertexEffect[6];
-
-    effect[0] = new VertexEffectMove(new Static3D(0,0,+0.5f));
-    effect[1] = new VertexEffectRotate( angle270, axisX, center );
-    effect[2] = new VertexEffectRotate( angle90 , axisY, center );
-    effect[3] = new VertexEffectRotate( angle45 , axisX, center );
-    effect[4] = new VertexEffectRotate( angle90 , axisY, center );
-    effect[5] = new VertexEffectRotate( angle270, axisZ, center );
-
-    effect[0].setMeshAssociation( 7,-1);  // 0,1,2
-    effect[1].setMeshAssociation( 2,-1);  // 1
-    effect[2].setMeshAssociation( 4,-1);  // 2
-    effect[3].setMeshAssociation(56,-1);  // 3
-    effect[4].setMeshAssociation(16,-1);  // 4
-    effect[5].setMeshAssociation(32,-1);  // 5
-
-    return effect;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// OBJECTS
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// CUBE
-
-  MeshBase createCubeMesh(int index)
-    {
-    MeshBase mesh = createFacesCube(index);
-    VertexEffect[] effects = createVertexEffectsCube();
-    for( VertexEffect effect : effects ) mesh.apply(effect);
-
-    Static3D roundingCenter  = new Static3D(0,0,0);
-    Static3D[] vertices = new Static3D[8];
-    vertices[0] = new Static3D(+0.5f,+0.5f,+0.5f);
-    vertices[1] = new Static3D(+0.5f,+0.5f,-0.5f);
-    vertices[2] = new Static3D(+0.5f,-0.5f,+0.5f);
-    vertices[3] = new Static3D(+0.5f,-0.5f,-0.5f);
-    vertices[4] = new Static3D(-0.5f,+0.5f,+0.5f);
-    vertices[5] = new Static3D(-0.5f,+0.5f,-0.5f);
-    vertices[6] = new Static3D(-0.5f,-0.5f,+0.5f);
-    vertices[7] = new Static3D(-0.5f,-0.5f,-0.5f);
-
-    roundCorners(mesh,roundingCenter,vertices,0.06f,0.12f);
-
-    mesh.mergeEffComponents();
-
-    return mesh;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// SKEWB
-
-  MeshBase createSkewbCornerMesh()
-    {
-    MeshBase mesh = createFacesSkewbCorner();
-    VertexEffect[] effects = createVertexEffectsSkewbCorner();
-    for( VertexEffect effect : effects ) mesh.apply(effect);
-
-    float E = 0.5f;
-    Static3D roundingCenter = new Static3D(-E/2,-E/2,-E/2);
-
-    Static3D[] verticesType1 = new Static3D[1];
-    verticesType1[0] = new Static3D(0.0f,0.0f,0.0f);
-    roundCorners(mesh,roundingCenter,verticesType1,0.08f,0.15f);
-
-    Static3D[] verticesType2 = new Static3D[3];
-    verticesType2[0] = new Static3D(-E, 0, 0);
-    verticesType2[1] = new Static3D( 0,-E, 0);
-    verticesType2[2] = new Static3D( 0, 0,-E);
-    roundCorners(mesh,roundingCenter,verticesType2,0.08f,0.20f);
-
-    mesh.mergeEffComponents();
-
-    return mesh;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  MeshBase createSkewbFaceMesh()
-    {
-    MeshBase mesh = createFacesSkewbFace();
-    VertexEffect[] effects = createVertexEffectsSkewbFace();
-    for( VertexEffect effect : effects ) mesh.apply(effect);
-
-    Static3D roundingCenter = new Static3D(0,0,-0.2f);
-    float E = SQ2/4;
-    Static3D[] vertices = new Static3D[4];
-    vertices[0] = new Static3D(-E*SQ2,      0, 0);
-    vertices[1] = new Static3D(+E*SQ2,      0, 0);
-    vertices[2] = new Static3D(     0, -E*SQ2, 0);
-    vertices[3] = new Static3D(     0, +E*SQ2, 0);
-    roundCorners(mesh,roundingCenter,vertices,0.10f,0.10f);
-
-    mesh.mergeEffComponents();
-    mesh.addEmptyTexComponent();
-
-    return mesh;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// SKEWB DIAMOND / PYRAMINX
-
-  MeshBase createOctaMesh()
-    {
-    MeshBase mesh = createFacesOcta();
-    VertexEffect[] effects = createVertexEffectsOcta();
-    for( VertexEffect effect : effects ) mesh.apply(effect);
-
-    Static3D roundingCenter = new Static3D(0,0,0);
-    Static3D[] vertices = new Static3D[6];
-    vertices[0] = new Static3D(    0, SQ2/2,    0 );
-    vertices[1] = new Static3D( 0.5f,     0, 0.5f );
-    vertices[2] = new Static3D(-0.5f,     0, 0.5f );
-    vertices[3] = new Static3D(    0,-SQ2/2,    0 );
-    vertices[4] = new Static3D(-0.5f,     0,-0.5f );
-    vertices[5] = new Static3D( 0.5f,     0,-0.5f );
-
-    roundCorners(mesh,roundingCenter,vertices,0.06f,0.20f);
-
-    mesh.mergeEffComponents();
-
-    return mesh;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  MeshBase createTetraMesh()
-    {
-    MeshBase mesh = createFacesTetra();
-    VertexEffect[] effects = createVertexEffectsTetra();
-    for( VertexEffect effect : effects ) mesh.apply(effect);
-
-    Static3D roundingCenter = new Static3D(0,0,0);
-    Static3D[] verticesRound = new Static3D[4];
-    verticesRound[0] = new Static3D(-0.5f,+SQ2/4,   0 );
-    verticesRound[1] = new Static3D(+0.5f,+SQ2/4,   0 );
-    verticesRound[2] = new Static3D(    0,-SQ2/4,+0.5f);
-    verticesRound[3] = new Static3D(    0,-SQ2/4,-0.5f);
-    roundCorners(mesh,roundingCenter,verticesRound,0.08f,0.15f);
-
-    mesh.mergeEffComponents();
-    mesh.addEmptyTexComponent();
-    mesh.addEmptyTexComponent();
-    mesh.addEmptyTexComponent();
-    mesh.addEmptyTexComponent();
-
-    return mesh;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// DINO
-
-  MeshBase createDinoMesh()
-    {
-    MeshBase mesh = createFacesDino();
-    VertexEffect[] effects = createVertexEffectsDino();
-    for( VertexEffect effect : effects ) mesh.apply(effect);
-
-    float F = 0.5f;
-    Static3D roundingCenter = new Static3D(0.0f, -1.5f*F, -1.5f*F);
-    Static3D[] verticesRound = new Static3D[4];
-    verticesRound[0] = new Static3D(     0,-3*F,    0 );
-    verticesRound[1] = new Static3D(     0,   0, -3*F );
-    verticesRound[2] = new Static3D(  -3*F,   0,    0 );
-    verticesRound[3] = new Static3D(  +3*F,   0,    0 );
-    roundCorners(mesh,roundingCenter,verticesRound,0.10f,0.40f);
-
-    mesh.mergeEffComponents();
-
-    return mesh;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Helicopter
-
-  MeshBase createHelicopterCornerMesh()
-    {
-    MeshBase mesh = createFacesHelicopterCorner();
-    VertexEffect[] effects = createVertexEffectsHelicopterCorner();
-    for( VertexEffect effect : effects ) mesh.apply(effect);
-
-    float E = 0.5f;
-    Static3D roundingCenter = new Static3D(-E/2,-E/2,-E/2);
-
-    Static3D[] verticesType1 = new Static3D[1];
-    verticesType1[0] = new Static3D(0.0f,0.0f,0.0f);
-    roundCorners(mesh,roundingCenter,verticesType1,0.08f,0.15f);
-
-    Static3D[] verticesType2 = new Static3D[3];
-    verticesType2[0] = new Static3D(-E, 0, 0);
-    verticesType2[1] = new Static3D( 0,-E, 0);
-    verticesType2[2] = new Static3D( 0, 0,-E);
-    roundCorners(mesh,roundingCenter,verticesType2,0.08f,0.20f);
-
-    mesh.mergeEffComponents();
-
-    return mesh;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  MeshBase createHelicopterFaceMesh()
-    {
-    MeshBase mesh = createFacesHelicopterFace();
-    VertexEffect[] effects = createVertexEffectsHelicopterFace();
-    for( VertexEffect effect : effects ) mesh.apply(effect);
-
-    float E = 0.5f;
-    Static3D roundingCenter = new Static3D(-E/2 + E/3,-E/2 + E/3,-E/2);
-
-    Static3D[] verticesType1 = new Static3D[1];
-    verticesType1[0] = new Static3D(E/3,E/3,0.0f);
-    roundCorners(mesh,roundingCenter,verticesType1,0.06f,0.15f);
-
-    Static3D[] verticesType2 = new Static3D[2];
-    verticesType2[0] = new Static3D(-E+E/3, E/3  , 0);
-    verticesType2[1] = new Static3D( E/3  ,-E+E/3, 0);
-    roundCorners(mesh,roundingCenter,verticesType2,0.08f,0.20f);
-
-    mesh.mergeEffComponents();
-    mesh.addEmptyTexComponent();
-    mesh.addEmptyTexComponent();
-
-    return mesh;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Redi cube
-
-  MeshBase createRediEdgeMesh()
-    {
-    MeshBase mesh = createFacesRediEdge();
-    VertexEffect[] effects = createVertexEffectsRediEdge();
-    for( VertexEffect effect : effects ) mesh.apply(effect);
-
-    Static3D center = new Static3D(0.0f,-0.75f,-0.75f);
-    Static3D[] vertices = new Static3D[2];
-    vertices[0] = new Static3D( 0.5f, 0.0f, 0.0f);
-    vertices[1] = new Static3D(-0.5f, 0.0f, 0.0f);
-    roundCorners(mesh,center,vertices,0.06f,0.20f);
-
-    mesh.mergeEffComponents();
-
-    return mesh;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  MeshBase createRediCornerMesh()
-    {
-    MeshBase mesh = createFacesRediCorner();
-    VertexEffect[] effects = createVertexEffectsRediCorner();
-    for( VertexEffect effect : effects ) mesh.apply(effect);
-
-    Static3D center = new Static3D(0,0,0);
-    Static3D[] vertices = new Static3D[8];
-    vertices[0] = new Static3D(+0.5f,+0.5f,+0.5f);
-    vertices[1] = new Static3D(+0.5f,+0.5f,-0.5f);
-    vertices[2] = new Static3D(+0.5f,-0.5f,+0.5f);
-    vertices[3] = new Static3D(+0.5f,-0.5f,-0.5f);
-    vertices[4] = new Static3D(-0.5f,+0.5f,+0.5f);
-    vertices[5] = new Static3D(-0.5f,+0.5f,-0.5f);
-    vertices[6] = new Static3D(-0.5f,-0.5f,+0.5f);
-    vertices[7] = new Static3D(-0.5f,-0.5f,-0.5f);
-
-    roundCorners(mesh,center,vertices,0.06f,0.12f);
-
-    mesh.mergeEffComponents();
-
-    return mesh;
-    }
-  }
diff --git a/src/main/java/org/distorted/objects/FactoryCubit.java b/src/main/java/org/distorted/objects/FactoryCubit.java
new file mode 100644
index 00000000..6036b3a4
--- /dev/null
+++ b/src/main/java/org/distorted/objects/FactoryCubit.java
@@ -0,0 +1,1148 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Copyright 2020 Leszek Koltunski                                                               //
+//                                                                                               //
+// This file is part of Magic Cube.                                                              //
+//                                                                                               //
+// Magic Cube is free software: you can redistribute it and/or modify                            //
+// it under the terms of the GNU General Public License as published by                          //
+// the Free Software Foundation, either version 2 of the License, or                             //
+// (at your option) any later version.                                                           //
+//                                                                                               //
+// Magic Cube is distributed in the hope that it will be useful,                                 //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
+// GNU General Public License for more details.                                                  //
+//                                                                                               //
+// You should have received a copy of the GNU General Public License                             //
+// along with Magic Cube.  If not, see <http://www.gnu.org/licenses/>.                           //
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+package org.distorted.objects;
+
+import org.distorted.library.effect.VertexEffect;
+import org.distorted.library.effect.VertexEffectDeform;
+import org.distorted.library.effect.VertexEffectMove;
+import org.distorted.library.effect.VertexEffectRotate;
+import org.distorted.library.effect.VertexEffectScale;
+import org.distorted.library.mesh.MeshBase;
+import org.distorted.library.mesh.MeshJoined;
+import org.distorted.library.mesh.MeshPolygon;
+import org.distorted.library.type.Static1D;
+import org.distorted.library.type.Static3D;
+import org.distorted.library.type.Static4D;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+class FactoryCubit
+  {
+  private static final float SQ2 = (float)Math.sqrt(2);
+  private static final float SQ3 = (float)Math.sqrt(3);
+  private static final float SQ6 = (float)Math.sqrt(6);
+
+  private static final Static1D RADIUS = new Static1D(1);
+
+  private static FactoryCubit mThis;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private FactoryCubit()
+    {
+
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public static FactoryCubit getInstance()
+    {
+    if( mThis==null ) mThis = new FactoryCubit();
+
+    return mThis;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// H - height of the band in the middle
+// alpha - angle of the edge  [0,90]
+// dist - often in a polygon the distance from edge to center is not 1, but something else.
+// This is the distance.
+// K - where to begin the second, much more flat part of the band. [0,1]
+// N - number of bands. N>=3
+//
+// theory: two distinct parts to the band:
+// 1) (0,B) - steep
+// 2) (B,1) - flat
+//
+// In first part, we have y = g(x) ; in second - y = g(f(x)) where
+//
+// g(x) = sqrt( R^2 - (x-D)^2 ) - R*cos(alpha)
+// f(x) = ((D-B)/(1-B)*x + B*(1-D)/(1-B)
+// h(x) = R*(sin(alpha) - sin(x))
+// R = H/(1-cos(alpha))
+// D = H*sin(alpha)
+// B = h(K*alpha)
+//
+// The N points are taken at:
+//
+// 1) in the second part, there are K2 = (N-3)/3 such points
+// 2) in the first - K1 = (N-3) - K2
+// 3) also, the 3 points 0,B,1
+//
+// so we have the sequence A[i] of N points
+//
+// 0
+// h((i+1)*(1-K)*alpha/(K1+1)) (i=0,1,...,K1-1)
+// B
+// (1-B)*(i+1)/(K2+1) + B   (i=0,i,...,K2-1)
+// 1
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private float f(float D, float B, float x)
+    {
+    return ((D-B)*x + B*(1-D))/(1-B);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private float g(float R, float D, float x, float cosAlpha)
+    {
+    float d = x-D;
+    return (float)(Math.sqrt(R*R-d*d)-R*cosAlpha);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private float h(float R, float sinAlpha, float x)
+    {
+    return R*(sinAlpha-(float)Math.sin(x));
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private float[] computeBands(float H, int alpha, float dist, float K, int N)
+    {
+    float[] bands = new float[2*N];
+
+    bands[0] = 1.0f;
+    bands[1] = 0.0f;
+
+    float beta = (float)Math.atan(dist*Math.tan(Math.PI*alpha/180));
+    float sinBeta = (float)Math.sin(beta);
+    float cosBeta = (float)Math.cos(beta);
+    float R = cosBeta<1.0f ? H/(1.0f-cosBeta) : 0.0f;
+    float D = R*sinBeta;
+    float B = h(R,sinBeta,K*beta);
+
+    if( D>1.0f )
+      {
+      for(int i=1; i<N; i++)
+        {
+        bands[2*i  ] = (float)(N-1-i)/(N-1);
+        bands[2*i+1] = H*(1-bands[2*i]);
+        }
+      }
+    else
+      {
+      int K2 = (int)((N-3)*K);
+      int K1 = (N-3)-K2;
+
+      for(int i=0; i<=K1; i++)
+        {
+        float angle = K*beta + (1-K)*beta*(K1-i)/(K1+1);
+        float x = h(R,sinBeta,angle);
+        bands[2*i+2] = 1.0f - x;
+        bands[2*i+3] = g(R,D,x,cosBeta);
+        }
+
+      for(int i=0; i<=K2; i++)
+        {
+        float x = (1-B)*(i+1)/(K2+1) + B;
+        bands[2*K1+2 + 2*i+2] = 1.0f - x;
+        bands[2*K1+2 + 2*i+3] = g(R,D,f(D,B,x),cosBeta);
+        }
+      }
+
+    bands[2*N-2] = 0.0f;
+    bands[2*N-1] =    H;
+
+    return bands;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private void roundCorners(MeshBase mesh, Static3D center, Static3D[] vertices, float strength, float regionRadius)
+    {
+    Static4D reg= new Static4D(0,0,0,regionRadius);
+
+    float centX = center.get0();
+    float centY = center.get1();
+    float centZ = center.get2();
+
+    for (Static3D vertex : vertices)
+      {
+      float x = strength*(centX - vertex.get0());
+      float y = strength*(centY - vertex.get1());
+      float z = strength*(centZ - vertex.get2());
+
+      VertexEffect effect = new VertexEffectDeform(new Static3D(x,y,z), RADIUS, vertex, reg);
+      mesh.apply(effect);
+      }
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  MeshBase createFacesCube(int sizeIndex)
+    {
+    MeshBase[] meshes = new MeshPolygon[6];
+
+    float E = 0.5f;
+    int extraI, extraV, num;
+
+    switch(sizeIndex)
+      {
+      case 0 : num = 6; extraI = 2; extraV = 2; break;
+      case 1 : num = 5; extraI = 2; extraV = 2; break;
+      case 2 : num = 5; extraI = 1; extraV = 2; break;
+      default: num = 4; extraI = 1; extraV = 1; break;
+      }
+
+    float[] vertices = { -E,-E, +E,-E, +E,+E, -E,+E };
+    float[] bands = computeBands(0.048f,35,E,0.7f,num);
+
+    meshes[0] = new MeshPolygon(vertices,bands,extraI,extraV);
+    meshes[0].setEffectAssociation(0,1,0);
+    meshes[1] = meshes[0].copy(true);
+    meshes[1].setEffectAssociation(0,2,0);
+    meshes[2] = meshes[0].copy(true);
+    meshes[2].setEffectAssociation(0,4,0);
+    meshes[3] = meshes[0].copy(true);
+    meshes[3].setEffectAssociation(0,8,0);
+    meshes[4] = meshes[0].copy(true);
+    meshes[4].setEffectAssociation(0,16,0);
+    meshes[5] = meshes[0].copy(true);
+    meshes[5].setEffectAssociation(0,32,0);
+
+    return new MeshJoined(meshes);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  MeshBase createFacesSkewbCorner()
+    {
+    MeshBase[] meshes = new MeshBase[6];
+
+    float E = 0.5f;
+    float F = SQ2/2;
+    float[] vertices0 = { -E+E/4,E/4, E/4,-E+E/4, E/4,E/4};
+    float[] bands0 = computeBands(0.028f,35,E/3,0.7f,7);
+
+    meshes[0] = new MeshPolygon(vertices0, bands0, 3, 3);
+    meshes[0].setEffectAssociation(0,1,0);
+    meshes[1] = meshes[0].copy(true);
+    meshes[1].setEffectAssociation(0,2,0);
+    meshes[2] = meshes[0].copy(true);
+    meshes[2].setEffectAssociation(0,4,0);
+
+    float[] vertices1 = { 0,0, F,0, 7*F/8,(SQ3/8)*F, 5*F/8,(3*SQ3/8)*F, F/2,(SQ3/2)*F };
+    float[] bands1 = computeBands(0,0,1,0,3);
+
+    meshes[3] = new MeshPolygon(vertices1,bands1,1,5);
+    meshes[3].setEffectAssociation(0,8,0);
+    meshes[4] = meshes[3].copy(true);
+    meshes[4].setEffectAssociation(0,16,0);
+    meshes[5] = meshes[3].copy(true);
+    meshes[5].setEffectAssociation(0,32,0);
+
+    return new MeshJoined(meshes);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  MeshBase createFacesSkewbFace()
+    {
+    MeshBase[] meshes = new MeshBase[5];
+
+    float E = SQ2/4;
+    float[] vertices0 = { -E,-E, +E,-E, +E,+E, -E,+E };
+    float[] bands0 = computeBands(0.051f,35,E/2,0.9f,7);
+
+    meshes[0] = new MeshPolygon(vertices0, bands0, 3, 3);
+    meshes[0].setEffectAssociation(0,1,0);
+
+    float[] vertices1 = { -E,-SQ3*E, -E*0.7f,-SQ3*E, +E*0.7f,-SQ3*E, +E,-SQ3*E, 0,0 };
+    float[] bands1 = computeBands(0,0,1,0,3);
+
+    meshes[1] = new MeshPolygon(vertices1,bands1,0,0);
+    meshes[1].setEffectAssociation(0,2,0);
+    meshes[2] = meshes[1].copy(true);
+    meshes[2].setEffectAssociation(0,4,0);
+    meshes[3] = meshes[1].copy(true);
+    meshes[3].setEffectAssociation(0,8,0);
+    meshes[4] = meshes[1].copy(true);
+    meshes[4].setEffectAssociation(0,16,0);
+
+    return new MeshJoined(meshes);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  MeshBase createFacesOcta()
+    {
+    MeshBase[] meshes = new MeshPolygon[8];
+
+    float E = SQ3/2;
+    float F = 0.5f;
+    float[] vertices = { -F,-E/3, +F,-E/3, 0.0f,2*E/3};
+    float[] bands = computeBands(0.05f,35,F,0.8f,6);
+
+    meshes[0] = new MeshPolygon(vertices, bands, 2,2);
+    meshes[0].setEffectAssociation(0,1,0);
+    meshes[1] = meshes[0].copy(true);
+    meshes[1].setEffectAssociation(0,2,0);
+    meshes[2] = meshes[0].copy(true);
+    meshes[2].setEffectAssociation(0,4,0);
+    meshes[3] = meshes[0].copy(true);
+    meshes[3].setEffectAssociation(0,8,0);
+    meshes[4] = meshes[0].copy(true);
+    meshes[4].setEffectAssociation(0,16,0);
+    meshes[5] = meshes[0].copy(true);
+    meshes[5].setEffectAssociation(0,32,0);
+    meshes[6] = meshes[0].copy(true);
+    meshes[6].setEffectAssociation(0,64,0);
+    meshes[7] = meshes[0].copy(true);
+    meshes[7].setEffectAssociation(0,128,0);
+
+    return new MeshJoined(meshes);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  MeshBase createFacesTetra()
+    {
+    MeshBase[] meshes = new MeshBase[4];
+
+    float E = SQ3/2;
+    float F = 0.5f;
+    float[] vertices = { -F,-E/3, +F,-E/3, 0.0f,2*E/3};
+    float[] bands = computeBands(0.05f,35,F,0.8f,6);
+
+    meshes[0] = new MeshPolygon(vertices, bands, 2,2);
+    meshes[0].setEffectAssociation(0,1,0);
+    meshes[1] = meshes[0].copy(true);
+    meshes[1].setEffectAssociation(0,2,0);
+    meshes[2] = meshes[0].copy(true);
+    meshes[2].setEffectAssociation(0,4,0);
+    meshes[3] = meshes[0].copy(true);
+    meshes[3].setEffectAssociation(0,8,0);
+
+    return new MeshJoined(meshes);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  MeshBase createFacesDino()
+    {
+    MeshBase[] meshes = new MeshPolygon[4];
+
+    float E = 0.5f*SQ2;
+    float F = 0.5f;
+    float[] vertices0 = { -F,F/3, 0,-2*F/3, +F,F/3 };
+    float[] bands0 = computeBands(0.028f,30,F/3,0.8f,7);
+
+    meshes[0] = new MeshPolygon(vertices0, bands0, 2, 5);
+    meshes[0].setEffectAssociation(0,1,0);
+    meshes[1] = meshes[0].copy(true);
+    meshes[1].setEffectAssociation(0,2,0);
+
+    float[] vertices1 = { -E/2,-E*(SQ3/6), E/2,-E*(SQ3/6), 0,E*(SQ3/3) };
+    float[] bands1 = computeBands(0.02f,45,F/3,0.2f,3);
+
+    meshes[2] = new MeshPolygon(vertices1, bands1, 1, 2);
+    meshes[2].setEffectAssociation(0,4,0);
+    meshes[3] = meshes[2].copy(true);
+    meshes[3].setEffectAssociation(0,8,0);
+
+    return new MeshJoined(meshes);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  MeshBase createFacesHelicopterCorner()
+    {
+    MeshBase[] meshes = new MeshBase[6];
+
+    float E = 0.5f;
+    float F = SQ2/4;
+    float G = 1.0f/12;
+    float[] vertices0 = { -E+E/4,E/4, E/4,-E+E/4, E/4,E/4};
+    float[] bands0 = computeBands(0.028f,35,E/4,0.7f,7);
+
+    meshes[0] = new MeshPolygon(vertices0, bands0, 3, 3);
+    meshes[0].setEffectAssociation(0,1,0);
+    meshes[1] = meshes[0].copy(true);
+    meshes[1].setEffectAssociation(0,2,0);
+    meshes[2] = meshes[0].copy(true);
+    meshes[2].setEffectAssociation(0,4,0);
+
+    float[] vertices1 = { -F,-G, 0,-G, +F,-G, 0,2*G };
+    float[] bands1 = computeBands(0.00f,0,0,0.0f,3);
+    meshes[3] = new MeshPolygon(vertices1,bands1,1,5);
+    meshes[3].setEffectAssociation(0,8,0);
+    meshes[4] = meshes[3].copy(true);
+    meshes[4].setEffectAssociation(0,16,0);
+    meshes[5] = meshes[3].copy(true);
+    meshes[5].setEffectAssociation(0,32,0);
+
+    return new MeshJoined(meshes);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  MeshBase createFacesHelicopterFace()
+    {
+    MeshBase[] meshes = new MeshBase[4];
+
+    float E = 0.5f;
+    float F = SQ2/4;
+    float G = 1.0f/12;
+    float[] vertices0 = { -E+E/4,E/4, E/4,-E+E/4, E/4,E/4};
+    float[] bands0 = computeBands(0.028f,35,E/4,0.7f,7);
+
+    meshes[0] = new MeshPolygon(vertices0, bands0, 3, 3);
+    meshes[0].setEffectAssociation(0,1,0);
+
+    float[] vertices1 = { -F,-G, +F,-G, 0,2*G};
+    float[] bands1 = computeBands(0.01f,45,F,0.0f,3);
+
+    meshes[1] = new MeshPolygon(vertices1, bands1, 1, 3);
+    meshes[1].setEffectAssociation(0,2,0);
+
+    float[] vertices2 = { -E/2,-F/3, +E/2,-F/3, 0,2*F/3};
+
+    meshes[2] = new MeshPolygon(vertices2, bands1, 1, 3);
+    meshes[2].setEffectAssociation(0,4,0);
+    meshes[3] = meshes[2].copy(true);
+    meshes[3].setEffectAssociation(0,8,0);
+
+    return new MeshJoined(meshes);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  MeshBase createFacesRediEdge()
+    {
+    MeshBase[] meshes = new MeshPolygon[6];
+
+    float F = 0.25f;
+    float[] vertices0 = { -F,+F, -F,-F, 0, -2*F, +F,-F, +F,+F };
+    float[] bands0 = computeBands(0.038f,35,F,0.7f,7);
+
+    meshes[0] = new MeshPolygon(vertices0, bands0, 2, 2);
+    meshes[0].setEffectAssociation(0,1,0);
+    meshes[1] = meshes[0].copy(true);
+    meshes[1].setEffectAssociation(0,2,0);
+
+    float[] bands1 = computeBands(0.02f,35,F/2,0.2f,3);
+    float[] vertices1 = { -F/2, +F/2, -F/2, -1.5f*F, 1.5f*F, +F/2 };
+
+    meshes[2] = new MeshPolygon(vertices1, bands1, 1, 2);
+    meshes[2].setEffectAssociation(0,4,0);
+    meshes[3] = meshes[2].copy(true);
+    meshes[3].setEffectAssociation(0,8,0);
+
+    float X = 0.25f*SQ2;
+    float Y = SQ6/16;
+    float[] vertices2 = { -X, Y, -1.5f*X, -Y, +1.5f*X, -Y, +X, Y };
+
+    meshes[4] = new MeshPolygon(vertices2, bands1, 1, 1);
+    meshes[4].setEffectAssociation(0,16,0);
+    meshes[5] = meshes[4].copy(true);
+    meshes[5].setEffectAssociation(0,32,0);
+
+    return new MeshJoined(meshes);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  MeshBase createFacesRediCorner()
+    {
+    MeshBase[] meshes = new MeshBase[6];
+
+    float E = 0.5f;
+    float[] vertices0 = { -E,-E, +E,-E, +E,+E, -E,+E };
+    float[] bands0 = computeBands(0.06f,35,E,0.7f,6);
+
+    meshes[0] = new MeshPolygon(vertices0,bands0,2,2);
+    meshes[0].setEffectAssociation(0,1,0);
+    meshes[1] = meshes[0].copy(true);
+    meshes[1].setEffectAssociation(0,2,0);
+    meshes[2] = meshes[0].copy(true);
+    meshes[2].setEffectAssociation(0,4,0);
+
+    float F = SQ2/2;
+    float X = 0.5f;
+    float G = 0.72f;
+    float[] vertices1 = { -E,+F, -E+X,0, -E,-F, -E*G,-F, +E*G,-F, +E,-F, +E-X,0, +E,+F, +E*G,+F, -E*G,+F };
+    float[] bands1 = computeBands(0.0f,0,1.0f,0.0f,2);
+
+    meshes[3] = new MeshPolygon(vertices1,bands1,0,0);
+    meshes[3].setEffectAssociation(0,8,0);
+    meshes[4] = meshes[3].copy(true);
+    meshes[4].setEffectAssociation(0,16,0);
+    meshes[5] = meshes[3].copy(true);
+    meshes[5].setEffectAssociation(0,32,0);
+
+    return new MeshJoined(meshes);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// EFFECTS
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  VertexEffect[] createVertexEffectsCube()
+    {
+    Static3D axisY   = new Static3D(0,1,0);
+    Static3D axisX   = new Static3D(1,0,0);
+    Static3D center  = new Static3D(0,0,0);
+    Static1D angle90 = new Static1D(90);
+    Static1D angle180= new Static1D(180);
+    Static1D angle270= new Static1D(270);
+
+    VertexEffect[] effect = new VertexEffect[6];
+
+    effect[0] = new VertexEffectMove(new Static3D(0,0,+0.5f));
+    effect[1] = new VertexEffectRotate( angle180, axisX, center );
+    effect[2] = new VertexEffectRotate( angle90 , axisX, center );
+    effect[3] = new VertexEffectRotate( angle270, axisX, center );
+    effect[4] = new VertexEffectRotate( angle270, axisY, center );
+    effect[5] = new VertexEffectRotate( angle90 , axisY, center );
+
+    effect[0].setMeshAssociation(63,-1);  // all 6 sides
+    effect[1].setMeshAssociation(32,-1);  // back
+    effect[2].setMeshAssociation( 8,-1);  // bottom
+    effect[3].setMeshAssociation( 4,-1);  // top
+    effect[4].setMeshAssociation( 2,-1);  // left
+    effect[5].setMeshAssociation( 1,-1);  // right
+
+    return effect;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  VertexEffect[] createVertexEffectsSkewbCorner()
+    {
+    float E = 0.5f;
+
+    Static3D axisX  = new Static3D(1,0,0);
+    Static3D axisY  = new Static3D(0,1,0);
+    Static3D axis0  = new Static3D(-SQ2/2,0,SQ2/2);
+    Static3D axis1  = new Static3D(+SQ3/3,+SQ3/3,+SQ3/3);
+    Static1D angle1 = new Static1D(+90);
+    Static1D angle2 = new Static1D(-90);
+    Static1D angle3 = new Static1D(-15);
+    Static1D angle4 = new Static1D((float)((180.0f/Math.PI)*Math.acos(SQ3/3)));
+    Static1D angle5 = new Static1D(120);
+    Static1D angle6 = new Static1D(240);
+    Static3D center1= new Static3D(0,0,0);
+    Static3D center2= new Static3D(-0.5f,-0.5f,-0.5f);
+    Static3D move1  = new Static3D(-E/4,-E/4,0);
+    Static3D move2  = new Static3D(-0.5f,-0.5f,-0.5f);
+
+    VertexEffect[] effect = new VertexEffect[10];
+
+    effect[0] = new VertexEffectMove(move1);
+    effect[1] = new VertexEffectScale(new Static3D(1,1,-1));
+    effect[2] = new VertexEffectRotate(angle1,axisX,center1);
+    effect[3] = new VertexEffectRotate(angle2,axisY,center1);
+    effect[4] = new VertexEffectMove(move2);
+    effect[5] = new VertexEffectRotate(angle1,axisX,center2);
+    effect[6] = new VertexEffectRotate(angle3,axisY,center2);
+    effect[7] = new VertexEffectRotate(angle4,axis0,center2);
+    effect[8] = new VertexEffectRotate(angle5,axis1,center2);
+    effect[9] = new VertexEffectRotate(angle6,axis1,center2);
+
+    effect[0].setMeshAssociation( 7,-1);  // meshes 0,1,2
+    effect[1].setMeshAssociation( 6,-1);  // meshes 1,2
+    effect[2].setMeshAssociation( 2,-1);  // mesh 1
+    effect[3].setMeshAssociation( 4,-1);  // mesh 2
+    effect[4].setMeshAssociation(56,-1);  // meshes 3,4,5
+    effect[5].setMeshAssociation(56,-1);  // meshes 3,4,5
+    effect[6].setMeshAssociation(56,-1);  // meshes 3,4,5
+    effect[7].setMeshAssociation(56,-1);  // meshes 3,4,5
+    effect[8].setMeshAssociation(16,-1);  // mesh 4
+    effect[9].setMeshAssociation(32,-1);  // mesh 5
+
+    return effect;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  VertexEffect[] createVertexEffectsSkewbFace()
+    {
+    Static3D center = new Static3D(0,0,0);
+    Static3D axisX  = new Static3D(1,0,0);
+    Static3D axisZ  = new Static3D(0,0,1);
+    float angle = -(float)((180.0f/Math.PI)*Math.acos(SQ3/3));
+
+    VertexEffect[] effect = new VertexEffect[6];
+
+    effect[0] = new VertexEffectRotate( new Static1D(angle), axisX, center);
+    effect[1] = new VertexEffectRotate( new Static1D(  135), axisZ, center);
+    effect[2] = new VertexEffectRotate( new Static1D(   45), axisZ, center);
+    effect[3] = new VertexEffectRotate( new Static1D(  -45), axisZ, center);
+    effect[4] = new VertexEffectRotate( new Static1D( -135), axisZ, center);
+    effect[5] = new VertexEffectMove( new Static3D(0,0,-0.5f) );
+
+    effect[0].setMeshAssociation(30,-1);  // meshes 1,2,3,4
+    effect[1].setMeshAssociation( 2,-1);  // mesh 1
+    effect[2].setMeshAssociation( 5,-1);  // meshes 0,2
+    effect[3].setMeshAssociation( 8,-1);  // mesh 3
+    effect[4].setMeshAssociation(16,-1);  // mesh 4
+    effect[5].setMeshAssociation(30,-1);  // meshes 1,2,3,4
+
+    return effect;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  VertexEffect[] createVertexEffectsOcta()
+    {
+    Static1D alpha = new Static1D((float)(-(180/Math.PI)*Math.asin(SQ3/3)));
+    Static1D angle1= new Static1D( 90);
+    Static1D angle2= new Static1D(180);
+    Static1D angle3= new Static1D(270);
+    Static3D move1 = new Static3D(0,SQ2/2-SQ3/3,0);
+    Static3D axisX = new Static3D(1,0,0);
+    Static3D axisY = new Static3D(0,1,0);
+    Static3D cent0 = new Static3D(0,0,0);
+    Static3D cent1 = new Static3D(0,SQ2/2,0);
+    Static3D flipY = new Static3D( 1,-1, 1);
+
+    VertexEffect[] effect = new VertexEffect[6];
+
+    effect[0] = new VertexEffectMove(move1);
+    effect[1] = new VertexEffectRotate(alpha , axisX, cent1);
+    effect[2] = new VertexEffectRotate(angle1, axisY, cent0);
+    effect[3] = new VertexEffectRotate(angle2, axisY, cent0);
+    effect[4] = new VertexEffectRotate(angle3, axisY, cent0);
+    effect[5] = new VertexEffectScale(flipY);
+
+    effect[2].setMeshAssociation ( 34,-1); // apply to meshes 1 & 5
+    effect[3].setMeshAssociation ( 68,-1); // apply to meshes 2 & 6
+    effect[4].setMeshAssociation (136,-1); // apply to meshes 3 & 7
+    effect[5].setMeshAssociation (240,-1); // apply to meshes 4,5,6,7
+
+    return effect;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  VertexEffect[] createVertexEffectsTetra()
+    {
+    Static3D flipZ = new Static3D( 1, 1,-1);
+
+    Static1D alpha = new Static1D((float)(-(180/Math.PI)*Math.asin(SQ3/3)));
+    Static1D angle1= new Static1D( 90);
+    Static1D angle2= new Static1D(180);
+    Static3D move1 = new Static3D(0,SQ2/4-SQ3/6,0);
+
+    Static3D axisX = new Static3D(1,0,0);
+    Static3D axisY = new Static3D(0,1,0);
+    Static3D axisZ = new Static3D(0,0,1);
+
+    Static3D cent0 = new Static3D(0,0,0);
+    Static3D cent1 = new Static3D(0,SQ2/4,0);
+
+    VertexEffect[] effect = new VertexEffect[6];
+
+    effect[0] = new VertexEffectRotate(angle2, axisZ, cent0);
+    effect[1] = new VertexEffectMove(move1);
+    effect[2] = new VertexEffectRotate(alpha , axisX, cent1);
+    effect[3] = new VertexEffectScale(flipZ);
+    effect[4] = new VertexEffectRotate(angle1, axisY, cent0);
+    effect[5] = new VertexEffectRotate(angle2, axisZ, cent0);
+
+    effect[0].setMeshAssociation(15,-1); // meshes 0,1,2,3
+    effect[1].setMeshAssociation(15,-1); // meshes 0,1,2,3
+    effect[2].setMeshAssociation(15,-1); // meshes 0,1,2,3
+    effect[3].setMeshAssociation(10,-1); // meshes 1 & 3
+    effect[4].setMeshAssociation(12,-1); // meshes 2 & 3
+    effect[5].setMeshAssociation(12,-1); // meshes 2 & 3
+
+    return effect;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  VertexEffect[] createVertexEffectsDino()
+    {
+    float E = 0.5f*SQ2;
+    float F = 0.5f;
+    final float ANGLE = (float)((180/Math.PI)*(Math.atan(SQ2)));
+
+    Static1D angle1 = new Static1D(-ANGLE);
+    Static1D angle2 = new Static1D(+ANGLE);
+    Static3D axisX  = new Static3D(1,0,0);
+    Static3D axisY  = new Static3D(0,1,0);
+    Static3D axisZ  = new Static3D(0,-1,1);
+    Static3D center0= new Static3D(0,0,0);
+    Static3D center1= new Static3D(0,-3*F,0);
+
+    VertexEffect[] effect = new VertexEffect[10];
+
+    effect[0] = new VertexEffectScale ( new Static3D(3,3,3) );
+    effect[1] = new VertexEffectMove  ( new Static3D(0,-F,0) );
+    effect[2] = new VertexEffectRotate( new Static1D(90), axisX, center0 );
+    effect[3] = new VertexEffectScale ( new Static3D(1,-1,1) );
+    effect[4] = new VertexEffectMove  ( new Static3D(3*E/2,E*(SQ3/2)-3*F,0) );
+    effect[5] = new VertexEffectRotate( new Static1D(+90), axisY, center1 );
+    effect[6] = new VertexEffectScale ( new Static3D(-1,1,1) );
+    effect[7] = new VertexEffectRotate( new Static1D( 45), axisX, center1 );
+    effect[8] = new VertexEffectRotate( angle1           , axisZ, center1 );
+    effect[9] = new VertexEffectRotate( angle2           , axisZ, center1 );
+
+    effect[0].setMeshAssociation(15,-1);  // apply to meshes 0,1,2,3
+    effect[1].setMeshAssociation( 3,-1);  // apply to meshes 0,1
+    effect[2].setMeshAssociation( 2,-1);  // apply to mesh 1
+    effect[3].setMeshAssociation( 2,-1);  // apply to mesh 0
+    effect[4].setMeshAssociation(12,-1);  // apply to meshes 2,3
+    effect[5].setMeshAssociation(12,-1);  // apply to meshes 2,3
+    effect[6].setMeshAssociation( 8,-1);  // apply to mesh 3
+    effect[7].setMeshAssociation(12,-1);  // apply to meshes 2,3
+    effect[8].setMeshAssociation( 4,-1);  // apply to mesh 2
+    effect[9].setMeshAssociation( 8,-1);  // apply to mesh 3
+
+    return effect;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  VertexEffect[] createVertexEffectsHelicopterCorner()
+    {
+    float E = 0.5f;
+
+    Static3D axisX  = new Static3D(1,0,0);
+    Static3D axisY  = new Static3D(0,1,0);
+    Static3D axis0  = new Static3D(-SQ2/2,0,SQ2/2);
+    Static3D axis1  = new Static3D(+SQ3/3,+SQ3/3,+SQ3/3);
+    Static1D angle1 = new Static1D(+90);
+    Static1D angle2 = new Static1D(-90);
+    Static1D angle3 = new Static1D(-135);
+    Static1D angle4 = new Static1D(90);
+    Static1D angle5 = new Static1D(120);
+    Static1D angle6 = new Static1D(240);
+    Static3D center1= new Static3D(0,0,0);
+    Static3D center2= new Static3D(-0.25f,-0.25f,-0.25f);
+    Static3D move1  = new Static3D(-E/4,-E/4,0);
+    Static3D move2  = new Static3D(-0.25f,(-1.0f/6)-0.25f,-0.25f);
+
+    VertexEffect[] effect = new VertexEffect[10];
+
+    effect[0] = new VertexEffectMove(move1);
+    effect[1] = new VertexEffectScale(new Static3D(1,1,-1));
+    effect[2] = new VertexEffectRotate(angle1,axisX,center1);
+    effect[3] = new VertexEffectRotate(angle2,axisY,center1);
+    effect[4] = new VertexEffectMove(move2);
+    effect[5] = new VertexEffectRotate(angle1,axisX,center2);
+    effect[6] = new VertexEffectRotate(angle3,axisY,center2);
+    effect[7] = new VertexEffectRotate(angle4,axis0,center2);
+    effect[8] = new VertexEffectRotate(angle5,axis1,center2);
+    effect[9] = new VertexEffectRotate(angle6,axis1,center2);
+
+    effect[0].setMeshAssociation( 7,-1);  // meshes 0,1,2
+    effect[1].setMeshAssociation( 6,-1);  // meshes 1,2
+    effect[2].setMeshAssociation( 2,-1);  // mesh 1
+    effect[3].setMeshAssociation( 4,-1);  // mesh 2
+    effect[4].setMeshAssociation(56,-1);  // meshes 3,4,5
+    effect[5].setMeshAssociation(56,-1);  // meshes 3,4,5
+    effect[6].setMeshAssociation(56,-1);  // meshes 3,4,5
+    effect[7].setMeshAssociation(56,-1);  // meshes 3,4,5
+    effect[8].setMeshAssociation(16,-1);  // mesh 4
+    effect[9].setMeshAssociation(32,-1);  // mesh 5
+
+    return effect;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  VertexEffect[] createVertexEffectsHelicopterFace()
+    {
+    float E = 0.5f;
+    float F = SQ2/4;
+
+    Static3D move0  = new Static3D(-E/4, -E/4, 0);
+    Static3D move1  = new Static3D(-(SQ2/24)-E/2, -(SQ2/24)-E/2, 0);
+    Static3D move2  = new Static3D(-E/2, F/3, 0);
+    Static3D move3  = new Static3D(+E/2, F/3, 0);
+    Static3D move4  = new Static3D(+E/3,+E/3, 0);
+    Static1D angle1 = new Static1D(135);
+    Static1D angle2 = new Static1D(90);
+    Static1D angle3 = new Static1D(-90);
+    Static1D angle4 = new Static1D(-135);
+    Static3D axisX  = new Static3D(1,0,0);
+    Static3D axisY  = new Static3D(0,1,0);
+    Static3D axisZ  = new Static3D(0,0,1);
+    Static3D axis1  = new Static3D(1,-1,0);
+    Static3D center = new Static3D(0,0,0);
+    Static3D center1= new Static3D(-E/2,-E/2,0);
+
+    VertexEffect[] effect = new VertexEffect[10];
+
+    effect[0] = new VertexEffectMove(move0);
+    effect[1] = new VertexEffectRotate(angle1, axisZ, center);
+    effect[2] = new VertexEffectMove(move1);
+    effect[3] = new VertexEffectRotate(angle2, axis1, center1);
+    effect[4] = new VertexEffectMove(move2);
+    effect[5] = new VertexEffectMove(move3);
+    effect[6] = new VertexEffectRotate(angle3, axisZ, center);
+    effect[7] = new VertexEffectRotate(angle4, axisX, center);
+    effect[8] = new VertexEffectRotate(angle1, axisY, center);
+    effect[9] = new VertexEffectMove(move4);
+
+    effect[0].setMeshAssociation( 1,-1);  // mesh 0
+    effect[1].setMeshAssociation( 2,-1);  // mesh 1
+    effect[2].setMeshAssociation( 2,-1);  // mesh 1
+    effect[3].setMeshAssociation( 2,-1);  // mesh 1
+    effect[4].setMeshAssociation( 4,-1);  // mesh 2
+    effect[5].setMeshAssociation( 8,-1);  // mesh 3
+    effect[6].setMeshAssociation( 8,-1);  // mesh 3
+    effect[7].setMeshAssociation( 4,-1);  // mesh 2
+    effect[8].setMeshAssociation( 8,-1);  // mesh 3
+    effect[9].setMeshAssociation(15,-1);  // meshes 0,1,2,3
+
+    return effect;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  VertexEffect[] createVertexEffectsRediEdge()
+    {
+    Static3D move0 = new Static3D(0.0f, -0.5f, 0.0f);
+    Static3D move1 = new Static3D(0.25f, -0.25f, 0.0f);
+    Static3D move2 = new Static3D(0.5f, 0.0f, 0.0f);
+    Static3D move3 = new Static3D(0.0f, (SQ3-6)/8, (SQ3-6)/8);
+    Static3D flipZ = new Static3D(1,1,-1);
+    Static3D flipX = new Static3D(-1,1,1);
+    Static3D scale = new Static3D(2,2,2);
+    Static3D cent0 = new Static3D(0,0, 0);
+    Static3D cent1 = new Static3D(0,0, -1.5f);
+    Static3D axisX = new Static3D(1,0, 0);
+    Static3D axisY = new Static3D(0,1, 0);
+    Static3D axis  = new Static3D(0,SQ2/2,-SQ2/2);
+    Static1D angle1= new Static1D(90);
+    Static1D angle2= new Static1D(45);
+    Static1D angle3= new Static1D( (float)(180/Math.PI*Math.acos(SQ3/3)) );
+
+    VertexEffect[] effect = new VertexEffect[12];
+
+    effect[0] = new VertexEffectScale(scale);
+    effect[1] = new VertexEffectMove(move0);
+    effect[2] = new VertexEffectScale(flipZ);
+    effect[3] = new VertexEffectRotate(angle1,axisX,cent0);
+    effect[4] = new VertexEffectMove(move1);
+    effect[5] = new VertexEffectRotate(angle1,axisY,cent0);
+    effect[6] = new VertexEffectMove(move2);
+    effect[7] = new VertexEffectScale(flipX);
+    effect[8] = new VertexEffectRotate(angle2,axisX,cent0);
+    effect[9] = new VertexEffectMove(move3);
+    effect[10]= new VertexEffectRotate(angle3,axis ,cent1);
+    effect[11]= new VertexEffectScale(flipX);
+
+    effect[0].setMeshAssociation(63,-1);  // meshes 0,1,2,3,4,5
+    effect[1].setMeshAssociation( 3,-1);  // meshes 0,1
+    effect[2].setMeshAssociation( 2,-1);  // mesh 1
+    effect[3].setMeshAssociation( 2,-1);  // mesh 1
+    effect[4].setMeshAssociation(12,-1);  // meshes 2,3
+    effect[5].setMeshAssociation(60,-1);  // meshes 2,3,4,5
+    effect[6].setMeshAssociation(12,-1);  // meshes 2,3
+    effect[7].setMeshAssociation( 8,-1);  // mesh 3
+    effect[8].setMeshAssociation(48,-1);  // meshes 4,5
+    effect[9].setMeshAssociation(48,-1);  // meshes 4,5
+    effect[10].setMeshAssociation(48,-1); // meshes 4,5
+    effect[11].setMeshAssociation(32,-1); // mesh 5
+
+    return effect;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  VertexEffect[] createVertexEffectsRediCorner()
+    {
+    Static3D axisY   = new Static3D(0,1,0);
+    Static3D axisX   = new Static3D(1,0,0);
+    Static3D axisZ   = new Static3D(0,0,1);
+    Static3D center  = new Static3D(0,0,0);
+    Static1D angle90 = new Static1D(90);
+    Static1D angle270= new Static1D(270);
+    Static1D angle45 = new Static1D(-45);
+
+    VertexEffect[] effect = new VertexEffect[6];
+
+    effect[0] = new VertexEffectMove(new Static3D(0,0,+0.5f));
+    effect[1] = new VertexEffectRotate( angle270, axisX, center );
+    effect[2] = new VertexEffectRotate( angle90 , axisY, center );
+    effect[3] = new VertexEffectRotate( angle45 , axisX, center );
+    effect[4] = new VertexEffectRotate( angle90 , axisY, center );
+    effect[5] = new VertexEffectRotate( angle270, axisZ, center );
+
+    effect[0].setMeshAssociation( 7,-1);  // 0,1,2
+    effect[1].setMeshAssociation( 2,-1);  // 1
+    effect[2].setMeshAssociation( 4,-1);  // 2
+    effect[3].setMeshAssociation(56,-1);  // 3
+    effect[4].setMeshAssociation(16,-1);  // 4
+    effect[5].setMeshAssociation(32,-1);  // 5
+
+    return effect;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// OBJECTS
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// CUBE
+
+  MeshBase createCubeMesh(int index)
+    {
+    MeshBase mesh = createFacesCube(index);
+    VertexEffect[] effects = createVertexEffectsCube();
+    for( VertexEffect effect : effects ) mesh.apply(effect);
+
+    Static3D roundingCenter  = new Static3D(0,0,0);
+    Static3D[] vertices = new Static3D[8];
+    vertices[0] = new Static3D(+0.5f,+0.5f,+0.5f);
+    vertices[1] = new Static3D(+0.5f,+0.5f,-0.5f);
+    vertices[2] = new Static3D(+0.5f,-0.5f,+0.5f);
+    vertices[3] = new Static3D(+0.5f,-0.5f,-0.5f);
+    vertices[4] = new Static3D(-0.5f,+0.5f,+0.5f);
+    vertices[5] = new Static3D(-0.5f,+0.5f,-0.5f);
+    vertices[6] = new Static3D(-0.5f,-0.5f,+0.5f);
+    vertices[7] = new Static3D(-0.5f,-0.5f,-0.5f);
+
+    roundCorners(mesh,roundingCenter,vertices,0.06f,0.12f);
+
+    mesh.mergeEffComponents();
+
+    return mesh;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// SKEWB
+
+  MeshBase createSkewbCornerMesh()
+    {
+    MeshBase mesh = createFacesSkewbCorner();
+    VertexEffect[] effects = createVertexEffectsSkewbCorner();
+    for( VertexEffect effect : effects ) mesh.apply(effect);
+
+    float E = 0.5f;
+    Static3D roundingCenter = new Static3D(-E/2,-E/2,-E/2);
+
+    Static3D[] verticesType1 = new Static3D[1];
+    verticesType1[0] = new Static3D(0.0f,0.0f,0.0f);
+    roundCorners(mesh,roundingCenter,verticesType1,0.08f,0.15f);
+
+    Static3D[] verticesType2 = new Static3D[3];
+    verticesType2[0] = new Static3D(-E, 0, 0);
+    verticesType2[1] = new Static3D( 0,-E, 0);
+    verticesType2[2] = new Static3D( 0, 0,-E);
+    roundCorners(mesh,roundingCenter,verticesType2,0.08f,0.20f);
+
+    mesh.mergeEffComponents();
+
+    return mesh;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  MeshBase createSkewbFaceMesh()
+    {
+    MeshBase mesh = createFacesSkewbFace();
+    VertexEffect[] effects = createVertexEffectsSkewbFace();
+    for( VertexEffect effect : effects ) mesh.apply(effect);
+
+    Static3D roundingCenter = new Static3D(0,0,-0.2f);
+    float E = SQ2/4;
+    Static3D[] vertices = new Static3D[4];
+    vertices[0] = new Static3D(-E*SQ2,      0, 0);
+    vertices[1] = new Static3D(+E*SQ2,      0, 0);
+    vertices[2] = new Static3D(     0, -E*SQ2, 0);
+    vertices[3] = new Static3D(     0, +E*SQ2, 0);
+    roundCorners(mesh,roundingCenter,vertices,0.10f,0.10f);
+
+    mesh.mergeEffComponents();
+    mesh.addEmptyTexComponent();
+
+    return mesh;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// SKEWB DIAMOND / PYRAMINX
+
+  MeshBase createOctaMesh()
+    {
+    MeshBase mesh = createFacesOcta();
+    VertexEffect[] effects = createVertexEffectsOcta();
+    for( VertexEffect effect : effects ) mesh.apply(effect);
+
+    Static3D roundingCenter = new Static3D(0,0,0);
+    Static3D[] vertices = new Static3D[6];
+    vertices[0] = new Static3D(    0, SQ2/2,    0 );
+    vertices[1] = new Static3D( 0.5f,     0, 0.5f );
+    vertices[2] = new Static3D(-0.5f,     0, 0.5f );
+    vertices[3] = new Static3D(    0,-SQ2/2,    0 );
+    vertices[4] = new Static3D(-0.5f,     0,-0.5f );
+    vertices[5] = new Static3D( 0.5f,     0,-0.5f );
+
+    roundCorners(mesh,roundingCenter,vertices,0.06f,0.20f);
+
+    mesh.mergeEffComponents();
+
+    return mesh;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  MeshBase createTetraMesh()
+    {
+    MeshBase mesh = createFacesTetra();
+    VertexEffect[] effects = createVertexEffectsTetra();
+    for( VertexEffect effect : effects ) mesh.apply(effect);
+
+    Static3D roundingCenter = new Static3D(0,0,0);
+    Static3D[] verticesRound = new Static3D[4];
+    verticesRound[0] = new Static3D(-0.5f,+SQ2/4,   0 );
+    verticesRound[1] = new Static3D(+0.5f,+SQ2/4,   0 );
+    verticesRound[2] = new Static3D(    0,-SQ2/4,+0.5f);
+    verticesRound[3] = new Static3D(    0,-SQ2/4,-0.5f);
+    roundCorners(mesh,roundingCenter,verticesRound,0.08f,0.15f);
+
+    mesh.mergeEffComponents();
+    mesh.addEmptyTexComponent();
+    mesh.addEmptyTexComponent();
+    mesh.addEmptyTexComponent();
+    mesh.addEmptyTexComponent();
+
+    return mesh;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// DINO
+
+  MeshBase createDinoMesh()
+    {
+    MeshBase mesh = createFacesDino();
+    VertexEffect[] effects = createVertexEffectsDino();
+    for( VertexEffect effect : effects ) mesh.apply(effect);
+
+    float F = 0.5f;
+    Static3D roundingCenter = new Static3D(0.0f, -1.5f*F, -1.5f*F);
+    Static3D[] verticesRound = new Static3D[4];
+    verticesRound[0] = new Static3D(     0,-3*F,    0 );
+    verticesRound[1] = new Static3D(     0,   0, -3*F );
+    verticesRound[2] = new Static3D(  -3*F,   0,    0 );
+    verticesRound[3] = new Static3D(  +3*F,   0,    0 );
+    roundCorners(mesh,roundingCenter,verticesRound,0.10f,0.40f);
+
+    mesh.mergeEffComponents();
+
+    return mesh;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Helicopter
+
+  MeshBase createHelicopterCornerMesh()
+    {
+    MeshBase mesh = createFacesHelicopterCorner();
+    VertexEffect[] effects = createVertexEffectsHelicopterCorner();
+    for( VertexEffect effect : effects ) mesh.apply(effect);
+
+    float E = 0.5f;
+    Static3D roundingCenter = new Static3D(-E/2,-E/2,-E/2);
+
+    Static3D[] verticesType1 = new Static3D[1];
+    verticesType1[0] = new Static3D(0.0f,0.0f,0.0f);
+    roundCorners(mesh,roundingCenter,verticesType1,0.08f,0.15f);
+
+    Static3D[] verticesType2 = new Static3D[3];
+    verticesType2[0] = new Static3D(-E, 0, 0);
+    verticesType2[1] = new Static3D( 0,-E, 0);
+    verticesType2[2] = new Static3D( 0, 0,-E);
+    roundCorners(mesh,roundingCenter,verticesType2,0.08f,0.20f);
+
+    mesh.mergeEffComponents();
+
+    return mesh;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  MeshBase createHelicopterFaceMesh()
+    {
+    MeshBase mesh = createFacesHelicopterFace();
+    VertexEffect[] effects = createVertexEffectsHelicopterFace();
+    for( VertexEffect effect : effects ) mesh.apply(effect);
+
+    float E = 0.5f;
+    Static3D roundingCenter = new Static3D(-E/2 + E/3,-E/2 + E/3,-E/2);
+
+    Static3D[] verticesType1 = new Static3D[1];
+    verticesType1[0] = new Static3D(E/3,E/3,0.0f);
+    roundCorners(mesh,roundingCenter,verticesType1,0.06f,0.15f);
+
+    Static3D[] verticesType2 = new Static3D[2];
+    verticesType2[0] = new Static3D(-E+E/3, E/3  , 0);
+    verticesType2[1] = new Static3D( E/3  ,-E+E/3, 0);
+    roundCorners(mesh,roundingCenter,verticesType2,0.08f,0.20f);
+
+    mesh.mergeEffComponents();
+    mesh.addEmptyTexComponent();
+    mesh.addEmptyTexComponent();
+
+    return mesh;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Redi cube
+
+  MeshBase createRediEdgeMesh()
+    {
+    MeshBase mesh = createFacesRediEdge();
+    VertexEffect[] effects = createVertexEffectsRediEdge();
+    for( VertexEffect effect : effects ) mesh.apply(effect);
+
+    Static3D center = new Static3D(0.0f,-0.75f,-0.75f);
+    Static3D[] vertices = new Static3D[2];
+    vertices[0] = new Static3D( 0.5f, 0.0f, 0.0f);
+    vertices[1] = new Static3D(-0.5f, 0.0f, 0.0f);
+    roundCorners(mesh,center,vertices,0.06f,0.20f);
+
+    mesh.mergeEffComponents();
+
+    return mesh;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  MeshBase createRediCornerMesh()
+    {
+    MeshBase mesh = createFacesRediCorner();
+    VertexEffect[] effects = createVertexEffectsRediCorner();
+    for( VertexEffect effect : effects ) mesh.apply(effect);
+
+    Static3D center = new Static3D(0,0,0);
+    Static3D[] vertices = new Static3D[8];
+    vertices[0] = new Static3D(+0.5f,+0.5f,+0.5f);
+    vertices[1] = new Static3D(+0.5f,+0.5f,-0.5f);
+    vertices[2] = new Static3D(+0.5f,-0.5f,+0.5f);
+    vertices[3] = new Static3D(+0.5f,-0.5f,-0.5f);
+    vertices[4] = new Static3D(-0.5f,+0.5f,+0.5f);
+    vertices[5] = new Static3D(-0.5f,+0.5f,-0.5f);
+    vertices[6] = new Static3D(-0.5f,-0.5f,+0.5f);
+    vertices[7] = new Static3D(-0.5f,-0.5f,-0.5f);
+
+    roundCorners(mesh,center,vertices,0.06f,0.12f);
+
+    mesh.mergeEffComponents();
+
+    return mesh;
+    }
+  }
diff --git a/src/main/java/org/distorted/objects/FactorySticker.java b/src/main/java/org/distorted/objects/FactorySticker.java
new file mode 100644
index 00000000..a385f70e
--- /dev/null
+++ b/src/main/java/org/distorted/objects/FactorySticker.java
@@ -0,0 +1,160 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Copyright 2020 Leszek Koltunski                                                               //
+//                                                                                               //
+// This file is part of Magic Cube.                                                              //
+//                                                                                               //
+// Magic Cube is free software: you can redistribute it and/or modify                            //
+// it under the terms of the GNU General Public License as published by                          //
+// the Free Software Foundation, either version 2 of the License, or                             //
+// (at your option) any later version.                                                           //
+//                                                                                               //
+// Magic Cube is distributed in the hope that it will be useful,                                 //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
+// GNU General Public License for more details.                                                  //
+//                                                                                               //
+// You should have received a copy of the GNU General Public License                             //
+// along with Magic Cube.  If not, see <http://www.gnu.org/licenses/>.                           //
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+package org.distorted.objects;
+
+import android.graphics.Canvas;
+import android.graphics.Paint;
+
+import static org.distorted.objects.TwistyObject.TEXTURE_HEIGHT;
+import static org.distorted.objects.TwistyObject.COLOR_BLACK;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+class FactorySticker
+  {
+  private static FactorySticker mThis;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private FactorySticker()
+    {
+
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public static FactorySticker getInstance()
+    {
+    if( mThis==null ) mThis = new FactorySticker();
+
+    return mThis;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private float computeAngle(float dx, float dy)
+    {
+    float PI = (float)Math.PI;
+    double angle = Math.atan2(dy,dx);
+    float ret = (float)(3*PI/2-angle);
+
+    if( ret>2*PI ) ret-= 2*PI;
+
+    return ret;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private void drawCurrVertex(Canvas canvas, Paint paint, float left, float r, float stroke, float pX, float pY, float cX, float cY, float nX, float nY)
+    {
+    pX = (0.5f+pX)*TEXTURE_HEIGHT;
+    pY = (0.5f-pY)*TEXTURE_HEIGHT;
+    cX = (0.5f+cX)*TEXTURE_HEIGHT;
+    cY = (0.5f-cY)*TEXTURE_HEIGHT;
+    nX = (0.5f+nX)*TEXTURE_HEIGHT;
+    nY = (0.5f-nY)*TEXTURE_HEIGHT;
+
+    canvas.drawLine(left+pX,pY,left+cX,cY,paint);
+
+    float aX = pX-cX;
+    float aY = pY-cY;
+    float bX = cX-nX;
+    float bY = cY-nY;
+
+    float aLen = (float)Math.sqrt(aX*aX+aY*aY);
+    float bLen = (float)Math.sqrt(bX*bX+bY*bY);
+
+    aX /= aLen;
+    aY /= aLen;
+    bX /= bLen;
+    bY /= bLen;
+
+    float sX = (aX-bX)/2;
+    float sY = (aY-bY)/2;
+    float sLen = (float)Math.sqrt(sX*sX+sY*sY);
+    sX /= sLen;
+    sY /= sLen;
+
+    float startAngle = computeAngle(bX,-bY);
+    float endAngle   = computeAngle(aX,-aY);
+    float sweepAngle = endAngle-startAngle;
+    if( sweepAngle<0 ) sweepAngle += 2*Math.PI;
+
+    float R = r*TEXTURE_HEIGHT+stroke/2;
+
+    float A = (float)(R/(Math.cos(sweepAngle/2)));
+
+    float rX = cX + A*sX;
+    float rY = cY + A*sY;
+
+    startAngle *= 180/(Math.PI);
+    sweepAngle *= 180/(Math.PI);
+
+    canvas.drawArc( left+rX-R, rY-R, left+rX+R, rY+R, startAngle, sweepAngle, false, paint);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  void drawRoundedPolygon(Canvas canvas, Paint paint, int left, float[] vertices, float stroke, int color, float r)
+    {
+    stroke *= TEXTURE_HEIGHT;
+
+    paint.setAntiAlias(true);
+    paint.setStrokeWidth(stroke);
+    paint.setColor(color);
+    paint.setStyle(Paint.Style.FILL);
+
+    canvas.drawRect(left,0,left+TEXTURE_HEIGHT,TEXTURE_HEIGHT,paint);
+
+    paint.setColor(COLOR_BLACK);
+    paint.setStyle(Paint.Style.STROKE);
+
+    int length = vertices.length;
+    int numVertices = length/2;
+
+    float prevX = vertices[length-2];
+    float prevY = vertices[length-1];
+    float currX = vertices[0];
+    float currY = vertices[1];
+    float nextX = vertices[2];
+    float nextY = vertices[3];
+
+    for(int vert=0; vert<numVertices; vert++)
+      {
+      drawCurrVertex(canvas, paint, left, r, stroke, prevX,prevY,currX,currY,nextX,nextY);
+
+      prevX = currX;
+      prevY = currY;
+      currX = nextX;
+      currY = nextY;
+
+      if( 2*(vert+2)+1 < length )
+        {
+        nextX = vertices[2*(vert+2)  ];
+        nextY = vertices[2*(vert+2)+1];
+        }
+      else
+        {
+        nextX = vertices[0];
+        nextY = vertices[1];
+        }
+      }
+    }
+  }
diff --git a/src/main/java/org/distorted/objects/TwistyCube.java b/src/main/java/org/distorted/objects/TwistyCube.java
index 60386b41..2a53ae96 100644
--- a/src/main/java/org/distorted/objects/TwistyCube.java
+++ b/src/main/java/org/distorted/objects/TwistyCube.java
@@ -115,7 +115,7 @@ class TwistyCube extends TwistyObject
 
     if( mMeshes[index]==null )
       {
-      mMeshes[index] = CubitFactory.getInstance().createCubeMesh(index);
+      mMeshes[index] = FactoryCubit.getInstance().createCubeMesh(index);
       }
 
     return mMeshes[index].copy(true);
@@ -130,7 +130,8 @@ class TwistyCube extends TwistyObject
     float S = 0.08f;
     float[] vertices = { -F,-F, +F,-F, +F,+F, -F,+F};
 
-    drawRoundedPolygon(canvas, paint, left, vertices, S, FACE_COLORS[face], R);
+    FactorySticker factory = FactorySticker.getInstance();
+    factory.drawRoundedPolygon(canvas, paint, left, vertices, S, FACE_COLORS[face], R);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/objects/TwistyDiamond.java b/src/main/java/org/distorted/objects/TwistyDiamond.java
index 6ca98877..8f6e632d 100644
--- a/src/main/java/org/distorted/objects/TwistyDiamond.java
+++ b/src/main/java/org/distorted/objects/TwistyDiamond.java
@@ -220,12 +220,12 @@ public class TwistyDiamond extends TwistyObject
 
     if( cubit<6 )
       {
-      if( mOctaMesh==null ) mOctaMesh = CubitFactory.getInstance().createOctaMesh();
+      if( mOctaMesh==null ) mOctaMesh = FactoryCubit.getInstance().createOctaMesh();
       mesh = mOctaMesh.copy(true);
       }
     else
       {
-      if( mTetraMesh==null ) mTetraMesh = CubitFactory.getInstance().createTetraMesh();
+      if( mTetraMesh==null ) mTetraMesh = FactoryCubit.getInstance().createTetraMesh();
       mesh = mTetraMesh.copy(true);
       }
 
@@ -252,7 +252,8 @@ public class TwistyDiamond extends TwistyObject
     float S = 0.07f;
     float[] vertices = { -F,-E/3, +F,-E/3, 0.0f,2*E/3};
 
-    drawRoundedPolygon(canvas, paint, left, vertices, S, FACE_COLORS[face], R);
+    FactorySticker factory = FactorySticker.getInstance();
+    factory.drawRoundedPolygon(canvas, paint, left, vertices, S, FACE_COLORS[face], R);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/objects/TwistyDino.java b/src/main/java/org/distorted/objects/TwistyDino.java
index 73990bbb..11302b77 100644
--- a/src/main/java/org/distorted/objects/TwistyDino.java
+++ b/src/main/java/org/distorted/objects/TwistyDino.java
@@ -198,7 +198,7 @@ public abstract class TwistyDino extends TwistyObject
 
   MeshBase createCubitMesh(int cubit)
     {
-    if( mMesh==null ) mMesh = CubitFactory.getInstance().createDinoMesh();
+    if( mMesh==null ) mMesh = FactoryCubit.getInstance().createDinoMesh();
 
     MeshBase mesh = mMesh.copy(true);
     MatrixEffectQuaternion quat = new MatrixEffectQuaternion( QUATS[cubit], new Static3D(0,0,0) );
@@ -216,7 +216,8 @@ public abstract class TwistyDino extends TwistyObject
     float S = 0.05f;
     float[] vertices = { -F,F/3, 0,-2*F/3, +F,F/3 };
 
-    drawRoundedPolygon(canvas, paint, left, vertices, S, FACE_COLORS[face], R);
+    FactorySticker factory = FactorySticker.getInstance();
+    factory.drawRoundedPolygon(canvas, paint, left, vertices, S, FACE_COLORS[face], R);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/objects/TwistyHelicopter.java b/src/main/java/org/distorted/objects/TwistyHelicopter.java
index ec99b775..5ca721a5 100644
--- a/src/main/java/org/distorted/objects/TwistyHelicopter.java
+++ b/src/main/java/org/distorted/objects/TwistyHelicopter.java
@@ -263,12 +263,12 @@ public class TwistyHelicopter extends TwistyObject
 
     if( cubit<8 )
       {
-      if( mCornerMesh==null ) mCornerMesh = CubitFactory.getInstance().createHelicopterCornerMesh();
+      if( mCornerMesh==null ) mCornerMesh = FactoryCubit.getInstance().createHelicopterCornerMesh();
       mesh = mCornerMesh.copy(true);
       }
     else
       {
-      if( mFaceMesh==null ) mFaceMesh = CubitFactory.getInstance().createHelicopterFaceMesh();
+      if( mFaceMesh==null ) mFaceMesh = FactoryCubit.getInstance().createHelicopterFaceMesh();
       mesh = mFaceMesh.copy(true);
       }
 
@@ -295,7 +295,8 @@ public class TwistyHelicopter extends TwistyObject
     float E = 0.5f;
     float[] vertices = { -E+E/4,E/4, E/4,-E+E/4, E/4,E/4};
 
-    drawRoundedPolygon(canvas, paint, left, vertices, S, FACE_COLORS[face], R);
+    FactorySticker factory = FactorySticker.getInstance();
+    factory.drawRoundedPolygon(canvas, paint, left, vertices, S, FACE_COLORS[face], R);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/objects/TwistyObject.java b/src/main/java/org/distorted/objects/TwistyObject.java
index fa5d4703..95204eac 100644
--- a/src/main/java/org/distorted/objects/TwistyObject.java
+++ b/src/main/java/org/distorted/objects/TwistyObject.java
@@ -65,6 +65,8 @@ public abstract class TwistyObject extends DistortedNode
   static final int COLOR_VIOLET = 0xff7700bb;
   static final int COLOR_BLACK  = 0xff000000;
 
+  static final int TEXTURE_HEIGHT = 256;
+
   static final float SQ2 = (float)Math.sqrt(2);
   static final float SQ3 = (float)Math.sqrt(3);
   static final float SQ6 = (float)Math.sqrt(6);
@@ -77,7 +79,6 @@ public abstract class TwistyObject extends DistortedNode
 
   private static final Static3D CENTER = new Static3D(0,0,0);
   private static final int POST_ROTATION_MILLISEC = 500;
-  static final int TEXTURE_HEIGHT = 256;
 
   final Static3D[] ROTATION_AXIS;
   final Static4D[] QUATS;
@@ -328,117 +329,6 @@ public abstract class TwistyObject extends DistortedNode
       }
     }
 
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private float computeAngle(float dx, float dy)
-    {
-    float PI = (float)Math.PI;
-    double angle = Math.atan2(dy,dx);
-    float ret = (float)(3*PI/2-angle);
-
-    if( ret>2*PI ) ret-= 2*PI;
-
-    return ret;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private void drawCurrVertex(Canvas canvas, Paint paint, float left, float r, float stroke, float pX,float pY, float cX, float cY, float nX, float nY)
-    {
-    pX = (0.5f+pX)*TEXTURE_HEIGHT;
-    pY = (0.5f-pY)*TEXTURE_HEIGHT;
-    cX = (0.5f+cX)*TEXTURE_HEIGHT;
-    cY = (0.5f-cY)*TEXTURE_HEIGHT;
-    nX = (0.5f+nX)*TEXTURE_HEIGHT;
-    nY = (0.5f-nY)*TEXTURE_HEIGHT;
-
-    canvas.drawLine(left+pX,pY,left+cX,cY,paint);
-
-    float aX = pX-cX;
-    float aY = pY-cY;
-    float bX = cX-nX;
-    float bY = cY-nY;
-
-    float aLen = (float)Math.sqrt(aX*aX+aY*aY);
-    float bLen = (float)Math.sqrt(bX*bX+bY*bY);
-
-    aX /= aLen;
-    aY /= aLen;
-    bX /= bLen;
-    bY /= bLen;
-
-    float sX = (aX-bX)/2;
-    float sY = (aY-bY)/2;
-    float sLen = (float)Math.sqrt(sX*sX+sY*sY);
-    sX /= sLen;
-    sY /= sLen;
-
-    float startAngle = computeAngle(bX,-bY);
-    float endAngle   = computeAngle(aX,-aY);
-    float sweepAngle = endAngle-startAngle;
-    if( sweepAngle<0 ) sweepAngle += 2*Math.PI;
-
-    float R = r*TEXTURE_HEIGHT+stroke/2;
-
-    float A = (float)(R/(Math.cos(sweepAngle/2)));
-
-    float rX = cX + A*sX;
-    float rY = cY + A*sY;
-
-    startAngle *= 180/(Math.PI);
-    sweepAngle *= 180/(Math.PI);
-
-    canvas.drawArc( left+rX-R, rY-R, left+rX+R, rY+R, startAngle, sweepAngle, false, paint);
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  void drawRoundedPolygon(Canvas canvas, Paint paint, int left, float[] vertices, float stroke, int color, float r)
-    {
-    stroke *= TEXTURE_HEIGHT;
-
-    paint.setAntiAlias(true);
-    paint.setStrokeWidth(stroke);
-    paint.setColor(color);
-    paint.setStyle(Paint.Style.FILL);
-
-    canvas.drawRect(left,0,left+TEXTURE_HEIGHT,TEXTURE_HEIGHT,paint);
-
-    paint.setColor(COLOR_BLACK);
-    paint.setStyle(Paint.Style.STROKE);
-
-    int length = vertices.length;
-    int numVertices = length/2;
-
-    float prevX = vertices[length-2];
-    float prevY = vertices[length-1];
-    float currX = vertices[0];
-    float currY = vertices[1];
-    float nextX = vertices[2];
-    float nextY = vertices[3];
-
-    for(int vert=0; vert<numVertices; vert++)
-      {
-      drawCurrVertex(canvas, paint, left, r, stroke, prevX,prevY,currX,currY,nextX,nextY);
-
-      prevX = currX;
-      prevY = currY;
-      currX = nextX;
-      currY = nextY;
-
-      if( 2*(vert+2)+1 < length )
-        {
-        nextX = vertices[2*(vert+2)  ];
-        nextY = vertices[2*(vert+2)+1];
-        }
-      else
-        {
-        nextX = vertices[0];
-        nextY = vertices[1];
-        }
-      }
-    }
-
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   int getCubitFaceColorIndex(int cubit, int face)
diff --git a/src/main/java/org/distorted/objects/TwistyPyraminx.java b/src/main/java/org/distorted/objects/TwistyPyraminx.java
index 0389bd2c..34cc916b 100644
--- a/src/main/java/org/distorted/objects/TwistyPyraminx.java
+++ b/src/main/java/org/distorted/objects/TwistyPyraminx.java
@@ -225,12 +225,12 @@ public class TwistyPyraminx extends TwistyObject
 
     if( cubit< (numLayers-1)*numLayers*(numLayers+1)/6 )
       {
-      if( mOctaMesh==null ) mOctaMesh = CubitFactory.getInstance().createOctaMesh();
+      if( mOctaMesh==null ) mOctaMesh = FactoryCubit.getInstance().createOctaMesh();
       return mOctaMesh.copy(true);
       }
     else
       {
-      if( mTetraMesh==null ) mTetraMesh = CubitFactory.getInstance().createTetraMesh();
+      if( mTetraMesh==null ) mTetraMesh = FactoryCubit.getInstance().createTetraMesh();
       return mTetraMesh.copy(true);
       }
     }
@@ -245,7 +245,8 @@ public class TwistyPyraminx extends TwistyObject
     float S = 0.08f;
     float[] vertices = { -F,-E/3, +F,-E/3, 0.0f,2*E/3};
 
-    drawRoundedPolygon(canvas, paint, left, vertices, S, FACE_COLORS[face], R);
+    FactorySticker factory = FactorySticker.getInstance();
+    factory.drawRoundedPolygon(canvas, paint, left, vertices, S, FACE_COLORS[face], R);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/objects/TwistyRedi.java b/src/main/java/org/distorted/objects/TwistyRedi.java
index d478ee70..d967a9b2 100644
--- a/src/main/java/org/distorted/objects/TwistyRedi.java
+++ b/src/main/java/org/distorted/objects/TwistyRedi.java
@@ -244,12 +244,12 @@ public class TwistyRedi extends TwistyObject
 
     if( cubit<8 )
       {
-      if( mCornerMesh==null ) mCornerMesh = CubitFactory.getInstance().createRediCornerMesh();
+      if( mCornerMesh==null ) mCornerMesh = FactoryCubit.getInstance().createRediCornerMesh();
       mesh = mCornerMesh.copy(true);
       }
     else
       {
-      if( mEdgeMesh==null ) mEdgeMesh = CubitFactory.getInstance().createRediEdgeMesh();
+      if( mEdgeMesh==null ) mEdgeMesh = FactoryCubit.getInstance().createRediEdgeMesh();
       mesh = mEdgeMesh.copy(true);
       }
 
@@ -271,6 +271,7 @@ public class TwistyRedi extends TwistyObject
   void createFaceTexture(Canvas canvas, Paint paint, int face, int left)
     {
     int COLORS = FACE_COLORS.length;
+    FactorySticker factory = FactorySticker.getInstance();
 
     if( face<COLORS )
       {
@@ -279,7 +280,7 @@ public class TwistyRedi extends TwistyObject
       float S = 0.10f;
       float[] vertices = { -F,-F, +F,-F, +F,+F, -F,+F};
 
-      drawRoundedPolygon(canvas, paint, left, vertices, S, FACE_COLORS[face], R);
+      factory.drawRoundedPolygon(canvas, paint, left, vertices, S, FACE_COLORS[face], R);
       }
     else
       {
@@ -288,7 +289,7 @@ public class TwistyRedi extends TwistyObject
       float S = 0.05f;
       float[] vertices = { -F,+F, -F,-F, 0, -2*F, +F,-F, +F,+F };
 
-      drawRoundedPolygon(canvas, paint, left, vertices, S, FACE_COLORS[face-COLORS], R);
+      factory.drawRoundedPolygon(canvas, paint, left, vertices, S, FACE_COLORS[face-COLORS], R);
       }
     }
 
diff --git a/src/main/java/org/distorted/objects/TwistySkewb.java b/src/main/java/org/distorted/objects/TwistySkewb.java
index 54d6a971..c63efc9e 100644
--- a/src/main/java/org/distorted/objects/TwistySkewb.java
+++ b/src/main/java/org/distorted/objects/TwistySkewb.java
@@ -128,23 +128,23 @@ public class TwistySkewb extends TwistyObject
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  private int getNumCorners(int size)
+  private int getNumCorners(int layers)
     {
     return 8;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  private int getNumEdges(int size)
+  private int getNumEdges(int layers)
     {
-    return (size-2)*12;
+    return (layers-2)*12;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  private int getNumCenters(int size)
+  private int getNumCenters(int layers)
     {
-    return ((size-2)*(size-2) + (size-1)*(size-1))*6;
+    return ((layers-2)*(layers-2) + (layers-1)*(layers-1))*6;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -184,11 +184,11 @@ public class TwistySkewb extends TwistyObject
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  float[] getCuts(int size)
+  float[] getCuts(int numLayers)
     {
-    float[] cuts = new float[size-1];
+    float[] cuts = new float[numLayers-1];
 
-    switch(size)
+    switch(numLayers)
       {
       case 2: cuts[0] = 0;
               break;
@@ -208,15 +208,15 @@ public class TwistySkewb extends TwistyObject
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  Static3D[] getCubitPositions(int size)
+  Static3D[] getCubitPositions(int numLayers)
     {
-    final float DIST_CORNER = (size-1)*0.50f;
-    final float DIST_EDGE   = (size-1)*0.50f;
-    final float DIST_CENTER = (size-1)*0.50f;
+    final float DIST_CORNER = (numLayers-1)*0.50f;
+    final float DIST_EDGE   = (numLayers-1)*0.50f;
+    final float DIST_CENTER = (numLayers-1)*0.50f;
 
-    final int numCorners = getNumCorners(size);
-    final int numEdges   = getNumEdges(size);
-    final int numCenters = getNumCenters(size);
+    final int numCorners = getNumCorners(numLayers);
+    final int numEdges   = getNumEdges(numLayers);
+    final int numCenters = getNumCenters(numLayers);
 
     final Static3D[] CENTERS = new Static3D[numCorners+numEdges+numCenters];
 
@@ -253,9 +253,9 @@ public class TwistySkewb extends TwistyObject
 
     for (float[] edges : edgeTable)
       {
-      float c = (3-size)*0.5f;
+      float c = (3-numLayers)*0.5f;
 
-      for (int j=0; j<size-2; j++, c+=1.0f, index++)
+      for (int j=0; j<numLayers-2; j++, c+=1.0f, index++)
         {
         CENTERS[index] = new Static3D( edges[0]==0 ? c : edges[0] ,
                                        edges[1]==0 ? c : edges[1] ,
@@ -282,13 +282,13 @@ public class TwistySkewb extends TwistyObject
 
     for( float[] centers : centerTable )
       {
-      x = (2-size)*0.5f;
+      x = (2-numLayers)*0.5f;
 
-      for(int i=0; i<size-1; i++, x+=1.0f)
+      for(int i=0; i<numLayers-1; i++, x+=1.0f)
         {
-        y = (2-size)*0.5f;
+        y = (2-numLayers)*0.5f;
 
-        for(int j=0; j<size-1; j++, y+=1.0f, index++)
+        for(int j=0; j<numLayers-1; j++, y+=1.0f, index++)
           {
                if( centers[0]==Y ) cen0 = y;
           else if( centers[0]==X ) cen0 = x;
@@ -306,13 +306,13 @@ public class TwistySkewb extends TwistyObject
           }
         }
 
-      x = (3-size)*0.5f;
+      x = (3-numLayers)*0.5f;
 
-      for(int i=0; i<size-2; i++, x+=1.0f)
+      for(int i=0; i<numLayers-2; i++, x+=1.0f)
         {
-        y = (3-size)*0.5f;
+        y = (3-numLayers)*0.5f;
 
-        for(int j=0; j<size-2; j++, y+=1.0f, index++)
+        for(int j=0; j<numLayers-2; j++, y+=1.0f, index++)
           {
                if( centers[0]==Y ) cen0 = y;
           else if( centers[0]==X ) cen0 = x;
@@ -405,14 +405,14 @@ public class TwistySkewb extends TwistyObject
 
     if( cubit<numCorners )
       {
-      if( mCornerMesh==null ) mCornerMesh = CubitFactory.getInstance().createSkewbCornerMesh();
+      if( mCornerMesh==null ) mCornerMesh = FactoryCubit.getInstance().createSkewbCornerMesh();
       mesh = mCornerMesh.copy(true);
       }
     else if( cubit<numCorners+numEdges )
       {
       if( mEdgeMesh==null )
         {
-        mEdgeMesh = CubitFactory.getInstance().createDinoMesh();
+        mEdgeMesh = FactoryCubit.getInstance().createDinoMesh();
         MatrixEffect effect = new MatrixEffectScale(1.0f/3);
         mEdgeMesh.apply(effect,-1,0);
         mEdgeMesh.addEmptyTexComponent();
@@ -422,7 +422,7 @@ public class TwistySkewb extends TwistyObject
       }
     else
       {
-      if( mFaceMesh==null ) mFaceMesh = CubitFactory.getInstance().createSkewbFaceMesh();
+      if( mFaceMesh==null ) mFaceMesh = FactoryCubit.getInstance().createSkewbFaceMesh();
       mesh = mFaceMesh.copy(true);
       }
 
@@ -460,6 +460,7 @@ public class TwistySkewb extends TwistyObject
   void createFaceTexture(Canvas canvas, Paint paint, int face, int left)
     {
     int COLORS = FACE_COLORS.length;
+    FactorySticker factory = FactorySticker.getInstance();
 
     if( face<COLORS )
       {
@@ -467,7 +468,7 @@ public class TwistySkewb extends TwistyObject
       float S = 0.035f;
       float E = 0.5f;
       float[] vertices = { -E+E/4,E/4, E/4,-E+E/4, E/4,E/4};
-      drawRoundedPolygon(canvas, paint, left, vertices, S, FACE_COLORS[face], R);
+      factory.drawRoundedPolygon(canvas, paint, left, vertices, S, FACE_COLORS[face], R);
       }
     else if( face<2*COLORS )
       {
@@ -475,8 +476,7 @@ public class TwistySkewb extends TwistyObject
       float R = 0.025f;
       float S = 0.05f;
       float[] vertices = { -F,F/3, 0,-2*F/3, +F,F/3 };
-
-      drawRoundedPolygon(canvas, paint, left, vertices, S, FACE_COLORS[face-COLORS], R);
+      factory.drawRoundedPolygon(canvas, paint, left, vertices, S, FACE_COLORS[face-COLORS], R);
       }
     else
       {
@@ -484,7 +484,7 @@ public class TwistySkewb extends TwistyObject
       float S = 0.035f;
       float E = SQ2/4;
       float[] vertices = { -E,-E, +E,-E, +E,+E, -E,+E };
-      drawRoundedPolygon(canvas, paint, left, vertices, S, FACE_COLORS[face-2*COLORS], R);
+      factory.drawRoundedPolygon(canvas, paint, left, vertices, S, FACE_COLORS[face-2*COLORS], R);
       }
     }
 
@@ -613,27 +613,30 @@ public class TwistySkewb extends TwistyObject
     {
     int q = CUBITS[0].mQuatIndex;
 
-    if ( CUBITS[1].mQuatIndex == q &&
-         CUBITS[2].mQuatIndex == q &&
-         CUBITS[3].mQuatIndex == q &&
-         CUBITS[4].mQuatIndex == q &&
-         CUBITS[5].mQuatIndex == q &&
-         CUBITS[6].mQuatIndex == q &&
-         CUBITS[7].mQuatIndex == q  )
+    int numLayers  = getNumLayers();
+    int numCorners = getNumCorners(numLayers);
+    int numEdges   = getNumEdges(numLayers);
+    int cornersAndEdges = numCorners + numEdges;
+    int cubitsPerFace = (numLayers-2)*(numLayers-2) + (numLayers-1)*(numLayers-1);
+    int cubit, q1=q;
+
+    for(cubit=0; cubit<cornersAndEdges; cubit++)
       {
-      int q1 = mulQuat(q,1);
-      int q2 = mulQuat(q,2);
-      int q3 = mulQuat(q,3);
-
-      return (CUBITS[ 8].mQuatIndex == q || CUBITS[ 8].mQuatIndex == q1) &&
-             (CUBITS[ 9].mQuatIndex == q || CUBITS[ 9].mQuatIndex == q1) &&
-             (CUBITS[10].mQuatIndex == q || CUBITS[10].mQuatIndex == q2) &&
-             (CUBITS[11].mQuatIndex == q || CUBITS[11].mQuatIndex == q2) &&
-             (CUBITS[12].mQuatIndex == q || CUBITS[12].mQuatIndex == q3) &&
-             (CUBITS[13].mQuatIndex == q || CUBITS[13].mQuatIndex == q3)  ;
+      if( CUBITS[cubit].mQuatIndex != q ) return false;
       }
 
-    return false;
+    for(int face=0; face<6; face++)
+      {
+      if( face%2==0 ) q1 = mulQuat(q, (face/2)+1);
+
+      for(int center=0; center<cubitsPerFace; center++)
+        {
+        if( CUBITS[cubit].mQuatIndex != q && CUBITS[cubit].mQuatIndex != q1 ) return false;
+        cubit++;
+        }
+      }
+
+    return true;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
