Created NEW Macro : AeroFoil

Need help, or want to share a macro? Post here!
User avatar
Zolko
Posts: 1355
Joined: Mon Dec 17, 2018 10:02 am

Re: Created NEW Macro : AeroFoil

Postby Zolko » Wed Mar 10, 2021 12:44 pm

melwynfranciscarlo wrote: Tue Mar 09, 2021 5:51 pm The Split feature has been added to the Macro. It has also been tested against your airfoil, and it works!
I'm sorry but no, it doesn't work: where do you split the upper and lower surfaces ? In the attached screenshot, you can see that the upper surface goes to Z negative and then to (0,0). The point Z negative is an existing point in the coordinates list. The lower surface seems correct. Did you miss a i+1 or i-1 somewhere ?

AirFoil.PNG
AirFoil.PNG (260.23 KiB) Viewed 165 times

Also: is it really necessary to have so many intermediate windows ? Asking about "." or "," separator is something that should be automagically checkable I think.

1) the first window is unnecessary: who in modern times uses Naca airfoils ?
2) import from *.dat or *.csv: you'll see when the user chooses the file, and/or check first valid line
3) line-numbers can be automatic, and separator should be also
=> 3 unecessary windows, you can go straight to #4
4) "Load File" should be called "Choose File" and lead directly (if successful) to #5 without clicking "Next"
5) "Close" should be "Cancel" and "Create Airfoil" should be in-line with "Back" and "Cancel": Back, Cancel, OK
5-2) Since the file is now loaded, it would be nice to show a preview of the airfoil
5-3) All the available options are not very self-explanatory
5-4) use of Qt .ui files is overkill for such simple windows. Did you try to build the UI directlly in the macro file ? Please find attached a similar macro I had made for my use that offsets airfoil curves in their own plane (figuring out atumagically its own plane), and that can also generate Sketches and Wires. May-be you can find some inspiration in the use of inline UI construction. It's also a good check that the airfoil you generate is correct as it will amplify the mistakes.
Attachments
offset3DCurve.svg
(3.27 KiB) Downloaded 4 times
offset3DCurve.FCMacro
(10.57 KiB) Downloaded 5 times
try the Assembly4 workbench for FreCAD v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here
User avatar
melwynfranciscarlo
Posts: 81
Joined: Thu Feb 04, 2021 7:47 am
Location: Mumbai, India

Re: Created NEW Macro : AeroFoil

Postby melwynfranciscarlo » Wed Mar 10, 2021 3:55 pm

Zolko wrote: Wed Mar 10, 2021 12:44 pm
melwynfranciscarlo wrote: Tue Mar 09, 2021 5:51 pm The Split feature has been added to the Macro. It has also been tested against your airfoil, and it works!
I'm sorry but no, it doesn't work: where do you split the upper and lower surfaces ? In the attached screenshot, you can see that the upper surface goes to Z negative and then to (0,0). The point Z negative is an existing point in the coordinates list. The lower surface seems correct. Did you miss a i+1 or i-1 somewhere ?
...

Thank you very much, Zolko, for the suggestions!
Oh yes, I see it now: at the leading edge, if you really zoom in. Nope, it's not an i+-1 error. It's just that the code didn't expect the leading point of the upper airfoil curve to have a negative value, that's all. I've sorted that now (I'll upload it soon).

The multiple windows are for multiple features, for those who might need it.
The comma separator does seem redundant, now that you point it out. The code automatically figures it out. That'll go.

While NACA airfoils are used in a few number of full-scale aircraft, they are still employed on amateur aircraft.
I wish to add other airfoil modelers like Eppler once I find the equations.

I kept the DAT and CSV choices separate for the line/row/col numbering. By default, you simply go 'Next'.
The line numbering, I thought, would be required for some quirky files: multiple sets of data points in one file, the attached file that has the weird "17. 17." at the top, etc. I guess I can take them out if it's not required. I'll then have to work on adding some advanced parsers sometime later.

The preview of the airfoil does seem a cool idea. Something for the next version.

The options are quite explanatory. Which ones were you talking about?

I built the UI files using Qt Designer. It seemed easy and less of a hassle. I agree inline UI is a good idea, but for a single window.
I don't use the highly-cambered airfoils, hence I wasn't prepared for the macro to fail on its creation.
Attachments
goe587.txt
(789 Bytes) Downloaded 2 times
8-) MFC Boy: the one and only! 8-)
galou_breizh
Posts: 354
Joined: Wed Sep 15, 2010 9:38 am

Re: Created NEW Macro : AeroFoil

Postby galou_breizh » Thu Apr 01, 2021 7:01 am

Zolko wrote: Wed Mar 10, 2021 12:44 pm 5-4) use of Qt .ui files is overkill for such simple windows.
I don't think using ui files are an overkill because the Add-on manager handles these files for macros in the official macro repository. On the opposite, macros that include code to build the ui tend to be very long and less maintainable than those that have the few lines to load the ui files.

The things against UI files in my opinion is that they are more difficult to version-control and programmers tend to let the names proposed by Qt Designer rather than giving a meaningful name corresponding to the associated variable or functionality.

Gaël