pub struct MassProperties {
pub mass: f64,
pub centre: Point,
pub inertia: Matrix3,
pub deflection: f64,
}Expand description
How much of something there is, and how it is distributed.
Fields§
§mass: f64The measure: length, area or volume, depending on what was asked for.
Never negative. A volume computed from an inward-wound shell would come out negative, which says the shell is inside out rather than that the solid has negative volume, so that case is an error instead.
centre: PointThe centre of the measure: the centroid, or centre of mass at uniform density.
inertia: Matrix3The inertia tensor about MassProperties::centre, at unit density.
About the centre, not the origin: an inertia about the origin says as
much about where the part happens to sit as about the part.
MassProperties::inertia_about moves it elsewhere.
deflection: f64The chord deflection the tessellation was built to.
The honest statement of accuracy. For a shape with only planar faces and straight edges the result is exact whatever this says, because the tessellation is exact.
Implementations§
Source§impl MassProperties
impl MassProperties
Sourcepub fn inertia_about(&self, point: Point) -> Matrix3
pub fn inertia_about(&self, point: Point) -> Matrix3
The inertia tensor about some other point, by the parallel axis theorem.
Sourcepub fn radius_of_gyration(&self, axis: Direction) -> Option<f64>
pub fn radius_of_gyration(&self, axis: Direction) -> Option<f64>
The radius of gyration about an axis through the centre.
The distance at which a point of the same mass would have the same
inertia. Zero mass has no such distance, so this returns None rather
than dividing by it.
Sourcepub fn principal_axes(
&self,
tol: Tolerances,
) -> OgeomResult<[(f64, Direction); 3]>
pub fn principal_axes( &self, tol: Tolerances, ) -> OgeomResult<[(f64, Direction); 3]>
The principal moments, smallest first, with the axes they act about.
The eigenvectors of a symmetric tensor, so the axes are orthogonal. A shape with rotational symmetry has repeated moments and the axes in that plane are arbitrary but still orthogonal, which is correct, not a failure: any pair of perpendicular axes in that plane is principal.
§Errors
OgeomError::NotDone if the eigen-solver does
not converge, which for a symmetric 3×3 means the tensor was not finite.
Trait Implementations§
Source§impl Clone for MassProperties
impl Clone for MassProperties
Source§fn clone(&self) -> MassProperties
fn clone(&self) -> MassProperties
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for MassProperties
Source§impl Debug for MassProperties
impl Debug for MassProperties
Source§impl PartialEq for MassProperties
impl PartialEq for MassProperties
Source§fn eq(&self, other: &MassProperties) -> bool
fn eq(&self, other: &MassProperties) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for MassProperties
Auto Trait Implementations§
impl Freeze for MassProperties
impl RefUnwindSafe for MassProperties
impl Send for MassProperties
impl Sync for MassProperties
impl Unpin for MassProperties
impl UnsafeUnpin for MassProperties
impl UnwindSafe for MassProperties
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Scalar for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.