HyperbolicModels.H3Ruled.Helicoid C# (CSharp) Method

Helicoid() public method

public Helicoid ( ) : H3.Cell.Edge[]
return H3.Cell.Edge[]
        public H3.Cell.Edge[] Helicoid()
        {
            List<H3.Cell.Edge> fiberList = new List<H3.Cell.Edge>();

            double rotationRate = Math.PI / 40;
            int numFibers = 350;

            // Note: we need to increment a constant hyperbolic distance each step.
            int count = 0;
            double max = DonHatch.e2hNorm( 0.99 );
            double offset = max * 2 / (numFibers - 1);
            for( double z_h = -max; z_h <= max; z_h += offset )
            {
                double z = DonHatch.h2eNorm( z_h );

                Sphere s = H3Models.Ball.OrthogonalSphereInterior( new Vector3D( 0, 0, z ) );
                Circle3D c = H3Models.Ball.IdealCircle( s );

                // Two endpoints of our fiber.
                Vector3D v1 = new Vector3D( c.Radius, 0, c.Center.Z );
                Vector3D v2 = new Vector3D( -c.Radius, 0, c.Center.Z );

                v1.RotateXY( rotationRate * count );
                v2.RotateXY( rotationRate * count );

                v1 = Transform( v1 );
                v2 = Transform( v2 );

                fiberList.Add( new H3.Cell.Edge( v1, v2 ) );
                count++;
            }

            return fiberList.ToArray();
        }

Usage Example

Ejemplo n.º 1
0
        static double m_thresh = 0.1;        //0.004;

        public static void H3Helicoid()
        {
            H3Ruled ruled = new H3Ruled();

            H3.Cell.Edge[] edgesBall = ruled.Helicoid();

            System.Func <H3.Cell.Edge, Vector3D[]> divider = e =>
            {
                return(H3Models.Ball.GeodesicPoints(e.Start, e.End, 50));
            };

            Mesh thinMesh;
            List <Vector3D[]> boundaryPoints;

            ThinMesh(edgesBall, divider, out thinMesh, out boundaryPoints);
            HelicoidHelper(thinMesh, boundaryPoints);
        }