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:
- 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 takesm′as a solid cylinder of its packing, as OpenRocket 24.12 does (ADR-063). - Center of mass: the center moves along the axis to
cg_aft_maft of the component’s forward end (a stage’s, for a stage), with or without its children, and off the axis tocg_xy_mwhen given (otherwise it keeps its offset); the tensor about the center is unchanged. - 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
impl Overrides
Sourcepub fn sets_center(&self) -> bool
pub fn sets_center(&self) -> bool
Whether the center of mass is overridden, along the axis or off it.
Sourcepub fn sets_axial_center(&self) -> bool
pub fn sets_axial_center(&self) -> bool
Whether the center of mass is moved along the axis (cg_aft_m).
Sourcepub fn apply(
&self,
mass: MassProperties,
fore_station_m: f64,
) -> Result<MassProperties, DesignError>
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§
impl Copy for Overrides
Source§impl<'de> Deserialize<'de> for Overrides
impl<'de> Deserialize<'de> for Overrides
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Overrides
impl JsonSchema for Overrides
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more