pub struct Layout {
pub components: Vec<PlacedComponent>,
pub stages: Vec<PlacedStage>,
pub length_m: f64,
pub reference_diameter_m: f64,
pub structure: MassProperties,
}Expand description
A design resolved into placed parts, with its structural mass properties (no motors).
Fields§
§components: Vec<PlacedComponent>Every component, depth first: each body component followed by its attached parts.
stages: Vec<PlacedStage>The stages, forward to aft.
length_m: f64Length from the nose tip to the aft end of the airframe’s last body component, m. Pods that run past it don’t count.
reference_diameter_m: f64Reference diameter, m.
structure: MassPropertiesEvery stage together, without motors.
Implementations§
Source§impl Layout
impl Layout
Sourcepub fn place_motors(
&self,
configuration: &Configuration,
) -> Result<Vec<PlacedMotor>, DesignError>
pub fn place_motors( &self, configuration: &Configuration, ) -> Result<Vec<PlacedMotor>, DesignError>
Places configuration’s motors in their mounts in this layout.
§Errors
DesignError::UnknownIdfor a mount that doesn’t exist.DesignError::Treefor a mount that isn’t a motor mount, or two motors in one mount.DesignError::InComponent(with the mount’s id) wrappingDesignError::Domainfor a non-positive or non-finite motor diameter or length, or a non-finite overhang, or an ignition time or delay that is negative or not finite.DesignError::Treefor an ignition by the burnout of a mount with no motor in this configuration, or by a chain of burnouts that comes back to the motor itself.DesignError::InComponent(with the mount’s id) wrappingDesignError::Domainfor a failed tube the mount doesn’t have, or one named twice, or a cluster offset that is not finite.
Source§impl Layout
impl Layout
Sourcepub fn find(&self, id: &str) -> Option<(usize, &PlacedComponent)>
pub fn find(&self, id: &str) -> Option<(usize, &PlacedComponent)>
The component with id id, and its index.
Sourcepub fn body(&self) -> impl Iterator<Item = &PlacedComponent>
pub fn body(&self) -> impl Iterator<Item = &PlacedComponent>
The airframe’s body components, forward to aft: not a pod’s.
Sourcepub fn pod_set_of(&self, index: usize) -> Option<usize>
pub fn pod_set_of(&self, index: usize) -> Option<usize>
The index of the pod set that component index is in, if any: the nearest pod set among
its parents, never the component itself. The walk takes at most one step per component,
so a layout whose parents loop, which Layout’s own builder never makes, ends it.
Sourcepub fn motor_pod_sets(&self) -> Vec<usize>
pub fn motor_pod_sets(&self) -> Vec<usize>
The pod sets that hold a motor mount, as Self::pod_set_of finds a mount’s, each once, in
the order their first mount comes in the layout. A motor’s place in this list says which
pod set’s bases take its area under power.
Sourcepub fn reference_area_m2(&self) -> f64
pub fn reference_area_m2(&self) -> f64
Reference area π d²/4, m².