Hydrofoil Design using Free Software

Part 1: Finding the right tools

Posted by Christian on Jan. 22, 2021 Category: Knowledge

I have recently started a quest to find the best free software for generating complex shapes like hydrofoils. Having a good level of experience in CATIA and AutoCAD under my belt I believe that scripted CAD file generation is the way to go for hydrofoils. It makes the import of airfoil shapes from sources like airfoiltools or the UIUC Airfoil Data Site extremely easy given one has some programming experience, preferably but not necessarily in python. In addition changes in the airfoil shape can be propagated fast and easy compared to the tedious point cloud imports in most of the commercial software out there.

To give you an idea of just how painful a point cloud import in CATIA is have a look at this youtube video. Wouldn't it be much nicer to just download the CSV (comma separated values) file from the above named websites, change 1 line in the code and execute a script to regenerate the whole wing? I think it is!

Because it had come up first in discussions about possible solutions with colleagues the first proof of concept was done with CadQuery. The picture below shows a quick and cheap replica of the Axis 1150 wing generated by a python script.

Hydrofoil front wing designed with CadQuery in python

The code (github) is organized in two files.

  • readPic.py reads the silhouette of the wing from a png file (silhouette.png), interpolates the found data points and provides a function for querying the y-coordinate for the leading edge and the length of a wing segment for a given x-position.

  • main.py holds the CadQuery script for drawing the wing in the cq-editor.

Also included are:

The good thing about CadQuery is that one gets results quickly. But I also had problems, for example the smoothed lofting of several wing profiles. Without the smoothing the transition from one wing profile to the next has a bump (see red arrow). Lofting issue in CadQuery

One way around this issue is to reduce the distance between the wing cross sections similar of how it was done at the wing tips. However, this solution is unsatisfying and slows the generation of the 3D object from code significantly. Another problem I ran into was to import the outline/silhouette of the wing into CadQuery. Generating an outline in a sketch in CATIA/AutoCAD with splines, lines and rounding of the corners is very easy, importing these sketches to CadQuery however took quite some work - but the code to do that is there now (readPic.py).

The next goal is to test FreeCAD, a well established CAD software that also allows python-scripted CAD drawing. It should be noted that FreeCAD has a package for the import of airfoil data from the UIUC database.

Once we found the best solution there will be tutorials on how to draw your own wing on this blog. Stay tuned!



Share article on..