Skip to main content

MassProperties

Struct MassProperties 

Source
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: f64

The 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: Point

The centre of the measure: the centroid, or centre of mass at uniform density.

§inertia: Matrix3

The 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: f64

The 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

Source

pub const fn none(deflection: f64) -> Self

Nothing: no mass, at the origin, resisting nothing.

Source

pub fn inertia_about(&self, point: Point) -> Matrix3

The inertia tensor about some other point, by the parallel axis theorem.

Source

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.

Source

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

Source§

fn clone(&self) -> MassProperties

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for MassProperties

Source§

impl Debug for MassProperties

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for MassProperties

Source§

fn eq(&self, other: &MassProperties) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for MassProperties

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.