Skip to main content

Wingwalker Python Module

This Python module provides core functions and scripts to create useful airfoil models and files from engineering specifications. These base models can then be used to create useful designs and implementations (VR and 3D models, 3D printer components, etc).

Philosophy

Wing selection and design can be very complex. From the choice of starting airfoil specs (custom or existing), to cost analysis, and finally to construction, the spectrum of both choices and pitfalls at each stage can become overwhelming pretty quickly, especially to someone whose primary interest is what comes after the wings are bolted on.

The goal behind this software is very straightforward: To give everyone, from the basic hobbyist to the serious (semi)professional, the ability to go quickly from theory and specs to design to real- or virtual-world production of airfoils and wings.

Wingwalker is modeled to make the process from airfoil selection to printable model as simple and straightforward as possible. For most use cases, the simplest approach, demonstrated in the examples, should be sufficient. Those with more strict or customized requirements still have access to the underlying steps, and can build up a more detailed workflow, in accordance with their needs.

Installation

$ pip install wingwalker

Usage

The following code snippet shows how to take various inputs, create a WingRequest, pass that to the module functions, and then display and export the resulting wing point cloud.

from pyvista import PolyData, Plotter
from wingwalker.models.wing_model import WingModel, WingRequest
from wingwalker.generators.wing import generate_wing_model, generate_point_cloud_polydata
from wingwalker.io.exports import export_ply


def plot_results(model: WingModel, points: PolyData):
    title = f'Point Cloud\n\n{model.wing_params.wing_type}\n{model.wing_params.planform.name}'
    pl = Plotter(shape=(1, 1))
    pl.add_title(title, color='grey')
    pl.background_color = 'black'
    point_view = pl.add_mesh(
        mesh=points,
        style='points',
        line_width=0.1,
        point_size=1.5,
        color='yellow',
        opacity=0.7
    )
    pl.show()


def main(planform, wing_type, span, base, end, twist, specfile, spec_format, iterations):
    req: WingRequest = WingRequest()
    req.planform = planform
    req.wing_type = wing_type
    req.span = span
    req.base_chord = base
    req.end_chord = end
    req.twist = twist
    req.spec_file = specfile
    req.spec_format = spec_format
    req.iterations = iterations

    print()

    # Generate and preview a point cloud for the model
    model = generate_wing_model(wing_req=req)
    p_cloud: PolyData = generate_point_cloud_polydata(model)
    plot_results(model, p_cloud)

    # Export the model to PLY format
    export_name = f'wing_{wing_type}_{planform}.ply'
    export_ply(model, export_name)

Generating STL files

The process too generate an STL file for processing or sending to a 3D printer is very simple. This script shows the entire process.

The requirements for the wing STL file are stored in elliptical_left_wing_256mm.json. This python script parses the request, parses the designated airfoil specs, and then steps through the process to generate an elliptical wing of the given dimensions.

import os

from wingwalker.build_params.wing_request import WingRequest
from wingwalker.generators.wing import get_airfoil_specs, get_lambdas, generate_wing
from wingwalker.io.exports import export_stl

config_file = 'elliptical_left_wing_256mm.json'

# Read the values from the file
wing_req: WingRequest
with open(config_file, 'r', encoding='utf-8') as fin:
    json_str = fin.read()
    wing_req = WingRequest.from_json(json_str)

# Retrieve the specs from the request path
af_specs = get_airfoil_specs(wing_req)

# Get lambdas (dimension functions for the given parameters)
c_func, t_func, z_func, area_func = get_lambdas(wing_req)

# Generate the actual wing model
model = generate_wing(wing_req, af_specs, c_func, t_func, z_func, area_func)

f_name = f'{wing_req.name}_geometric_wing.stl'
if os.path.exists(f_name):
    os.remove(f_name)

export_stl(model, f_name)

print('Aircraft wing STL file generated.')

print(model.__repr__())

License

This software is distributed freely under the MIT license. You are free to use, abuse, modify, or ridicule the software, its products, and its processes in any way you see fit.

Output generated by the original software is published under the Create Commons license, and may also be used for any purpose, commercial or not. Users of this software may freely apply or replace the CC license with their own license or restrictions, as they desire.

Credits

wingwalker was created with cookiecutter and the py-pkgs-cookiecutter template.

Metadata

Release files for wingwalker 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wingwalker 1.1.0
File Size Uploaded
wingwalker-1.1.0.tar.gz 154.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wingwalker 1.1.0
File Interpreter ABI Platform
wingwalker-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 189.6 kB

Release files / wingwalker-1.1.0.tar.gz

Download URL wingwalker-1.1.0.tar.gz
Size 154.4 kB
Tags Source
SHA-256 checksum
How to use checksums
664b24a9abfb530e0dc2740b56f7e6afb43dcee413564d7f61a2616045cbffde
BLAKE2b-256 checksum
How to use checksums
1fa32302feefd9d6aef2f64e0b3e9405433967e245443c3d165b619891fe3b85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / wingwalker-1.1.0-py3-none-any.whl

Download URL wingwalker-1.1.0-py3-none-any.whl
Size 35.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3104de4baf75886761bccdb9abfe6f516c8b9b54bb1f3a024218e639cf624daf
BLAKE2b-256 checksum
How to use checksums
26700e6f4413d3db998de55886cdcc9f161e7779519066463256a1bfc1ffaf31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release files

0.9.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page