What's new
Aloft Forums

Welcome to Aloft Forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

New App: BezierAirfoilDesigner

Marc Frank

New User
I thought I should post this here, too.
It's on RC Groups and RC Network already.


BezierAirfoilDesigner

https://github.com/Marc-Frank/BezierAirfoilDesigner
An Open-Source-App for converting airfoil coordinates into Bézier curves.


Which problem is the app supposed to solve?

Anyone who has tried to model a plane in CAD knows the problem of importing airfoils.
First, you have to find a way to input the coordinates into the software. Once you have solved that, you need to convert the points into a curve, usually a spline is used to connect all the points.
If you want to model the upper and lower surfaces of the wing separately, you have to split the curve into upper and lower parts. This often creates a small discontinuity at the leading edge, the more coordinates you have, the smaller this tip becomes.
You also need to consider how many coordinates the profile should have. Too few, and the deviation from the original becomes too large; too many, and the profile becomes overdefined, causing issues in further design steps.
Even if you have found a good process, the spline curve is never completely smooth, and there are always small waves. These waves are then transferred to the final surfaces as well.

1693854797999.png


If you also want to set a specific trailing edge thickness, you have to adjust all the coordinates or rotate them around the leading edge. Overall, the process is not very straightforward, and in my opinion, the results could be improved.


What does the BezierAirfoilDesigner do?

The BezierAirfoilDesigner allows you to import regular .dat airfoil coordinates into the program.
Then, you can either manually, automatically, or through a combination of both,
fit two Bézier curves to the loaded airfoil – one for the upper and one for the lower surface.

1693854771759.png


1693854763917.png


To do this, you can move the control points either using the mouse or enter coordinates directly into the corresponding table. Under the "search" function, a recursive algorithm can be used to try out different positions for the control points to reduce the error (difference from the reference airfoil). The "Search Top" and "Search Bottom" functions continue searching for new points until the improvement is under 5%.

Initially, three other positions per control point are tested. If there is no better position found, the number of tested points within the same "search radius" (only vertical) is increased by 1.

With "auto search," the degree of the curves is increased by 1 (adding a control point) after each search process for the upper and lower curves, without altering the shape of the curve. This process is repeated until the error is under 0.075.

Depending on the quality and complexity of the reference airfoil, the automatic adjustment can take between 10 minutes and 3 hours. For very poor-quality profiles, the termination condition might never be reached, in which case there is a stop button to abort the current search.


When the search is completed...

...you can export the control points as .bez.dat files.
These files have the same structure as normal .dat files, and thanks to the same file extension, you can import them into CAD software just like normal .dat files. The curves can then be drawn using a "control point spline" (in Fusion 360 or similar curve types in other software).

Currently, there is a limit of 6 control points when implementing Bézier curves using the "control point spline" in Fusion 360 (there is a workaround to use up to 10 control points). With more control points, the curves no longer match. I'm not sure if this is a bug in Fusion 360 or related to the curve type they are using. I have already addressed this issue, so there might be changes in the future.

Solidworks and Onshape have no problem drawing the correct curves.
Rhino7 can do up to degree 11.


Results in CAD:

The airfoils drawn from the control points are already divided into upper and lower surfaces by default, so you don't need to do this separately. The curvature distribution no longer shows waves on the surface.

1693854729596.png


You can easily set the trailing edge thickness by adding another dimension.

1693854719053.png


Another use case

The program can be used not only to simplify and improve processes in CAD but also to smooth existing profiles, potentially improving the performance of the airfoil.
The resulting coordinates are naturally spaced based on the curvature. Using a continous bezier curve creates a very smooth curve, without waves or bumps, such as a simple spline interpolation would do.
This also leads to very nice velocity distributions.


Before:

1693855422367.png


After:

1693855515930.png


Polars are similar, maybe a tiny bit better.

1693854695056.png


Miscellaneous

In addition to the .bez.dat format, you can also save the control points as .bez files. This allows the representation of shapes where the beginning and end of the curves are not identical and do not lie between 0 and 1. This might be useful for creating wing outlines.

Furthermore, you can export the coordinates of the Bézier curves as .dat files. However, it is essential to consider the program in which you want to use the profiles further. The Profile Editor by Frank Ranis accepts a maximum of 450 points, and xflr5 has a limit of 300 points.

If it's crucial that all points on both curves have the same X-coordinates, you should ensure that all control points have the same X-coordinates as well.


Installation

For Windows, simply download the appropriate .exe file from GitHub under Releases.

Before version v0.9, I selected "Framework-dependent" in the release settings. If you want to try earlier versions, you'll need to download .NET 7 as well.

