pub struct SurfaceNetsBuffer {
    pub positions: Vec<[f32; 3]>,
    pub normals: Vec<[f32; 3]>,
    pub indices: Vec<u32>,
    pub surface_points: Vec<[u32; 3]>,
    pub surface_strides: Vec<u32>,
    pub stride_to_index: Vec<u32>,
}
Expand description

The output buffers used by surface_nets. These buffers can be reused to avoid reallocating memory.

Fields

positions: Vec<[f32; 3]>

The triangle mesh positions.

These are in array-local coordinates, i.e. at array position (x, y, z), the vertex position would be (x, y, z) + centroid if the isosurface intersects that voxel.

normals: Vec<[f32; 3]>

The triangle mesh normals.

The normals are not normalized, since that is done most efficiently on the GPU.

indices: Vec<u32>

The triangle mesh indices.

surface_points: Vec<[u32; 3]>

Local 3D array coordinates of every voxel that intersects the isosurface.

surface_strides: Vec<u32>

Stride of every voxel that intersects the isosurface. Can be used for efficient post-processing.

stride_to_index: Vec<u32>

Used to map back from voxel stride to vertex index.

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.