pub struct SpaceColonization {
pub attractors: Vec<[f64; 3]>,
pub nodes: Vec<ColonizationNode>,
pub segment_length: f64,
pub influence_radius: f64,
pub kill_radius: f64,
}Expand description
Space colonization algorithm for tree and vascular structure generation.
Fields§
§attractors: Vec<[f64; 3]>Attractor points defining the target space
nodes: Vec<ColonizationNode>Current tree nodes
segment_length: f64Segment length for each growth step
influence_radius: f64Influence radius of attractors
kill_radius: f64Kill radius (attractor removed when node is within this distance)
Implementations§
Source§impl SpaceColonization
impl SpaceColonization
Sourcepub fn new(
attractors: Vec<[f64; 3]>,
root: [f64; 3],
segment_length: f64,
influence_radius: f64,
kill_radius: f64,
) -> Self
pub fn new( attractors: Vec<[f64; 3]>, root: [f64; 3], segment_length: f64, influence_radius: f64, kill_radius: f64, ) -> Self
Create a new space colonization system.
Sourcepub fn grow(&mut self) -> usize
pub fn grow(&mut self) -> usize
Perform one growth step.
Returns the number of new nodes added.
Sourcepub fn grow_until_done(&mut self, max_steps: u32)
pub fn grow_until_done(&mut self, max_steps: u32)
Grow until no more attractors remain or max_steps reached.
Trait Implementations§
Source§impl Clone for SpaceColonization
impl Clone for SpaceColonization
Source§fn clone(&self) -> SpaceColonization
fn clone(&self) -> SpaceColonization
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 moreAuto Trait Implementations§
impl Freeze for SpaceColonization
impl RefUnwindSafe for SpaceColonization
impl Send for SpaceColonization
impl Sync for SpaceColonization
impl Unpin for SpaceColonization
impl UnsafeUnpin for SpaceColonization
impl UnwindSafe for SpaceColonization
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.