The app was created in Visual Studio as a Winforms project using C#.
I'm not sure if it runs under Linux with Wine as it hasn't worked in previous tests.
However, it runs in a VM under MacOS.




I would appreciate feedback and suggestions for further functionality.
Bugs in the program and minor feature requests can be reported under Issues.
If you want to fix them yourself, you can create a Pull request.

Best regards,
Marc
 
Last edited:
In the newest release I have implemented Particle Swarm Optimization and dxf export for up to degree 10 curves.
I also made a few other options adjustable.


Now in version v0.9.6 using the Particle Swarm Optimization fitting the Bezier curve to the reference airfoil should only take about 5 minutes and achieves even better error values than the simple search, which could take a few hours.

I moved the error calculation from summing up all individual error values to calculating the average of them.
That allows the number of station at which the distance between bezier curve and reference is calculated to be reduced with out drasically changing the error value.
This also means that the calculated error is about 1/1000s of the one before (in v0.9.4).
A good fitting curve can now easily be recognised by the x.xxE-5 exponent, or even lower.

The PSO can be drastically accelerated by setting the number of stations for camber and thickness to 1 and for the error to between 20 and 100, down from 1000. Additionally you can disable the UI update.
That brings down the time for a good fit to about a minute.

Be careful when choosing the degree of the bezier curve. If it is too high, some control points may bunch up very close to one another. In that case the degree should be reduced.

I was a bit surprised myself, that a very good fit for the AG25 can be achieved with just 4 control points for the top curve and 5 for the bottom curve.

1693861917173.png
 
Last edited:
Woohoo - good one, Marc. I'm going to have to try it. What VM do you recommend for Mac use?

What would be a good setup? I'm not much of a comuter expert I'm afraid.

Cheers,

Doc.
 
Hi Doc, thanks :)

I've been recommended to recommend either Bootcamp or Virtualbox.

I'm not too well versed on this matter, as I use a Windows PC. And that would be the easiest option to run the program on.

There shouldn't be any special hardware requirements as the program is not very demanding.

Greetings,
Marc
 
Hi Doc, thanks :)

I've been recommended to recommend either Bootcamp or Virtualbox.

I'm not too well versed on this matter, as I use a Windows PC. And that would be the easiest option to run the program on.

There shouldn't be any special hardware requirements as the program is not very demanding.

Greetings,
Marc
Great - next question - how to download the programme?

Sorry to be such a dummy.


Thanks!

Doc.
 
Last edited:
In the last chapter of the first post, there is a little link to the GitHub Releases page.

There are three .exe file for the different processor architectures.
One for ARM PCs, one for x64 and one for x86.

I can run both x64 and x86 on my PC.
If you have a 64bit PC, either should be fine.
I tend to use the x64 version.
 
In the last chapter of the first post, there is a little link to the GitHub Releases page.

There are three .exe file for the different processor architectures.
One for ARM PCs, one for x64 and one for x86.

I can run both x64 and x86 on my PC.
If you have a 64bit PC, either should be fine.
I tend to use the x64 version.
Macbook Pro?

Doc.
 
There is no direct App file for MacOS as this is not supported by the programming language and compiler I am using.

Here are guides for installing Virtualbox and a Windows Operating System within Virtualbox.


 
Did you get it to run?
No, boot camp or VB always hangs up at "cant partition disc" and I tried all the solutions on the net.

No dice unfortuntely which is a pity beause your programme looks like a really useful one, and I'm just starting to do a bit of work on a new airframe now.

Nevermind.

Thanks for the post though - excellent work!.

Cheers,

Doc.
 
Here is what ChatGPT says 😅

1. Boot Camp (for macOS):​

  1. Disk Utility: Before running Boot Camp, open Disk Utility and check the disk for errors. If there are any errors, Disk Utility might be able to fix them for you.
  2. Free Space: Ensure you have enough free space on your macOS partition to create the Windows partition. It's typically recommended to have at least 50GB of free space for the Windows installation.
  3. FileVault: If FileVault is enabled, it might interfere with the partitioning process. You can try temporarily disabling FileVault, running Boot Camp, and then re-enabling FileVault after the installation is complete.
  4. Third-Party Drive Tools: If you've used third-party tools to manage or tweak your drive partitions in the past, this could be causing the issue. You might need to revert any changes made with these tools.
  5. Backup and Restore: If all else fails, backup your data, erase the drive, install macOS, and then try Boot Camp again. This is a drastic measure, but it's often effective.

