How to Make a Smooth Wing from an Airfoil Section in FreeCAD

Поделиться
HTML-код
  • Опубликовано: 18 мар 2021
  • This video shows how to make a smooth wing part in FreeCAD from an airfoil section defined by coordinates in a file. (see the bottom of this description for a workaround if you're using Windows).
    The wing has sweep, taper and twist, and the thickness to chord ratio varies across the span. The result is a smooth 3D shape that follows the shape of the loaded airfoil section.
    There's a blog article accompanying this video that you can find here:
    www.ittextra.com/techPop.jsp?i...
    From the article website you can download the macro and airfoil section used in this video and the final part. Alternatively, download directly from here:
    www.ittextra.com/downloads/Win...
    Feel free to leave any comments or questions on the video or the article below.
    ------------------------------ Windows workaround.
    I found that my macro does not work on a vanilla FreeCAD install on Windows. It seems to be related to tkinter but I haven't had chance to work out why yet. You can work around this by hard-coding the file path to the airfoil file as follows:
    Comment out the lines that mention tkinter and the two lines starting "root" as indicated below
    #import tkinter as tk
    #from tkinter.filedialog import askopenfilename
    #root = tk.Tk()
    #show askopenfilename dialog without the tkinter window
    #root.withdraw()
    Comment out the file_name line and replace with the hard-coded path to your file as shown.
    #default is all file types
    #file_name = askopenfilename()
    file_name = "C:/Users/MyUser/Documents/airfoils/NACA0012.dat"
    Save this macro and run. You'll need to change the path each time you want to use a different airfoil section. Hope this works for you.
  • НаукаНаука

Комментарии • 42

  • @markfisher8943
    @markfisher8943 27 дней назад

    Best trial I’ve seen on doing this. I’m a newbie at 3d cad. Fine with old 2d stuff (65). I am making some wingtip extensions for my glider. Straight TE, curved LE, forward Swept. Lookup Genesis 2. I’ll give this a try. Many thanks

    • @ITriedThis
      @ITriedThis  27 дней назад

      Thanks for the comment!
      Interesting looking glider. Do you mean full size glider or RC model?
      I've had a second video 75% prepared for about 18months, but can't find the time to finish it. It looks at a method to make a smooth arbitrary shape (e.g a fuselage) if you can't make it from standard shapes like circular sections. I'll try to post it soon.
      Let me know how it goes with the wing tip.

    • @markfisher8943
      @markfisher8943 21 день назад

      @@ITriedThis I downloaded your Macro, . Its viible from Macro menu, but, when I Execute nothing happens. I must admit I am using ONDSEL. Maybe thats the issue.? Any ideas

    • @markfisher8943
      @markfisher8943 21 день назад

      FYI. No luck in Freecad 0.18 either

    • @ITriedThis
      @ITriedThis  21 день назад

      @@markfisher8943 Not sure why it is not working, but below are a few things you can try. I just rechecked my macro again on Windows and the behaviour has changed, even though I haven't changed my FreeCAD installation!! I originally wrote this on Linux.
      1. Check for error messages in the report window. If you have any, post them here.
      2. Assuming no errors: Start with an empty model. Run the macro and check if you have a new item in the model window called 'BSpline' or similar. If so, the airfoil section has been created. If pressing the 'Fit All' button does not show the section, add the following to the end of the macro and repeat.
      FreeCAD.ActiveDocument.recompute()
      I have to do this on my Windows installation now to get the section to show. Never had to do it before?
      3. If you don't get an object called BSpline or similar, you will need to do some debugging. You can add some commands to try to find out what's going on. For example, add the following just after the line that starts 'points.append'
      print(points)
      Make sure it starts in the first column (no leading spaces) because python has stupid indentation syntax instead of proper markers for code loops.
      The printout should appear in the report view. Try some print statements in different places to try to trace what is happening.
      Let me know what you find and I'll try to help.

  • @geekthesteve6215
    @geekthesteve6215 2 года назад +2

    Good video. Thanks for not having an intro and background music. Your voice explanations along with the slow and deliberate movement onscreen helped me to understand pretty much exactly what I will need to do when laying out the wing for my next flying wing FPV design and build. It is really too bad more RC airplane builders don't learn FreeCAD. Thanks, I liked and subscribed.

    • @ITriedThis
      @ITriedThis  2 года назад +1

      Thanks for the comment, and for subscribing even though I only have minimal content on this subject!
      I'm glad it was useful.
      I've been working on another video about how to make smooth arbitrary body shapes but it's taking some time to complete. May post it in a month or two.
      I'd be interested to see your flying wing design once you've completed it.

  • @thomashvnmusic
    @thomashvnmusic 3 года назад

    This is sick! Thanks for helping a brother out.

    • @ITriedThis
      @ITriedThis  3 года назад

      Thanks for the comment. Glad it was useful!
      I'm working on a similar video for making smooth body/fuselage shapes from a number of sections. Check back in a few weeks if you're interested.

  • @ElectronSolarWind
    @ElectronSolarWind 2 года назад

    Thank you for providing such a simple and efficient macro, which has a big impact technologically speaking, because you have provided a door with a key that allows my research to continue. I had to modify your python code for it to work for my needs, but you gave me what I needed for my lastest invention. Thank you. I am based in Falmouth UK by the way.

    • @markfisher8943
      @markfisher8943 27 дней назад

      Nope. Not RC. I sit in this one. I will have to figure out how to use a spline on the LE.

    • @markfisher8943
      @markfisher8943 21 день назад

      Any hints on what and why you changed Pythn code. I cannot get a file to load.

  • @BrainDeadEngineering
    @BrainDeadEngineering 2 года назад

    Amazing !

  • @SV001R
    @SV001R 3 года назад +1

    There're few video clips about making aircraft or its part with FreeCAD. This is good one to use real NACA airfoil for making wing model.

    • @ITriedThis
      @ITriedThis  3 года назад +1

      Thanks for the comment.
      I'm planning a few more FreeCAD videos using mathematically defined shapes for wings and bodies.

  • @mecanizadosgrela7380
    @mecanizadosgrela7380 2 года назад

    thanks for this video

    • @ITriedThis
      @ITriedThis  2 года назад +2

      Thanks gerardo, you're welcome. Watch out for my next video in this series - How to make a smooth body shape. Coming in a few weeks I hope!

  • @educationlab2666
    @educationlab2666 2 года назад +2

    I decided to try FreeCAD to design my own airplane wing. I wanted to import the airfoil design I saw your video and was interested in the macro. Where can I find the article

    • @ITriedThis
      @ITriedThis  2 года назад

      Hi Education Lab. Thanks for watching my video. If you check the description of this video, you'll see a couple of links. The first one links to my article and the second one links directly to a zip file containing the macro. Hope this is useful.
      I'm also working on the next video in this series, which will include a method and macro to make a smooth complex body shape. This should be ready in a few weeks.

  • @bernardofigueroa5137
    @bernardofigueroa5137 2 года назад

    great! Question: what if you don't want a trimmed trailing edge?

    • @ITriedThis
      @ITriedThis  2 года назад

      Hi Bernardo, That's a good question!
      The solution is to make the two trailing edge points the same. Unfortunately, the default behaviour in FreeCAD is to close the shape if the first and last points are the same but you can make a small hack to stop this.
      See my tech blog article that's linked in the description and read the last two paragraphs of the section labelled 'macro' (in part 2 of the article).
      I don't know why FreeCAD has this behaviour as it doesn't seem sensible to me.
      Post again if my description is not clear.

  • @colemanblake4109
    @colemanblake4109 2 года назад

    Just tried to create the macro using "Create" tab in Addon Manager. Same results.

  • @markfisher8943
    @markfisher8943 11 дней назад

    Hi. I have been spending some time on this. A couple of questions. Having some thicknerss at the trailing edge is good, but beacuse the tip is scaled, we end up with very l;ittle thickness. Ideally I'd have approx 2mm thickness alomng the entire trailing edge. Any ideas on this. While Im waiting fro a reply Ill see if I can get a spline into the Leading edge to give curved LE.

    • @ITriedThis
      @ITriedThis  11 дней назад

      @markfisher8943 You could do this by making 2 different sections, a root section and a tip section. If you know the chord length of those 2 sections, you can make sections that have 2mm trailing edge thickness once scaled to the correct chord. One way to do this is just to locally thicken the trailing edge part of the section. This is possibly simpler but distorts the section. The more "correct" way is to stretch the section (scale in the x direction) and cut off the excess at the trailing edge. You need to work out the scale needed to give you 2mm at the trailing edge for each section. This method maintains the section profile and is generally preferred. Hope this makes sense. I've done this before, so let me know if you need help with this.

    • @markfisher8943
      @markfisher8943 11 дней назад

      @@ITriedThis HI, Thanks so much. I'll need some help I think. I was traing to constrain the TE thickness in the Root wire model, thenscaling the tip, but just cannot make that happen. I am using ONDSEL, hopefully because the learning curve wont be so steep. I was hoping to create a wire for ribs say 100mm apart the full length of the wing extension (1400mm),. The TE edge is straight so I hoped to pickup the node of each rib to create a spline in the planform model. Lots to learn. Any help would be greatly appreciated. Where are you located?

  • @zarrokea
    @zarrokea Год назад

    Hi I can"t seem to snap the Line to the BSpline ends maybe you have an idea on how I can close the shape ? Great video and macro thanks !

    • @ITriedThis
      @ITriedThis  Год назад +1

      Not sure why that's not working. Can you try making a line by typing the coordinates of the end points? If you make them exactly the same as the airfoil end points you should be able to close the shape. Alternatively, make a surface of the unclosed shape, then you may be able to make the trailing edge surface separately.
      Thanks for watching!

    • @marc-antoinenadeau2672
      @marc-antoinenadeau2672 6 месяцев назад

      same issue here but when you create the line from draft you can manually input the coordinates on the left and it worked that way

    • @markfisher8943
      @markfisher8943 11 дней назад

      I found that I didnt have snap turned on for endpoints. This worked great in Draft bench. Upgrading also was no isssue

  • @germona
    @germona 9 месяцев назад

    Very interesting Sir. I Tried this too, and it worked. However at 11:45 i hear you say that the tipsection needs to be pushed to the right with the formula 1035 x 90, but i don't know how you can have a result of 63.02. And another question, where did you get this .dat file? is it from a real wing like a windmill? Thanks. Jean

    • @ITriedThis
      @ITriedThis  9 месяцев назад

      Hi @germona, sorry I didn't speak clearly at 11:45 and the auto-caption did not work properly. The formula I actually say is tan(35) x 90 but it sounds like 10 35 x 90.
      The airfoil section is a standard NACA section and can be downloaded from the site linked in the video description. There's also a good book on standard NACA sections that is available online and contains tables of many sections plus the equations to calculate them. Search for a Abbott and Von Doenhoff, Theory of Wing Sections.
      Thanks for watching!

    • @germona
      @germona 9 месяцев назад

      @@ITriedThis Thank you very much for the extra info.

  • @fulviospa
    @fulviospa 2 года назад

    i'm try to build a F104Wing but my freecad not find tkinter module can you help me?

    • @ITriedThis
      @ITriedThis  2 года назад

      I might be able to help. I had a similar problem on Windows. Are you using Windows or Linux?
      Could you post the exact error message you are getting and also check if you have a working version of tcl on your path?

    • @ITriedThis
      @ITriedThis  2 года назад

      I haven't found the issue but I've added a workaround in the description that might help you.

  • @wadetomczyk8043
    @wadetomczyk8043 2 года назад

    This is cool. I can't use your Macros file though since I'm using Windows or I'm just missing something.

    • @ITriedThis
      @ITriedThis  2 года назад

      Hi Wade. Thanks for the comment. I tried my macro on Windows and also had a problem! There seems to be some issue with tkinter on Windows. If that's the problem you're having, I've put a workaround in the video description. Let me know if this works for you or what the error message is if you have something different.

    • @wadetomczyk8043
      @wadetomczyk8043 2 года назад

      @@ITriedThis I'll be honest I'm not sure when it comes to coding by what you mean "comment out" etc.

    • @ITriedThis
      @ITriedThis  2 года назад +1

      Sorry, I shouldn't have assumed you would understand. Here is some more detailed explanation.
      Edit the macro in FreeCAD from the Macro->Macros menu.
      Find the following lines:
      root = tk.Tk()
      # show askopenfilename dialog without the tkinter window
      root.withdraw()
      # default is all file types
      file_name = askopenfilename()
      ... and replace them with these
      # root = tk.Tk()
      # show askopenfilename dialog without the tkinter window
      # root.withdraw()
      # default is all file types
      # file_name = askopenfilename()
      file_name = "C:/Users/MyUser/Documents/airfoils/NACA0012.dat"
      ... in the last line, replace the path and filename with the path and filename to wherever you have put your airfoil data file.
      Note that there should be no spaces at the beginning of these lines or python will get confused.
      Hope this is clear.

    • @ElectronSolarWind
      @ElectronSolarWind 2 года назад

      @@ITriedThis I am getting the same problem. I followed the instructions, but I am still getting "No module named 'tkinter' ". I'm on windows 10 and using FreeCAD 0.19.

    • @ITriedThis
      @ITriedThis  2 года назад

      @@ElectronSolarWind I just noticed that there are two other lines that mention tkinter that should also be commented out. I've updated the workaround description in the description of this video.
      That's weird because it worked for me on Windows with those two lines still included?
      Let me know if it works for you now or if there's something in my workaround description that's not clear.

  • @elhnston6589
    @elhnston6589 2 года назад

    You should just post the macro in the info box, or in a comment.