pub fn new(grid: [usize; 3],
               lattice: [[f64; 3]; 3],
               voxel_origin: [f64; 3])
               -> Self {
        let size = Size::new(grid[0], grid[1], grid[2]);
        let shift = Shift::new(&size);
        let voxel_lattice = Lattice::new([[lattice[0][0] / grid[0] as f64,
                                           lattice[0][1] / grid[0] as f64,
                                           lattice[0][2] / grid[0] as f64],
                                          [lattice[1][0] / grid[1] as f64,
                                           lattice[1][1] / grid[1] as f64,
                                           lattice[1][2] / grid[1] as f64],
                                          [lattice[2][0] / grid[2] as f64,
                                           lattice[2][1] / grid[2] as f64,
                                           lattice[2][2] / grid[2] as f64]]);
        let voronoi = Voronoi::new(&voxel_lattice);
        Self { shift,
               size,
               voronoi,
               voxel_lattice,
               voxel_origin }
    }
/// Initialises a grid structure. Computes the voxel_lattice from the grid and lattice.
Initialises a grid structure. Computes the voxel_lattice from the grid and lattice.
Initialises a grid structure . Computes the voxel_lattice from the grid and lattice .
pub fn new(grid: [usize; 3],
               lattice: [[f64; 3]; 3],
               voxel_origin: [f64; 3])
               -> Self {
        let size = Size::new(grid[0], grid[1], grid[2]);
        let shift = Shift::new(&size);
        let voxel_lattice = Lattice::new([[lattice[0][0] / grid[0] as f64,
                                           lattice[0][1] / grid[0] as f64,
                                           lattice[0][2] / grid[0] as f64],
                                          [lattice[1][0] / grid[1] as f64,
                                           lattice[1][1] / grid[1] as f64,
                                           lattice[1][2] / grid[1] as f64],
                                          [lattice[2][0] / grid[2] as f64,
                                           lattice[2][1] / grid[2] as f64,
                                           lattice[2][2] / grid[2] as f64]]);
        let voronoi = Voronoi::new(&voxel_lattice);
        Self { shift,
               size,
               voronoi,
               voxel_lattice,
               voxel_origin }
    }
pub fn new ( grid : [ usize ; 3 ] , lattice : [ [ f64 ; 3 ] ; 3 ] , voxel_origin : [ f64 ; 3 ] ) -> Self { let size = Size :: new ( grid [ 0 ] , grid [ 1 ] , grid [ 2 ] ) ; let shift = Shift :: new ( & size ) ; let voxel_lattice = Lattice :: new ( [ [ lattice [ 0 ] [ 0 ] / grid [ 0 ] as f64 , lattice [ 0 ] [ 1 ] / grid [ 0 ] as f64 , lattice [ 0 ] [ 2 ] / grid [ 0 ] as f64 ] , [ lattice [ 1 ] [ 0 ] / grid [ 1 ] as f64 , lattice [ 1 ] [ 1 ] / grid [ 1 ] as f64 , lattice [ 1 ] [ 2 ] / grid [ 1 ] as f64 ] , [ lattice [ 2 ] [ 0 ] / grid [ 2 ] as f64 , lattice [ 2 ] [ 1 ] / grid [ 2 ] as f64 , lattice [ 2 ] [ 2 ] / grid [ 2 ] as f64 ] ] ) ; let voronoi = Voronoi :: new ( & voxel_lattice ) ; Self { shift , size , voronoi , voxel_lattice , voxel_origin } }
Initialises a grid structure.
Initialises a grid structure .
grid
[usize; 3]
lattice
[[f64; 3]; 3]
voxel_origin
[f64; 3]
grid
[usize; 3]
lattice
[[f64; 3]; 3]
voxel_origin
[f64; 3]