#[non_exhaustive]pub enum Part {
Show 14 variants
NoseCone(NoseCone),
BodyTube(BodyTube),
Transition(Transition),
InnerTube(InnerTube),
CenteringRing(CenteringRing),
FinSet(FinSet),
TubeFinSet(TubeFinSet),
LaunchLug(LaunchLug),
RailButton(RailButton),
PodSet(PodSet),
MassComponent(MassComponent),
Parachute(Parachute),
Streamer(Streamer),
ShockCord(ShockCord),
}Expand description
A part in the tree. Serialized as an object with one key, the part’s kind.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NoseCone(NoseCone)
A nose cone (body component).
BodyTube(BodyTube)
A body tube (body component).
Transition(Transition)
A transition (body component).
InnerTube(InnerTube)
An inner tube (internal): a coupler, motor mount tube or engine block.
CenteringRing(CenteringRing)
A centering ring or bulkhead (internal).
FinSet(FinSet)
A fin set (external, on a body tube). Its axial extent is the root chord.
TubeFinSet(TubeFinSet)
Tube fins (external, on a body tube).
LaunchLug(LaunchLug)
Launch lugs (external, on a body tube). The extent covers the whole row.
RailButton(RailButton)
Rail buttons (external, on a body tube). The extent covers the whole row.
PodSet(PodSet)
Pods (external, on a body tube). Its children are the pod’s body components, which stack
along the pod’s axis; its extent is theirs (Component::length_m).
MassComponent(MassComponent)
A mass component (internal).
Parachute(Parachute)
A parachute (internal).
Streamer(Streamer)
A streamer (internal).
ShockCord(ShockCord)
A shock cord (internal).
Implementations§
Source§impl Part
impl Part
Sourcepub fn is_body(&self) -> bool
pub fn is_body(&self) -> bool
Whether this is a body component: a nose cone, body tube or transition.
Sourcepub fn is_external(&self) -> bool
pub fn is_external(&self) -> bool
Whether this attaches to the outside of a body tube: fins, tube fins, lugs, rail buttons, pods.
Sourcepub fn length_m(&self) -> f64
pub fn length_m(&self) -> f64
The axial extent used to place the part, m: a body component’s length without shoulders, a
fin set’s root chord, a row of lugs or buttons from the first one’s forward end to the last
one’s aft end, and a packed part’s packed length. A pod set’s extent is its pods’ body
components, which the part alone doesn’t hold, so here it is 0: see
Component::length_m.
Sourcepub fn packing(&self) -> Option<&Packing>
pub fn packing(&self) -> Option<&Packing>
How a mass object or recovery part is packed, or None for a part that is not packed.
Sourcepub fn fore_radius_m(&self) -> Option<f64>
pub fn fore_radius_m(&self) -> Option<f64>
A body component’s outer radius at its forward end, m (zero at a nose tip).
Sourcepub fn aft_radius_m(&self) -> Option<f64>
pub fn aft_radius_m(&self) -> Option<f64>
A body component’s outer radius at its aft end, m.
Sourcepub fn max_radius_m(&self) -> Result<Option<f64>, DesignError>
pub fn max_radius_m(&self) -> Result<Option<f64>, DesignError>
A body component’s largest outer radius anywhere along it, m.
§Errors
Profile errors for a nose cone or transition.
Sourcepub fn inner_radius_m(&self) -> Option<f64>
pub fn inner_radius_m(&self) -> Option<f64>
The inside radius of a body tube or inner tube, m: where internal parts fit.
Sourcepub fn axis_offset_m(&self) -> [f64; 2]
pub fn axis_offset_m(&self) -> [f64; 2]
Where the part’s own axis crosses the x–y plane, [x, y] in body axes, m: an inner
tube’s or packed part’s radial offset turned by its angle, and the body axis for every
other part.
Sourcepub fn outer_radius_about_axis_m(&self) -> Option<f64>
pub fn outer_radius_about_axis_m(&self) -> Option<f64>
An internal part’s outer radius about its own axis, m: an inner tube’s or ring’s outer radius, or a packed part’s packed radius.
Sourcepub fn reach_from_m(&self, axis: [f64; 2]) -> Option<f64>
pub fn reach_from_m(&self, axis: [f64; 2]) -> Option<f64>
How far an internal part reaches from axis ([x, y] in body axes, m): the distance
between the two axes plus the part’s outer radius, for the farthest tube of a cluster.
Sourcepub fn mass_properties(
&self,
body_radius_m: Option<f64>,
) -> Result<MassProperties, DesignError>
pub fn mass_properties( &self, body_radius_m: Option<f64>, ) -> Result<MassProperties, DesignError>
Mass properties in the part’s own frame. External attachments need the radius of the body they sit on.
§Errors
The part’s own geometry, material and numerical errors, and DesignError::Geometry when
an external attachment has no body radius.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Part
impl<'de> Deserialize<'de> for Part
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 Part
impl JsonSchema for Part
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