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§
Source§impl Clone for SurfaceNetsBuffer
impl Clone for SurfaceNetsBuffer
Source§fn clone(&self) -> SurfaceNetsBuffer
fn clone(&self) -> SurfaceNetsBuffer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Default for SurfaceNetsBuffer
impl Default for SurfaceNetsBuffer
Source§fn default() -> SurfaceNetsBuffer
fn default() -> SurfaceNetsBuffer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SurfaceNetsBuffer
impl RefUnwindSafe for SurfaceNetsBuffer
impl Send for SurfaceNetsBuffer
impl Sync for SurfaceNetsBuffer
impl Unpin for SurfaceNetsBuffer
impl UnwindSafe for SurfaceNetsBuffer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more