pub struct VdbSparseGrid {
pub name: String,
pub grid_type: String,
pub voxel_size: f64,
pub background: f64,
pub voxels: Vec<VdbVoxel>,
}Expand description
A sparse VDB volume grid (minimal ASCII representation).
Fields§
§name: StringGrid name.
grid_type: StringGrid type (“float”, “vec3s”, etc.).
voxel_size: f64World-space voxel size.
background: f64Background (default) value.
voxels: Vec<VdbVoxel>Populated voxels.
Implementations§
Source§impl VdbSparseGrid
impl VdbSparseGrid
Sourcepub fn new(name: impl Into<String>, voxel_size: f64, background: f64) -> Self
pub fn new(name: impl Into<String>, voxel_size: f64, background: f64) -> Self
Create a new VdbSparseGrid.
Sourcepub fn from_scalar_field(
field: &ScalarField3D,
threshold: f64,
name: impl Into<String>,
) -> Self
pub fn from_scalar_field( field: &ScalarField3D, threshold: f64, name: impl Into<String>, ) -> Self
Populate from a ScalarField3D (only non-background voxels).
Sourcepub fn write_ascii_header(&self) -> String
pub fn write_ascii_header(&self) -> String
Write a minimal ASCII VDB-like header.
Trait Implementations§
Source§impl Clone for VdbSparseGrid
impl Clone for VdbSparseGrid
Source§fn clone(&self) -> VdbSparseGrid
fn clone(&self) -> VdbSparseGrid
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for VdbSparseGrid
impl RefUnwindSafe for VdbSparseGrid
impl Send for VdbSparseGrid
impl Sync for VdbSparseGrid
impl Unpin for VdbSparseGrid
impl UnsafeUnpin for VdbSparseGrid
impl UnwindSafe for VdbSparseGrid
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.