Beispiel #1
0
 public VirtualMega(MegaImageConfiguration configs)
 {
     CleanMega();
     if (configs.Moves != null)
     {
         PreformAlg(configs.Moves, false);
         configs.StickerDefs = getDefs();
     }
     else if (configs.Case != null)
     {
         PreformAlg(configs.Case, true);
         configs.StickerDefs = getDefs();
     }
 }
Beispiel #2
0
        public MegaImageProp(MegaImageConfiguration configs)
            : base(configs)
        {
            SetStickerDefs(configs.Scheme, configs.StickerDefs);

            ImageLength = configs.ImageLength;

            var centerX = ImageLength / 2;

            LongSideDist = centerX / Math.Cos(LARGEANGLE / 4);
            LongFaceDist = 0.8 * LongSideDist;
            CenterDist   = LongFaceDist * 0.4;
            var belowCenterY = Math.Cos(LARGEANGLE / 2) * LongSideDist;

            Center    = new CoordPair(centerX, LongSideDist);
            ImageSize = new Tuple <double, double>(ImageLength, Center.Y + belowCenterY);

            ShortFaceDist = Math.Sin(Math.PI * 54 / 180) * LongFaceDist / Math.Sin(Math.PI * 126 / 180 - SMALLANGLE);

            var edgeHalfWidth = Math.Sin(LARGEANGLE / 2) * CenterDist * 0.75;

            ShortSideDist = Math.Sqrt(Math.Pow(edgeHalfWidth, 2) + Math.Pow(belowCenterY, 2));
            SideAngle     = Math.Acos(belowCenterY / ShortSideDist);
        }
Beispiel #3
0
 public MegaImage(MegaImageConfiguration configs)
 {
     Properties = new MegaImageProp(configs);
     CreatePieces();
 }