pub fn greedy_quads<V, T>(
    voxels: &V,
    extent: &Extent3i,
    output: &mut GreedyQuadsBuffer<T::Material>,
) where
    V: Array<[i32; 3]>
        + GetUncheckedRelease<Stride, T>
        + ForEach<[i32; 3], (Point3i, Stride), Data = T>,
    T: IsEmpty + MaterialVoxel,
{
    output.reset(*extent);
    let GreedyQuadsBuffer {
        visited,
        quad_groups,
    } = output;

    let Extent3i {
        shape: interior_shape,
        minimum: interior_min,
    } = extent.padded(-1); // Avoid accessing out of bounds with a 3x3x3 kernel.

    for group in quad_groups.iter_mut() {
        greedy_quads_for_group(voxels, interior_min, interior_shape, visited, group);
    }
}
/// The "Greedy Meshing" algorithm described by Mikola Lysenko in the [0fps
/// article](https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/).
///
/// All visible faces of voxels on the interior of `extent` will be part of some `Quad` returned via the `output` buffer. A
/// 3x3x3 kernel will be applied to each point on the interior, hence the extra padding required on the boundary. `voxels` only
/// needs to contain the set of points in `extent`.
///
/// A single quad of the greedy mesh will contain faces of voxels that all share the same material. The quads can be
/// post-processed into meshes as the user sees fit.
The "Greedy Meshing" algorithm described by Mikola Lysenko in the [0fps
article].



A single quad of the greedy mesh will contain faces of voxels that all share the same material. The quads can be
post-processed into meshes as the user sees fit.
The " Greedy Meshing " algorithm described by Mikola Lysenko in the [ 0fps article ] . A single quad of the greedy mesh will contain faces of voxels that all share the same material . The quads can be post - processed into meshes as the user sees fit .
pub fn greedy_quads<V, T>(
    voxels: &V,
    extent: &Extent3i,
    output: &mut GreedyQuadsBuffer<T::Material>,
) where
    V: Array<[i32; 3]>
        + GetUncheckedRelease<Stride, T>
        + ForEach<[i32; 3], (Point3i, Stride), Data = T>,
    T: IsEmpty + MaterialVoxel,
{
    output.reset(*extent);
    let GreedyQuadsBuffer {
        visited,
        quad_groups,
    } = output;
    let Extent3i {
        shape: interior_shape,
        minimum: interior_min,
    } = extent.padded(-1); // Avoid accessing out of bounds with a 3x3x3 kernel.
    for group in quad_groups.iter_mut() {
        greedy_quads_for_group(voxels, interior_min, interior_shape, visited, group);
    }
}
pub fn greedy_quads < V , T > ( voxels : & V , extent : & Extent3i , output : & mut GreedyQuadsBuffer < T :: Material > , ) where V : Array < [ i32 ; 3 ] > + GetUncheckedRelease < Stride , T > + ForEach < [ i32 ; 3 ] , ( Point3i , Stride ) , Data = T > , T : IsEmpty + MaterialVoxel , { output . reset ( * extent ) ; let GreedyQuadsBuffer { visited , quad_groups , } = output ; let Extent3i { shape : interior_shape , minimum : interior_min , } = extent . padded ( - 1 ) ; // Avoid accessing out of bounds with a 3x3x3 kernel. for group in quad_groups . iter_mut ( ) { greedy_quads_for_group ( voxels , interior_min , interior_shape , visited , group ) ; } }
The "Greedy Meshing" algorithm described by Mikola Lysenko in the [0fps
article](https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/).
The " Greedy Meshing " algorithm described by Mikola Lysenko in the [ 0fps article ] ( https : // 0fps . net / 2012 / 06 / 30 / meshing - in - a - minecraft - game / ) .
voxels
&V
extent
&Extent3i
output
&mut GreedyQuadsBuffer<T::Material>
voxels
&V
extent
&Extent3i
output
&mut GreedyQuadsBuffer<T::Material>