public static RenderGeometry CreateCuboctahedronGeometry(float size, float ratio)
    {
        if (ratio <= 0)
        {
            return(CreateTetrahedronGeometry(size, 1));
        }
        if (ratio >= 1)
        {
            RenderGeometry result = CreateTetrahedronGeometry(size, 1);
            result.ApplyRotation(Quaternion.AngleAxis(90, Vector3.up));
            return(result);
        }

        RenderGeometry geometry = new RenderGeometry();

        var corners = new Dictionary <IntVector3, Vertex>();

        foreach (var symmetry in Symmetry.SymmetryGroup("110"))
        {
            IntVector3 key      = symmetry.Apply(Key(1, 1, 0));
            Vector3    position = symmetry.Apply(Vec(1, 1, (1 - ratio * 2) * (symmetry.isNegative ? -1 : 1)) * (size / 2));
            corners[key] = geometry.CreateVertex(position);
        }
        foreach (IntVector3[] keys in Combine(
                     FaceSymmetryGroup("100", Key(1, 0, -1), Key(1, 1, 0), Key(1, 0, 1), Key(1, -1, 0)),
                     FaceSymmetryGroup("111", Key(1, 1, 0), Key(0, 1, 1), Key(1, 0, 1))))
        {
            geometry.CreateFace(keys.Select(key => corners[key]).ToArray());
        }
        return(geometry);
    }
 public static RenderGeometry CreateTetrahedronToTetrahedronTransitionGeometry(float size, float ratio, bool cutEdge)
 {
     if (cutEdge)
     {
         return(CreateCuboctahedronGeometry(size, ratio));
     }
     if (ratio <= 0.5f)
     {
         return(CreateTrunctedTetrahedronGeometry(size, ratio * 2));
     }
     else
     {
         RenderGeometry geometry = CreateTrunctedTetrahedronGeometry(size, (1 - ratio) * 2);
         geometry.ApplyRotation(Quaternion.AngleAxis(90, Vector3.up));
         return(geometry);
     }
 }