2. VirtualBox:​

  1. Dynamic Disk: When creating a new virtual machine (VM) in VirtualBox, choose a dynamically allocated disk rather than a fixed-size disk. This often helps prevent partitioning issues.
  2. Disk Space: Ensure you have enough space on your host system to accommodate the virtual hard drive you're trying to create.
  3. Permissions: Ensure that VirtualBox has the necessary permissions to create and modify files in the directory where you're trying to store the virtual machine.
  4. VirtualBox Version: Ensure you're using the latest version of VirtualBox. Older versions might have bugs or compatibility issues that have been resolved in newer releases.


If you have some airfoils you need converted, just send them to me. I'll do it for you :)
 
Last edited:
Here is what ChatGPT says 😅

1. Boot Camp (for macOS):​

  1. Disk Utility: Before running Boot Camp, open Disk Utility and check the disk for errors. If there are any errors, Disk Utility might be able to fix them for you.
  2. Free Space: Ensure you have enough free space on your macOS partition to create the Windows partition. It's typically recommended to have at least 50GB of free space for the Windows installation.
  3. FileVault: If FileVault is enabled, it might interfere with the partitioning process. You can try temporarily disabling FileVault, running Boot Camp, and then re-enabling FileVault after the installation is complete.
  4. Third-Party Drive Tools: If you've used third-party tools to manage or tweak your drive partitions in the past, this could be causing the issue. You might need to revert any changes made with these tools.
  5. Backup and Restore: If all else fails, backup your data, erase the drive, install macOS, and then try Boot Camp again. This is a drastic measure, but it's often effective.

2. VirtualBox:​

  1. Dynamic Disk: When creating a new virtual machine (VM) in VirtualBox, choose a dynamically allocated disk rather than a fixed-size disk. This often helps prevent partitioning issues.
  2. Disk Space: Ensure you have enough space on your host system to accommodate the virtual hard drive you're trying to create.
  3. Permissions: Ensure that VirtualBox has the necessary permissions to create and modify files in the directory where you're trying to store the virtual machine.
  4. VirtualBox Version: Ensure you're using the latest version of VirtualBox. Older versions might have bugs or compatibility issues that have been resolved in newer releases.


If you have some airfoils you need converted, just send them to me. I'll do it for you :)
Wohoo - thanks Marc - I would like to see your programme run some of my stuff. Can you message me your email address?

Many thanks again.

Doc.
 
Hi Aero design dudes - here is one of my aerofoils re-drawn using Marc's Bezier Airfoil Designer and then re-run through XFLR5.

Its quite easy to see the differences, and I think Marc's new programme and Bezier approach might be the best bet so far available for Aerofoil design. The aerofils derived from this programme have a level of smoothing so far unseen in any other app - and with CNC getting more prevalent, this is what we need.

Note that amazingly this programme has isolated a flaw in the orginal leading edge curve which was hitherto unseen.

Try it guys - it doesn't work on Mac yet but on Windows its fine.

Well done and a big thanks to Marc!

Doc.

xflr5_jh817_vs_bezier_all_graphs.png
xflr5_jh817_vs_bezier_graph_1.png
xflr5_jh817_vs_bezier_graph_2.png
xflr5_jh817_vs_bezier_graph_3.png
xflr5_jh817_vs_bezier_graph_4.png
jh817_vs_bezier_le_deviation.png
 

In the newest release I have:

  • edited the default error threshold value
  • added a new icon
  • added a tab control
  • reordered ui elements
  • reintegrated the save form
It now looks like this:

1698442456373.png
 
Been playing with this tonight. Getting my PC skills back in check.

The swarm is pretty neat. Finally found a good DXF format my CAD is happy with. (the third option)

This is the cruddy DAT data I have been dealing with, all of those points made CAD very unhappy. When critical I was hand drawing my own curves.
Screenshot 2025-10-31 at 6.12.50 PM.webp


The app did this for me:
Screenshot 2025-10-31 at 6.12.59 PM.webp

Once I messed around for a while I got these results in a few minutes.

But still have issues with the leading and trailing edges:
Screenshot 2025-10-31 at 6.13.21 PM.webp

Screenshot 2025-10-31 at 6.13.36 PM.webp


Not a big deal since I'm designing balsa planes, but will need to play around a bit more in the app.

Thank you @Marc Frank !
 
I messed around with this some more and think the key is to get things pretty close manually. I find I have to manually move the start and stop points first, then adjust the curves to get them really close, then use the automatic and swarm to clean things up even further. The better you do the clean up manually the quicker the program can get good results. But better double check it, sometimes not so good, depending on how well you defined the curve manually.
 
Back
Top