fn index_gen(size: &Size) -> Vec<u8> {
        let mut index = vec![0u8; size.total];
        let mut i: usize = 0;
        let bound_x: usize = (size.x - 1) as usize;
        let bound_y: usize = (size.y - 1) as usize;
        let bound_z: usize = (size.z - 1) as usize;

        // first x
        // first y
        index[i] = 26;
        i += 1;
        for _ in 1..bound_z {
            index[i] = 24;
            i += 1;
        }
        index[i] = 25;
        i += 1;
        // bulk y
        for _ in 1..bound_y {
            index[i] = 20;
            i += 1;
            for _ in 1..bound_z {
                index[i] = 18;
                i += 1;
            }
            index[i] = 19;
            i += 1;
        }
        // last y
        index[i] = 23;
        i += 1;
        for _ in 1..bound_z {
            index[i] = 21;
            i += 1;
        }
        index[i] = 22;
        i += 1;

        // bulk x
        // first y
        for _ in 1..bound_x {
            index[i] = 8;
            i += 1;
            for _ in 1..bound_z {
                index[i] = 6;
                i += 1;
            }
            index[i] = 7;
            i += 1;
            // bulk y
            for _ in 1..bound_y {
                index[i] = 2;
                i += bound_z;
                index[i] = 1;
                i += 1;
            }
            // last y
            index[i] = 5;
            i += 1;
            for _ in 1..bound_z {
                index[i] = 3;
                i += 1;
            }
            index[i] = 4;
            i += 1;
        }

        // last x
        // first y
        index[i] = 17;
        i += 1;
        for _ in 1..bound_z {
            index[i] = 15;
            i += 1;
        }
        index[i] = 16;
        i += 1;
        // bulk y
        for _ in 1..bound_y {
            index[i] = 11;
            i += 1;
            for _ in 1..bound_z {
                index[i] = 9;
                i += 1;
            }
            index[i] = 10;
            i += 1;
        }
        // last y
        index[i] = 14;
        i += 1;
        for _ in 1..bound_z {
            index[i] = 12;
            i += 1;
        }
        index[i] = 13;
        index
    }
/// Generate the indices for Shift.index
Generate the indices for Shift.index
Generate the indices for Shift . index
fn index_gen(size: &Size) -> Vec<u8> {
        let mut index = vec![0u8; size.total];
        let mut i: usize = 0;
        let bound_x: usize = (size.x - 1) as usize;
        let bound_y: usize = (size.y - 1) as usize;
        let bound_z: usize = (size.z - 1) as usize;
        // first x
        // first y
        index[i] = 26;
        i += 1;
        for _ in 1..bound_z {
            index[i] = 24;
            i += 1;
        }
        index[i] = 25;
        i += 1;
        // bulk y
        for _ in 1..bound_y {
            index[i] = 20;
            i += 1;
            for _ in 1..bound_z {
                index[i] = 18;
                i += 1;
            }
            index[i] = 19;
            i += 1;
        }
        // last y
        index[i] = 23;
        i += 1;
        for _ in 1..bound_z {
            index[i] = 21;
            i += 1;
        }
        index[i] = 22;
        i += 1;
        // bulk x
        // first y
        for _ in 1..bound_x {
            index[i] = 8;
            i += 1;
            for _ in 1..bound_z {
                index[i] = 6;
                i += 1;
            }
            index[i] = 7;
            i += 1;
            // bulk y
            for _ in 1..bound_y {
                index[i] = 2;
                i += bound_z;
                index[i] = 1;
                i += 1;
            }
            // last y
            index[i] = 5;
            i += 1;
            for _ in 1..bound_z {
                index[i] = 3;
                i += 1;
            }
            index[i] = 4;
            i += 1;
        }
        // last x
        // first y
        index[i] = 17;
        i += 1;
        for _ in 1..bound_z {
            index[i] = 15;
            i += 1;
        }
        index[i] = 16;
        i += 1;
        // bulk y
        for _ in 1..bound_y {
            index[i] = 11;
            i += 1;
            for _ in 1..bound_z {
                index[i] = 9;
                i += 1;
            }
            index[i] = 10;
            i += 1;
        }
        // last y
        index[i] = 14;
        i += 1;
        for _ in 1..bound_z {
            index[i] = 12;
            i += 1;
        }
        index[i] = 13;
        index
    }
fn index_gen ( size : & Size ) -> Vec < u8 > { let mut index = vec ! [ 0u8 size total ] ; let mut i : usize = 0 ; let bound_x : usize = ( size . x - 1 ) as usize ; let bound_y : usize = ( size . y - 1 ) as usize ; let bound_z : usize = ( size . z - 1 ) as usize ; // first x // first y index [ i ] = 26 ; i += 1 ; for _ in 1 .. bound_z { index [ i ] = 24 ; i += 1 ; } index [ i ] = 25 ; i += 1 ; // bulk y for _ in 1 .. bound_y { index [ i ] = 20 ; i += 1 ; for _ in 1 .. bound_z { index [ i ] = 18 ; i += 1 ; } index [ i ] = 19 ; i += 1 ; } // last y index [ i ] = 23 ; i += 1 ; for _ in 1 .. bound_z { index [ i ] = 21 ; i += 1 ; } index [ i ] = 22 ; i += 1 ; // bulk x // first y for _ in 1 .. bound_x { index [ i ] = 8 ; i += 1 ; for _ in 1 .. bound_z { index [ i ] = 6 ; i += 1 ; } index [ i ] = 7 ; i += 1 ; // bulk y for _ in 1 .. bound_y { index [ i ] = 2 ; i += bound_z ; index [ i ] = 1 ; i += 1 ; } // last y index [ i ] = 5 ; i += 1 ; for _ in 1 .. bound_z { index [ i ] = 3 ; i += 1 ; } index [ i ] = 4 ; i += 1 ; } // last x // first y index [ i ] = 17 ; i += 1 ; for _ in 1 .. bound_z { index [ i ] = 15 ; i += 1 ; } index [ i ] = 16 ; i += 1 ; // bulk y for _ in 1 .. bound_y { index [ i ] = 11 ; i += 1 ; for _ in 1 .. bound_z { index [ i ] = 9 ; i += 1 ; } index [ i ] = 10 ; i += 1 ; } // last y index [ i ] = 14 ; i += 1 ; for _ in 1 .. bound_z { index [ i ] = 12 ; i += 1 ; } index [ i ] = 13 ; index }
Generate the indices for Shift.index
Generate the indices for Shift . index
size
&Size
size
&Size