peterdsharpe / AeroSandbox

Aircraft design optimization made fast through computational graph transformations (e.g., automatic differentiation). Composable analysis tools for aerodynamics, propulsion, structures, trajectory design, and much more.
https://peterdsharpe.github.io/AeroSandbox/
MIT License
741 stars 119 forks source link

Airplane not considering Wing>xsecs>Airfoil: name or coordinates for draw() #35

Closed andresakle closed 4 years ago

andresakle commented 4 years ago

When drawing a simple Wing with only two xsecs and each with airfoil=Airfoil(name="naca0099") the image is does not respect the airfoil.

To Reproduce

import copy
from aerosandbox import *

airplane = Airplane(
    name="Test1",
    x_ref=0,  # CG location
    y_ref=0,  # CG location
    z_ref=0,  # CG location
    wings=[
        Wing(
            name="Main Wing",
            x_le=0,  # Coordinates of the wing's leading edge
            y_le=0,  # Coordinates of the wing's leading edge
            z_le=0,  # Coordinates of the wing's leading edge
            symmetric=True,
            xsecs=[  # The wing's cross ("X") sections
                WingXSec(  # Root
                    x_le=0,  # Coordinates of the XSec's leading edge, relative to the wing's leading edge.
                    y_le=0,  # Coordinates of the XSec's leading edge, relative to the wing's leading edge.
                    z_le=0,  # Coordinates of the XSec's leading edge, relative to the wing's leading edge.
                    chord=0.1,
                    twist=0,  # degrees
                    airfoil=Airfoil(name="naca0099"),
                ),
                WingXSec(  # Mid
                    x_le=0.0,
                    y_le=0.2,
                    z_le=0,
                    chord=0.1,
                    twist=0,
                    airfoil=Airfoil(name="naca0099"),
                )
            ]
        )
    ]
)

# Create solved object
ap = copy.deepcopy(airplane)
ap.draw()

Expected behavior Image with a Cross Section corresponding to NACA0099:

Screen Shot 2020-06-14 at 19 01 06

Result not desired

Screen Shot 2020-06-14 at 19 15 17 Screen Shot 2020-06-14 at 19 15 49

Platform (untested elsewhere)

Other Info Tried using coordinate from .dat file for foil without success.

peterdsharpe commented 4 years ago

Hi @andresakle,

Thanks for writing in! This is not exactly a bug per say (as it is working as intended for the time being), but it is a missing feature. Your proposal to draw the full 3D airplane geometry (including airfoils) is a great idea - unfortunately, I haven't gotten around to implementing it yet! Hopefully I'll have time to look at this soon (PRs always welcome too)!

Best, Peter