Skip to main content

RailButton

Struct RailButton 

Source
pub struct RailButton {
    pub outer_diameter_m: f64,
    pub inner_diameter_m: f64,
    pub height_m: f64,
    pub base_height_m: f64,
    pub flange_height_m: f64,
    pub screw_height_m: f64,
    pub angle_rad: f64,
    pub count: u32,
    pub spacing_m: f64,
    pub material: Material,
}
Expand description

A rail button: a base disc on the airframe, a narrower waist, and a flange that rides in the rail, stacked outward along a radial line, with the screw’s dome head on top of the flange.

Fields§

§outer_diameter_m: f64

Diameter of the base and the flange, m.

§inner_diameter_m: f64

Diameter of the waist, m.

§height_m: f64

Total height above the airframe, m.

§base_height_m: f64

Height of the base, m.

§flange_height_m: f64

Height of the flange, m.

§screw_height_m: f64

Height of the screw’s head above the flange, m: a dome, half an ellipsoid as wide as the button, its mass in the button’s (0 for none). It has no drag of its own, as OpenRocket 24.12 gives it none (ADR-168).

§angle_rad: f64

Roll angle from x_B toward y_B, rad.

§count: u32

Number of buttons in a row, 1 to 64 (MAX_INSTANCES).

§spacing_m: f64

Axial distance between the forward edges of consecutive buttons, m.

§material: Material

Material (bulk).

Implementations§

Source§

impl RailButton

Source

pub fn mass_properties( &self, body_radius_m: f64, ) -> Result<MassProperties, DesignError>

Mass properties in the button’s frame (origin on the body axis at the button’s forward edge), on a body of radius body_radius_m. Each disc is a solid cylinder whose axis points outward. The screw’s head is half a solid ellipsoid of revolution on the flange, of the button’s outer radius a and the screw’s height h along its axis: volume 2/3 π a² h, its center of mass 3h/8 above its base, its moment of inertia 2/5 m a² about its axis and m (a²/5 + 19 h²/320) across it through its center of mass (half the ellipsoid’s m (a² + h²)/5 about its base’s diameter, moved by the parallel-axis theorem). OpenRocket 24.12 has the same volume, measured to 2e-16, and puts the head’s center 4h/3π above the flange, 0.049 h further out (ADR-168).

§Errors

Geometry and material errors, including a base and flange taller than the button or a waist wider than the flange.

Trait Implementations§

Source§

impl Clone for RailButton

Source§

fn clone(&self) -> RailButton

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 RailButton

Source§

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

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

impl<'de> Deserialize<'de> for RailButton

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 RailButton

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 RailButton

Source§

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

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 RailButton

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.