pub struct VisualizationHelper;Implementations§
Source§impl VisualizationHelper
impl VisualizationHelper
Sourcepub fn compute_normals_pca(particles: &mut Vec<ModelParticle>, k: usize)
pub fn compute_normals_pca(particles: &mut Vec<ModelParticle>, k: usize)
Compute per-particle normals from k-nearest neighborhood (PCA on local point cloud).
Sourcepub fn classify_surface_interior(
particles: &[ModelParticle],
k: usize,
density_threshold: f32,
) -> Vec<bool>
pub fn classify_surface_interior( particles: &[ModelParticle], k: usize, density_threshold: f32, ) -> Vec<bool>
Detect surface vs interior particles using k-NN density estimation. Surface particles have lower local density than interior ones.
Sourcepub fn find_edges(
particles: &[ModelParticle],
max_dist: f32,
) -> Vec<(usize, usize)>
pub fn find_edges( particles: &[ModelParticle], max_dist: f32, ) -> Vec<(usize, usize)>
Wireframe mode: find pairs of nearby particles to draw as edges.
Sourcepub fn normal_visualization_particles(
particles: &[ModelParticle],
offset: f32,
normal_char: char,
normal_color: Vec4,
) -> Vec<ModelParticle>
pub fn normal_visualization_particles( particles: &[ModelParticle], offset: f32, normal_char: char, normal_color: Vec4, ) -> Vec<ModelParticle>
Normal visualization: offset particles slightly along their normal.
Sourcepub fn average_normal(particles: &[ModelParticle], indices: &[usize]) -> Vec3
pub fn average_normal(particles: &[ModelParticle], indices: &[usize]) -> Vec3
Compute the average normal of a set of particles.
Sourcepub fn normal_color_overlay(particles: &mut Vec<ModelParticle>)
pub fn normal_color_overlay(particles: &mut Vec<ModelParticle>)
Generate a color-coded particle overlay showing normals direction.
Sourcepub fn build_spatial_hash(
particles: &[ModelParticle],
cell_size: f32,
) -> HashMap<(i32, i32, i32), Vec<usize>>
pub fn build_spatial_hash( particles: &[ModelParticle], cell_size: f32, ) -> HashMap<(i32, i32, i32), Vec<usize>>
Build a spatial hash grid for fast neighbor lookups.
Auto Trait Implementations§
impl Freeze for VisualizationHelper
impl RefUnwindSafe for VisualizationHelper
impl Send for VisualizationHelper
impl Sync for VisualizationHelper
impl Unpin for VisualizationHelper
impl UnsafeUnpin for VisualizationHelper
impl UnwindSafe for VisualizationHelper
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.