50 lines
1.5 KiB
Rust
50 lines
1.5 KiB
Rust
use std::ops::Range;
|
|
|
|
use crate::WingConfig;
|
|
|
|
/// Constants
|
|
/// the native unit is mm
|
|
|
|
const IN2MM: f32 = 25.4;
|
|
pub const CHORD: f32 = 7.0 * IN2MM;
|
|
pub const WING_TAPER: f32 = 0.6;
|
|
pub const WINGSPAN: f32 = 33.0 * IN2MM;
|
|
pub const LENGTH: f32 = 30.0 * IN2MM;
|
|
/// strut count in the main wing
|
|
pub const STRUTS: usize = 12;
|
|
pub const WING: WingConfig = WingConfig {
|
|
length: WINGSPAN / 2.0,
|
|
chord: CHORD,
|
|
taper: WING_TAPER,
|
|
struts: STRUTS / 2,
|
|
};
|
|
pub const CARDBOARD_WIDTH: f32 = 3.5;
|
|
/// length of each side of the triangular spar
|
|
pub const SPAR_SIDE_WIDTH: f32 = 0.75 * IN2MM;
|
|
pub const FUSELAGE_GAP: f32 = 0.4 * IN2MM;
|
|
/// a very large number, used to place unknown objects such that they do not intersect
|
|
pub const INF: f32 = 1000.0;
|
|
pub const RUDDER_HEIGHT: f32 = 4.0 * IN2MM;
|
|
pub const RUDDER_CHORD: f32 = 4.0 * IN2MM;
|
|
pub const RUDDER_TAPER: f32 = 0.9;
|
|
pub const RUDDER_STRUTS: usize = 3;
|
|
pub const RUDDER: WingConfig = WingConfig {
|
|
length: RUDDER_HEIGHT,
|
|
chord: RUDDER_CHORD,
|
|
taper: RUDDER_TAPER,
|
|
struts: RUDDER_STRUTS,
|
|
};
|
|
pub const ELEVATOR_HEIGHT: f32 = 4.0 * IN2MM;
|
|
pub const ELEVATOR_CHORD: f32 = 5.0 * IN2MM;
|
|
pub const ELEVATOR_TAPER: f32 = 0.7;
|
|
pub const ELEVATOR_STRUTS: usize = 4;
|
|
pub const ELEVATOR: WingConfig = WingConfig {
|
|
length: ELEVATOR_HEIGHT,
|
|
chord: ELEVATOR_CHORD,
|
|
taper: ELEVATOR_TAPER,
|
|
struts: ELEVATOR_STRUTS,
|
|
};
|
|
pub const TOPSPAR_RANGE: Range<f32> = 0.1..0.6;
|
|
pub const MIDSPAR_RANGE: Range<f32> = 0.1..0.4;
|
|
pub const STOCK_HEIGHT: f32 = 25.0 * IN2MM;
|
|
pub const STOCK_WIDTH: f32 = 37.0 * IN2MM;
|