Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdsharpe committed Feb 20, 2024
1 parent 22170ac commit c094300
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ Also, for at least one version before a breaking change, AeroSandbox development

# Latest (master / release), and previous versions

#### 4.2.1

- Added geometry export capabilities to OpenVSP using the *.vspscript interface. Accessible via `asb.Airplane.export_OpenVSP_vspscript(filename="/path/to/my/file.vspscript")`. To import into OpenVSP, use this function to generate a VSPscript file, and then import it via File -> Run Script... in OpenVSP.
- Overhaul of the airfoil database at `aerosandbox.geometry.airfoil.airfoil_database`. This includes the addition of around 500 new high-quality airfoils, the removal of around 15 exceptionally-low-quality airfoils from the UIUC database, the correction of some airfoil coordinates for transcription errors, and fixes for file encodings that caused errors on Linux.

#### 4.2.0

- Fixed I/O error with XFoil. XFoil outputs may have mislabeled columns if both CP and hinge moments are requested. This is a bug in XFoil, but AeroSandbox now detects and corrects for it.
Expand Down
25 changes: 19 additions & 6 deletions aerosandbox/geometry/airplane.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from aerosandbox.geometry.propulsor import Propulsor
from aerosandbox.weights.mass_properties import MassProperties
import copy

from pathlib import Path

class Airplane(AeroSandboxObject):
"""
Expand Down Expand Up @@ -900,7 +900,7 @@ def generate_cadquery_geometry(self,
return solid.clean()

def export_cadquery_geometry(self,
filename: str,
filename: Union[Path, str],
minimum_airfoil_TE_thickness: float = 0.001
) -> None:
"""
Expand Down Expand Up @@ -961,15 +961,16 @@ def export_XFLR(self, *args, **kwargs) -> str:
return self.export_XFLR5_xml(*args, **kwargs)

def export_XFLR5_xml(self,
filename,
filename: Union[Path, str],
mass_props: MassProperties = None,
include_fuselages: bool = False,
mainwing: Wing = None,
elevator: Wing = None,
fin: Wing = None,
) -> str:
"""
Exports the airplane geometry to an XFLR5 `.xml` file.
Exports the airplane geometry to an XFLR5 `.xml` file. To import the `.xml` file into XFLR5, go to File ->
Import -> Import from XML.
Args:
filename: The filename to export to. Should include the ".xml" extension.
Expand Down Expand Up @@ -1271,8 +1272,19 @@ def indent(elem, level=0):
return xml_string

def export_OpenVSP_vspscript(self,
filename,
):
filename: Union[Path, str],
) -> str:
"""
Exports the airplane geometry to a `*.vspscript` file compatible with OpenVSP. To import the `.vspscript`
file into OpenVSP:
Open OpenVSP, then File -> Run Script -> Select the `.vspscript` file.
Args:
filename: The filename to export to, given as a string or Path. Should include the ".vspscript" extension.
Returns: A string of the file contents, and also saves the file to the specified filename
"""
from aerosandbox.geometry.openvsp_io.asb_to_openvsp.airplane_vspscript_generator import generate_airplane

vspscript_code = generate_airplane(self)
Expand All @@ -1282,6 +1294,7 @@ def export_OpenVSP_vspscript(self,

return vspscript_code


if __name__ == '__main__':
import aerosandbox as asb
# import aerosandbox.numpy as np
Expand Down

0 comments on commit c094300

Please sign in to comment.