Пример #1
0
        private static int GetLcdTriangleIndex(FullerIcosahedron.Face face, Cartesian3D point)
        {
            var hDist1 = (point - face.A).Magnitude();
            var hDist2 = (point - face.B).Magnitude();
            var hDist3 = (point - face.C).Magnitude();

            if ((hDist1 <= hDist2) && (hDist2 <= hDist3))
            {
                return(0);
            }
            if ((hDist1 <= hDist3) && (hDist3 <= hDist2))
            {
                return(5);
            }
            if ((hDist2 <= hDist1) && (hDist1 <= hDist3))
            {
                return(1);
            }
            if ((hDist2 <= hDist3) && (hDist3 <= hDist1))
            {
                return(2);
            }
            if ((hDist3 <= hDist1) && (hDist1 <= hDist2))
            {
                return(4);
            }
            if ((hDist3 <= hDist2) && (hDist2 <= hDist1))
            {
                return(3);
            }
            else
            {
                throw new Exception("Could not identify lowest common denominator triangle");
            }
        }
Пример #2
0
 private FullerTriangle(FullerIcosahedron.Face face, int lcdIndex, Func <Cartesian2D, Cartesian2D> transform)
 {
     IcosahedronFace = face;
     LcdIndex        = lcdIndex;
     Transform       = transform;
 }