Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape, CAD, maker project and design.

First time visiting? Here are some places to start:

  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

Aerofoil Profile Scripts

darren_13darren_13 Member, Developers Posts: 103 EDU
edited October 2016 in FeatureScript
Hi everyone,

I have created two scripts for the rapid generation of aerofoil profiles in OnShape, I have been using my first script for quite a while and seems to work well for me and thought it was about time I shared it with others.

There are two scripts available In the public document 'Aerofoil Script':
  2. Profile Generator
Both of these work in a very simple way:
  1. Select/Define Profile
  2. Select plane for normal
  3. Select Leading and Trailing points (Preferably on selected plane)
  4. Ok, your done

Selecting the leading and trailing points does two things, its defines aerofoil orientation and also cord length.

NACA XXXX allows the user to define a four digit aerofoil, I could have imported CSV's and generated from these however thats a lot of files. Therefore this script calculates the profile based upon parameters, however unconventionally allows non integer numbers thus expanding use of the 4 digit system.

Profile Generator requires each profile required to be uploaded in the script, obviously I haven't the time to upload every single script. I have uploaded 3, 1 customs 2 from an aerofoil data base to test robustness. I propose that any profiles you require list them in the comments bellow and I will add them ASAP, this means the database will expand where required. It would also be handy to link the profile .dat file in 'selig' style unless it is easy to find, here is a link to the best resource in my opinion:


Below are a few picture that show the scripts in use, I look forward to aerofoil profile requests and allow I am open to Ideas on how to expand existing capability. 

Kind regards,
Darren Lynch

An early wind turbine blade, using NACA XXXX and the public 3D spline script.

