fixed spar/strut alignment for the center case
This commit is contained in:
parent
2cb467d6a3
commit
22b3ff0b7f
1 changed files with 4 additions and 5 deletions
|
@ -184,7 +184,7 @@ fn wing(wing_airfoil: &SeligFile, wing_config: &WingConfig, spar: SparType) -> (
|
||||||
// TODO: taper
|
// TODO: taper
|
||||||
let mut mid_spar = scad!(Hull);
|
let mut mid_spar = scad!(Hull);
|
||||||
let bottom = centered_cube(vec3(wing_config.chord * (MIDSPAR_RANGE.end - MIDSPAR_RANGE.start) , CARDBOARD_WIDTH, CARDBOARD_WIDTH), (false, false, true));
|
let bottom = centered_cube(vec3(wing_config.chord * (MIDSPAR_RANGE.end - MIDSPAR_RANGE.start) , CARDBOARD_WIDTH, CARDBOARD_WIDTH), (false, false, true));
|
||||||
let mut top = scad!(Translate(vec3(0.0, wing_config.length - CARDBOARD_WIDTH, 0.0)));
|
let mut top = scad!(Translate(vec3(wing_config.taper * MIDSPAR_RANGE.start * wing_config.chord - MIDSPAR_RANGE.start * wing_config.chord, wing_config.length, 0.0)));
|
||||||
top.add_child(scad!(Scale(vec3(wing_config.taper, 1.0, 1.0)); bottom.clone()));
|
top.add_child(scad!(Scale(vec3(wing_config.taper, 1.0, 1.0)); bottom.clone()));
|
||||||
mid_spar.add_child(top);
|
mid_spar.add_child(top);
|
||||||
mid_spar.add_child(bottom);
|
mid_spar.add_child(bottom);
|
||||||
|
@ -241,17 +241,16 @@ fn strut(airfoil: &SeligFile, chord: f32, width: f32, spar: &SparType) -> Constr
|
||||||
|
|
||||||
let extrude = LinExtrudeParams {
|
let extrude = LinExtrudeParams {
|
||||||
height: width,
|
height: width,
|
||||||
center: true,
|
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
|
|
||||||
let unit: Vector3<f32> = Vector3::new(1.0, 1.0, 1.0);
|
let unit: Vector3<f32> = Vector3::new(1.0, 1.0, 1.0);
|
||||||
let scaled = scad!(Scale(unit * chord); shape);
|
let scaled = scad!(Scale(unit * chord); shape);
|
||||||
parts.push(scaled.clone());
|
parts.push(scaled.clone());
|
||||||
let strut = scad!(LinearExtrude(extrude); scaled);
|
let mut strut = scad!(LinearExtrude(extrude); scaled);
|
||||||
let rotated = scad!(Rotate(90.0, vec3(1.0, 0.0, 0.0)); strut);
|
strut = scad!(Rotate(-90.0, vec3(1.0, 0.0, 0.0)); strut);
|
||||||
Construct {
|
Construct {
|
||||||
visualization: rotated,
|
visualization: strut,
|
||||||
parts,
|
parts,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue