pub struct PackingSphere {
pub center: [f64; 3],
pub radius: f64,
pub id: usize,
}Expand description
A sphere in 3D space, described by its center and radius.
Fields§
§center: [f64; 3]Center of the sphere.
radius: f64Radius of the sphere.
id: usizeUnique identifier.
Implementations§
Source§impl PackingSphere
impl PackingSphere
Sourcepub fn overlaps(&self, other: &PackingSphere) -> bool
pub fn overlaps(&self, other: &PackingSphere) -> bool
Check if this sphere overlaps with another sphere.
Sourcepub fn distance_to(&self, other: &PackingSphere) -> f64
pub fn distance_to(&self, other: &PackingSphere) -> f64
Compute center-to-center distance.
Sourcepub fn overlap_with(&self, other: &PackingSphere) -> f64
pub fn overlap_with(&self, other: &PackingSphere) -> f64
Compute overlap (interpenetration) with another sphere.
Returns the overlap distance (positive = overlap, negative = separation).
Trait Implementations§
Source§impl Clone for PackingSphere
impl Clone for PackingSphere
Source§fn clone(&self) -> PackingSphere
fn clone(&self) -> PackingSphere
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 Debug for PackingSphere
impl Debug for PackingSphere
Source§impl PartialEq for PackingSphere
impl PartialEq for PackingSphere
impl StructuralPartialEq for PackingSphere
Auto Trait Implementations§
impl Freeze for PackingSphere
impl RefUnwindSafe for PackingSphere
impl Send for PackingSphere
impl Sync for PackingSphere
impl Unpin for PackingSphere
impl UnsafeUnpin for PackingSphere
impl UnwindSafe for PackingSphere
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.