Esempio n. 1
0
        /// <summary>
        /// Helper to do a geodesic pan.
        /// </summary>
        private void GeodesicPan(Vector3D p1, Vector3D p2)
        {
            Mobius   pan     = new Mobius();
            Isometry inverse = m_isometry.Inverse();

            p1 = inverse.Apply(p1);
            p2 = inverse.Apply(p2);
            pan.Geodesic(m_geometry, p1, p2);
            m_isometry.Mobius *= pan;
        }
Esempio n. 2
0
        public Mobius MobiusForTwist(Geometry g, SingleTwist twist, double rotation, bool earthquake, bool earthquakeData = false)
        {
            Mobius mobius = new Mobius();

            if (earthquake)
            {
                int seg = earthquakeData ?
                          (twist.SliceMaskEarthquake * 2 + 3) % 6 :
                          (twist.SliceMask * 2 + 3) % 6;
                Vector3D p1 = this.Pants.Hexagon.Segments[seg].P2;
                Vector3D p2 = Pants.Hexagon.Segments[seg].P1;
                if (Pants.Isometry.Reflected)
                {
                    R3.Core.Utils.SwapPoints(ref p1, ref p2);
                }
                System.Diagnostics.Debug.Assert(!Reverse);
                mobius.Geodesic(Geometry.Hyperbolic, p1, p2, rotation);
            }
            else
            {
                mobius.Elliptic(g, Center, Reverse ? rotation * -1 : rotation);
            }
            return(mobius);
        }