A wing with winglet, also using NACA XXXX and the 3D spline script.


  • duane_1duane_1 Member Posts: 16
    Hi Darren,

    Here are few foils used in wind turbines I've been working: 

    S820, S822
    SG6042, SG6041, SG6040
    SG6050, SG6051
    GOE222, GOE601
    S4310, S4320

    I'll have to play with the 3D spline script, looks like it made a nice bend around the winglet.

    BTW: When I look at your shared example, it is not functional for me.



  • darren_13darren_13 Member, Developers Posts: 103 EDU
    edited November 2016
    Hi Duane, 

    Thank you for your comment! I have hopefully sorted this out now so the example should be working. 

    I have added the profiles you were after however I should have mentioned that this script doest work well with open profiles therefore two of your profiles currently plot a curve without a selectable face, I'll start thinking about a fix for this.

    Kind regards,
  • duane_1duane_1 Member Posts: 16
    Hello Darren,

    Did a quick look, and was able to use the scripts.   Adding the flip option on the NACA generator will be useful as well.

    For some ideas take a look at Qblade.



  • darren_13darren_13 Member, Developers Posts: 103 EDU
    Hi Duane, Yes I see what you mean about the flip. I think I used a work around by adding a negative to the camber digit. But ill look at adding flip as its more intuitive.

    Also I'm unable to use Qblade as I'm a mac user, does it model open profiles well? how does it go about it? was thinking I could do one of two things;
    1. Add a line between the two points, basic but gets the job done
    2. add the 1st point as the last point, this will be smoother however there will be a bit of length added.
    Which do you think you would prefure?

    Kind regards,
    Darren Lynch

  • duane_1duane_1 Member Posts: 16
    Hi Darren,

    Yes and it is free.  Qblade has a foil generator and has tools to modify them, or create a foil from scratch.  It works well to compare foils and performance using the basic CFD analysis.

    On the trailing edge, I think adding line between the points will suffice.  The two points are very close together.

    Kind regards,


  • darren_13darren_13 Member, Developers Posts: 103 EDU
    Hi guys just so you know I have now added a multi spline tool which essentially splines and lofts between aerofoils. You can define the accuracy to have up to 1000 splines per edge then loft using these as guides.

    Ill shorty update the documentation and add an application example.

    Kind regards
    Darren Lynch
  • fastwayjimfastwayjim Member, OS Professional, Mentor, Configurations EVP Posts: 215 PRO
    This. Is. Awesome.
  • michael_stallsmichael_stalls Member Posts: 28 PRO
    This looks Great!
  • darren_13darren_13 Member, Developers Posts: 103 EDU
    Thank you for your support guys :) 
  • darren_13darren_13 Member, Developers Posts: 103 EDU
    edited November 2016
    Hi guys, Just so you know I have now documented the Multi Spline feature. I have also updated NACA XXXX to have a default profile of NACA 0012 so that a user can define a plane and LE/TE edges and see what it looks like without needing to input all digits, this is implemented but not documented. I have also add flip into the NACA script as per @duane_1 request. Im looking at closing TE's in the profile generator script next.

    Please use and abuse my scripts and let me know what you think :) 

    Kind regards,
    Darren Lynch

    ps. you will need to update the linked document to see changes, I recommend you do this but leave the already used script's un-updated as the changes may have minor impact.
  • david_fisher031david_fisher031 Member Posts: 23
    edited January 6
    Darren could you please add aerofoil HS522 to your profile generator. I have had a go at modifying my own copy https://cad.onshape.com/documents/58617bcbcec3fd1081e6dda0/w/14c073fff5640d9c20af40b5/e/b5fd615c46ab7c3bd8b3caf9 .

  • darren_13darren_13 Member, Developers Posts: 103 EDU
    Morning @david_fisher031, thanks for providing me a link :smile:  ill get this done asap.
  • darren_13darren_13 Member, Developers Posts: 103 EDU
    edited January 6
    Hi @david_fisher031 HS522 now added. Hope this works ok for you, there is two warnings but you shouldn't receive any errors. any issues please let me know :smiley: Darren
  • _5419_5419 Member Posts: 9
    Hello David, thank you for your excellent work on this custom feature! 
    Could you add the following eppler foil profiles to the profile generator feature?
    Eppler E836

    Eppler E837

    Eppler E838

    The links are the selig format dat files you've requested. 

    Cheers, Anthony
  • darren_13darren_13 Member, Developers Posts: 103 EDU
    Hi @_5419, Glad you like my feature! I have recently done a lot of improvements to this script. The main improvement, however, is adding 1600 aerofoils to the list, this includes the Eppler 836-8 (and much more Eppler foils) does your script look like this:

    If so you should be able to find it in the list, I realise at the moment it is a mission to find your desired aerofoil but I'm having a think about how to improve this! If you are not seeing the above script (has both generator and NACA in the same script) then you might need to remove the script and re-add it.

    Let me know if this works for you (or even doesn't!)

    Kind regards,
  • _5419_5419 Member Posts: 9
    Thanks Darren, I will take a peek and see if I can find it. Right now I'm struggling to determine how to turn my surface loft into a solid feature...

    After I figure that out, I'll play around with changing from NACA to Eppler, it's great that's in the same feature so I don't need to rebuild the whole thing. 

  • _5419_5419 Member Posts: 9
    Hello again, mine doesn't look like your menu item. I'm not sure how to remove and add it, I'll play around to see if I can figure it out.

    I was using a copy of your file, and adding tabs to the application examples to use the features you've created. 

    Here's link to my doc:

  • darren_13darren_13 Member, Developers Posts: 103 EDU
    Hi @_5419, if you follow this link:


    Once there you should see a 'use this feature' option, it will then get added to the toolbar. If you use this method you can just update the feature every time I update it :)

    also here:

    down the page is a 'START USING CUSTOM FEATURES' video.

    Hope this helps,
  • darren_13darren_13 Member, Developers Posts: 103 EDU
    @_5419, I took a look at your document and interesting use for it. I'm currently doing an update for this script which will allow the user to define a rounded trailing edge. So whilst I'm editing would be good to hear your feedback.

    I also saw you were using many 3D splines as guides for lofting, did you know that I have a multispline lofting feature for aerofoils exactly for this job? if so was it not good in your application? and how could I modify it for your needs?

    Sorry for the number of questions :smiley:

    Kind regards,
  • darren_13darren_13 Member, Developers Posts: 103 EDU
    Hi guys, 

    Firstly I just wanted to say I have been busy updating the profile generator script and I haven't had the opportunity to announce it yet... So this is me announcing "Check out my latest update!!" :)

    *Note there is a current issue with the manipulator.

    So this got me thinking, I keep updating this script with lots of options that I need, however, in general use are these options needed? I could hide some options and show then in some sort of 'advance mode' or if people use these options as much as I do then I would obviously just leave them in. As a reminder here is what the current GUI looks like:

    This is just a screen grab from the documentation, much of these options are hidden under the enums such as TE type etc, however, the types could be hidden and only produce a single spline aerofoil unless in advance mode. Or as I said leave as is. 

    So right now If you have a preference let me know otherwise I'll leave current options in and decide wich future options are relevant.

    Also, I don't think I have had a chance to properly announce my 'Wing structure script':

    Full documentation for this is now provided, but better still see 'application example 4 - FEA' as this shows the steps taken to create the above structure. This script is new so please report any issues you find with me. There is currently only one know 'bug' where the thickness is incorrect for one of the options. 

    Finally, I just wanted to share an insight into the direction of these scripts.
    • Complete parametric aerofoils starting with a twin circle and twin spline type aerofoil and progressing over time.
    • Integrated testing and debugging into the code to allow me and any user to see what is happening internally simply with an input of a string.
    • Making 'Aerofoil functions' module public and documented for using within custom scripts.
    • Wing structure updates to include aerodynamic features and call it 'Wing Features' or something similar (this is to adapt the script for some of my CFD work).
    So that's all I want to say, any feedback is always welcome.

  • michael_stallsmichael_stalls Member Posts: 28 PRO
    edited July 10
    Im interested in finding out how to use the wing structure tool. i've made few wing structures  like the one below myself and it's a bit tedious.....Looks like This could be huge help to me! is there a guide to how to use the multi spline and wing structure Featurescript? (where do i find Application example 4 FEA?? ) i cant seem to get it to work properly. Cheers
  • darren_13darren_13 Member, Developers Posts: 103 EDU
    Hi @michael_stalls, these are very nice designs.

    I have the documentation which gives an overview of steps and the above-mentioned application example:

    (Application examples>Application example 4 (FEA)).

    I just loaded it and seems to work on mine, however, if you made a copy and you have linked my latest scripts I can see you would have issues. The reason being I have retired the NACA script (which the application example uses) in favour of its parent 'Profile Generator' I will update this tonight as it is very important to have this example working. for now, just explore it in the read-only document, sorry.

    As for multi-spline, I no longer see this as the way to go as the recently beefed loft function does very well. I use a line through the centre of the aerofoils and loft using the additional profiles thing. I get really good results here, that said if your lazy like me multispline is quick.

    If your still having troubles you can add me to your practice project or something and we can get it going with a basic setup.

    The code is quite expandable so if you have any suggestions then please let me know :)

    As an afterthought, looking at the wing tips of your design you might want to try surfacing instead of multi-spline anyway. Multi-spline only supports profiles (not mixed like edges to aerofoils etc.)

    Anything else just give me a shout!
  • darren_13darren_13 Member, Developers Posts: 103 EDU
    Hi @michael_stalls I have updated App Ex 4 FEA with all the latest scripts, a bit of modification had to be done due to the recent changes to loft.

    Kind regards,
  • michael_stallsmichael_stalls Member Posts: 28 PRO
    Hi @darren_13  Thanks alot for this ! this script is great ! 
Sign In or Register to comment.