Enum structural_shapes::StructuralShape[][src]

#[non_exhaustive]
pub enum StructuralShape {
    Pipe {
        outer_radius: Length,
        thickness: Length,
        center_of_gravity: (Length, Length),
    },
    IBeam {
        width: Length,
        height: Length,
        web_thickness: Length,
        flange_thickness: Length,
        center_of_gravity: (Length, Length),
    },
    BoxBeam {
        width: Length,
        height: Length,
        thickness: Length,
        center_of_gravity: (Length, Length),
    },
    Rod {
        radius: Length,
        center_of_gravity: (Length, Length),
    },
    Rectangle {
        width: Length,
        height: Length,
        center_of_gravity: (Length, Length),
    },
}
Expand description

This enum contains different structural shapes

Variants (Non-exhaustive)

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.

Pipe

Fields

outer_radius: Length

Outer radius of hte pipe

thickness: Length

Thickness of the pipe wall

center_of_gravity: (Length, Length)

Coordinates of center of gravity

This is a pipe with an outer_radius and a thickness

IBeam

Fields

width: Length

Width of the beam

height: Length

Height of the beam

web_thickness: Length

Thickness of the web

flange_thickness: Length

Thickness of the flange

center_of_gravity: (Length, Length)

Coordinates of center of gravity

This is an I-Beam, with a width, height, web thickness, and flange thickness

BoxBeam

Fields

width: Length

Width of the box beam

height: Length

Height of the box beam

thickness: Length

Thickness of the wall

center_of_gravity: (Length, Length)

Coordinates of center of gravity

This is a box beam with a width, height, and thickness

Rod

Fields

radius: Length

Radius of the road

center_of_gravity: (Length, Length)

Coordinates of center of gravity

This is a rod with a radius only

Rectangle

Fields

width: Length

Width of the rectangle

height: Length

Height of the rectangle

center_of_gravity: (Length, Length)

Coordinates of center of gravity

This is a solid rectangular with width and height

Implementations

This function returns the moment of inertia of the structural shape around the x-axis

let shape = StructuralShape::Rod{radius: length(2.0), center_of_gravity: point(0.0, 0.0)};
let moi = shape.moi_x();

This function returns the moment of inertia of hte structural shape around the y-axis

let shape = StructuralShape::Rod{radius: length(2.0), center_of_gravity: point(0.0, 0.0)};
let area = shape.moi_y();

This function returns the cross-sectional area of the structural shape

let shape = StructuralShape::Rod{radius: length(2.0), center_of_gravity: point(0.0, 0.0)};
let area = shape.area();

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.