Skip to main content

Overrides

Struct Overrides 

Source
pub struct Overrides {
    pub mass_kg: Option<f64>,
    pub cg_aft_m: Option<f64>,
    pub cg_xy_m: Option<[f64; 2]>,
    pub inertia: Option<InertiaOverride>,
}
Expand description

Values that replace the mass properties computed from geometry. Each applies in turn:

  1. Mass m′: the body is rescaled, I′ = I m′/m, keeping its center and shape. A body with no mass becomes a point mass at its center, but for a packed part in a layout (a mass component, parachute, streamer or shock cord), which takes m′ as a solid cylinder of its packing, as OpenRocket 24.12 does (ADR-063).
  2. Center of mass: the center moves along the axis to cg_aft_m aft of the component’s forward end (a stage’s, for a stage), with or without its children, and off the axis to cg_xy_m when given (otherwise it keeps its offset); the tensor about the center is unchanged.
  3. Inertia: the tensor about the (new) center is replaced.

Fields§

§mass_kg: Option<f64>

Mass, kg.

§cg_aft_m: Option<f64>

Center of mass, m aft of the forward end of the component (or the stage).

§cg_xy_m: Option<[f64; 2]>

Center of mass off the axis, [x, y] in body axes, m. For a part inside a cluster’s tube or a pod, it is measured in that one copy as written (a pod on the body’s axis), and the copies carry it to each place.

§inertia: Option<InertiaOverride>

Inertia tensor about the center of mass. For a part inside a cluster’s tube or a pod, it is in that one copy’s axes as written, and turns with each pod.

Implementations§

Source§

impl Overrides

Source

pub fn sets_center(&self) -> bool

Whether the center of mass is overridden, along the axis or off it.

Source

pub fn sets_axial_center(&self) -> bool

Whether the center of mass is moved along the axis (cg_aft_m).

Source

pub fn is_empty(&self) -> bool

Whether nothing is overridden.

Source

pub fn apply( &self, mass: MassProperties, fore_station_m: f64, ) -> Result<MassProperties, DesignError>

Applies the overrides to mass, measuring a center-of-mass override from station fore_station_m.

§Errors

DesignError::Domain for a negative or non-finite mass or a non-finite center, and DesignError::UnphysicalInertia when the result is not a real body (MassProperties::validate).

Trait Implementations§

Source§

impl Clone for Overrides

Source§

fn clone(&self) -> Overrides

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 Overrides

Source§

impl Debug for Overrides

Source§

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

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

impl Default for Overrides

Source§

fn default() -> Overrides

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Overrides

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for Overrides

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for Overrides

Source§

fn eq(&self, other: &Overrides) -> 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 Serialize for Overrides

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Overrides

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

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

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> 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.