Skip to main content

PlacedComponent

Struct PlacedComponent 

Source
pub struct PlacedComponent {
Show 14 fields pub id: String, pub stage: usize, pub parent: Option<usize>, pub part: Part, pub fore_station_m: f64, pub length_m: f64, pub finish: Finish, pub body_radius_m: Option<f64>, pub motor_mount: Option<MotorMount>, pub own: MassProperties, pub with_children: MassProperties, pub center_overridden: bool, pub copies: Vec<Placement>, pub drag_override: Option<DragOverride>,
}
Expand description

A component resolved into place.

Fields§

§id: String

The component’s id.

§stage: usize

Index of its stage in Layout::stages.

§parent: Option<usize>

Index of its parent in Layout::components; None for a body component of the airframe (a pod’s body components have their pod set as parent).

§part: Part

The part with every automatic dimension filled in.

§fore_station_m: f64

Station of its forward end (the start of its axial extent), m aft of the nose tip.

§length_m: f64

Axial extent (Component::length_m: a pod set’s is its pod’s), m.

§finish: Finish

The outer surface’s finish (Component::finish, with the default filled in).

§body_radius_m: Option<f64>

For an external attachment, the radius of the body tube it sits on, m.

§motor_mount: Option<MotorMount>

Its motor mount, if it is one.

§own: MassProperties

Its own mass properties in body axes, after overrides that cover it alone.

§with_children: MassProperties

It with everything attached to it, after every override that applies within.

§center_overridden: bool

Whether its own overrides move its center of mass along the axis (cg_aft_m). Written before the move to US spelling as centre_overridden, which is still read and never written.

§copies: Vec<Placement>

Where the copies of it sit, each a Placement of it from where it is written: one Placement::HERE for a part in no cluster or pod, one per tube for a part inside a clustered inner tube (InnerTube::cluster_m), and one per pod, turned with it, for a part in a pod (PodSet::pods); nested, every combination. Self::own and Self::with_children count every copy. A clustered tube’s own tubes are its part’s. An empty list is no copy: the part weighs nothing and a motor in it is not placed.

§drag_override: Option<DragOverride>

The drag coefficient the component states (Component::drag_override).

Implementations§

Source§

impl PlacedComponent

Source

pub fn aft_station_m(&self) -> f64

Station of the aft end of its axial extent, m.

Source

pub fn contents_copies(&self) -> Result<Vec<Placement>, DesignError>

Where the copies of what it holds sit, from where that is written: for a clustered inner tube, every tube of every copy of it; for a pod set, every pod of every copy of it; for any other part, its own copies. A motor in a clustered mount, or in a pod, is one motor per place.

§Errors

DesignError::Domain for a cluster offset that is not finite, or a pod set’s errors from PodSet::pods.

Trait Implementations§

Source§

impl Clone for PlacedComponent

Source§

fn clone(&self) -> PlacedComponent

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 Debug for PlacedComponent

Source§

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

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

impl<'de> Deserialize<'de> for PlacedComponent

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 PartialEq for PlacedComponent

Source§

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

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 PlacedComponent

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.