Beispiel #1
0
 private static void CullHalfOfEdges( ref H3.Cell.Edge[] edges )
 {
     double thresh = -.01;
     Vector3D looking = new Vector3D( 0, 0, -1 );
     edges = edges.Where( e => e.Start.Dot( looking ) > thresh || e.End.Dot( looking ) > thresh ).ToArray();
 }
Beispiel #2
0
        private static H3.Cell.Edge[] Cull120Cell( H3.Cell.Edge[] edges )
        {
            Func<Vector3D, bool> passes = new Func<Vector3D, bool>( v =>
            {
                //return
                //	Math.Pow( v.Z, 2 ) < 0.13 &&
                //	Math.Pow( v.W, 2 ) < 0.13;
                return Tolerance.Equal( v.W, 0.0 );
            } );

            H3.Cell.Edge[] result = edges.Where( e =>
                {
                    Vector3D start = Sterographic.R3toS3( e.Start );
                    Vector3D end = Sterographic.R3toS3( e.End );
                    return passes( start ) && passes( end );
                } ).ToArray();

            // Now cull valence-2 edges.
            //result = CullValence2Edges( result );

            return result;
        }