From dd90e3128ca51fb1dc346bc64051c357de5cf5de Mon Sep 17 00:00:00 2001 From: Peter Sharpe Date: Wed, 14 Feb 2024 17:21:21 -0500 Subject: [PATCH] Adds option to modify fuselage continuity type --- .../fuselage_vspscript_generator.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/aerosandbox/geometry/openvsp_io/asb_to_openvsp/fuselage_vspscript_generator.py b/aerosandbox/geometry/openvsp_io/asb_to_openvsp/fuselage_vspscript_generator.py index 85ad493c..25445920 100644 --- a/aerosandbox/geometry/openvsp_io/asb_to_openvsp/fuselage_vspscript_generator.py +++ b/aerosandbox/geometry/openvsp_io/asb_to_openvsp/fuselage_vspscript_generator.py @@ -4,7 +4,11 @@ from aerosandbox.geometry.openvsp_io.asb_to_openvsp import _utilities -def generate_fuselage(fuselage: Fuselage, include_main=True) -> str: +def generate_fuselage( + fuselage: Fuselage, + include_main=True, + continuity_type: str = "C2", +) -> str: """ Generates a VSPScript file for a Fuselage object. @@ -55,6 +59,15 @@ def generate_fuselage(fuselage: Fuselage, include_main=True) -> str: # TODO symmetry here script += """//==== Set Fuselage Section Options ====//\n""" + if continuity_type == "C0": + continuity_type_string = "0.0" + elif continuity_type == "C1": + continuity_type_string = "1.0" + elif continuity_type == "C2": + continuity_type_string = "2.0" + else: + raise ValueError("Continuity type must be 'C0', 'C1', or 'C2'.") + for i, xsec in enumerate(fuselage.xsecs): script += f"""\ // ASB Section {i}, VSP Section {i} @@ -67,7 +80,7 @@ def generate_fuselage(fuselage: Fuselage, include_main=True) -> str: SetParmVal( fid, "TopLAngle", "XSec_{i}", 0.0 ); SetParmVal( fid, "TopLStrengthSet", "XSec_{i}", 0.0 ); SetParmVal( fid, "TopLStrength", "XSec_{i}", 0.5 ); -SetParmVal( fid, "ContinuityTop", "XSec_{i}", 2.0 ); +SetParmVal( fid, "ContinuityTop", "XSec_{i}", {continuity_type_string} ); Update(); """