FreeCAD Logo FreeCAD 1.0
  • English Afrikaans Arabic Belarusian Catalan Czech German Greek Spanish Spanish Basque Finnish Filipino French Galician Croatian Hungarian Indonesian Italian Japanese Kabyle Korean Lithuanian Dutch Norwegian Bokmal Polish Portuguese Portuguese Romanian Russian Slovak Slovenian Serbian Swedish Turkish Ukrainian Valencian Vietnamese Chinese Chinese
  • Features
  • Download
  • Blog
  • Documentation
    Documentation index Getting started Users documentation The FreeCAD manual Workbenches documentation Python coding documentation C++ coding documentation Tutorials Frequently asked questions Privacy policy About FreeCAD
  • Contribute
    How to help Sponsor Report a bug Make a pull request Jobs and funding Contribution guidelines Developers handbook Translations
  • Community
    Code of conduct Forum The FPA GitHub GitLab Codeberg Mastodon Matrix IRC IRC via Webchat Gitter Discord Reddit Twitter Facebook LinkedIn Calendar
  • ♥ Donate

Donate

$
SEPA Information
Please set up your SEPA bank transfer to:
Beneficiary: The FreeCAD project association
IBAN: BE04 0019 2896 4531
BIC/SWIFT: GEBABEBBXXX
Bank agency: BNP Paribas Fortis
Address: Rue de la Station 64, 1360 Perwez, Belgium

While Stripe doesn't support monthly donations, you can still become a sponsor! Simply make a one-time donation equivalent to 12 months of support, and you'll gain access to the corresponding sponsoring tier. It's an easy and flexible way to contribute.

If you are not sure or not able to commit to a regular donation, but still want to help the project, you can do a one-time donation, of any amount.

Choose freely the amount you wish to donate one time only.

You can support FreeCAD by sponsoring it as an individual or organization through various platforms. Sponsorship provides a steady income for developers, allowing the FPA to plan ahead and enabling greater investment in FreeCAD. To encourage sponsorship, we offer different tiers, and unless you choose to remain anonymous, your name or company logo will be featured on our website accordingly.

from 1 USD / 1 EUR per month. You will not have your name displayed here, but you will have helped the project a lot anyway. Together, normal sponsors maintain the project on its feet as much as the bigger sponsors.

from 25 USD / 25 EUR per month. Your name or company name is displayed on this page.

from 100 USD / 100 EUR per month. Your name or company name is displayed on this page, with a link to your website, and a one-line description text.

from 200 USD / 200 EUR per month. Your name or company name and logo displayed on this page, with a link to your website and a custom description text. Companies that have helped FreeCAD early on also appear under Gold sponsors.

Instead of donating each month, you might find it more comfortable to make a one-time donation that, when divided by twelve, would give you right to enter a sponsoring tier. Don't hesitate to do so!

Choose freely the amount you wish to donate each month.

Please inform your forum name or twitter handle as a notein your transfer, or reach to us, so we can give you proper credits!

ImportAirfoil

Description
Macro for Airfoil coordinates import.

Macro version: 1.0.0
Last modified: 2022-01-08
FreeCAD version: 0.18.4 and above
Download: ToolBar Icon
Author: Miloš Petrašinović
Author
Miloš Petrašinović
Download
ToolBar Icon
Links
Macros recipes
How to install macros
How to customize toolbars
Macro Version
1.0.0
Date last modified
2022-01-08
FreeCAD Version(s)
0.18.4 and above
Default shortcut
None
See also
Github repository

Description

Macro for Airfoil coordinates import. It is possible, using simple dialog, to scale the airfoil, rotate, translate in the plane, translate along the span, select the plane and the main axis, as well as turn the geometry into a sketch. It is possible to import coordinates saved in the most commonly used formats.

Usage

Run the macro program and follow the instructions.

Script

ToolBar Icon

ImportAirfoil.FCMacro

# Airfoil import macro
# After selecting the file with the coordinates of the airfoil
# data processing and modeling of the airfoil are performed.
# It is possible, using simple dialog, to scale the airfoil, rotate, 
# translate in the plane, translate along the span, select the plane and 
# the main axis, as well as turn the geometry into a sketch. It is possible
# to import coordinates saved in the most commonly used formats.
# Airfoil import is based on:
#  https://github.com/VAZMFB/Python-importAirfoil
# Author: Milos D. Petrasinovic <mpetrasinovic@mas.bg.ac.rs>
# Structural Analysis of Flying Vehicles
# Faculty of Mechanical Engineering, University of Belgrade
# Department of Aerospace Engineering, Flying structures
# https://vazmfb.com
# Belgrade, 2022
# 
# --------------------
#
# Copyright (C) 2022 Milos Petrasinovic <info@vazmfb.com>
# 
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as 
# published by the Free Software Foundation, either version 3 of the 
# License, or (at your option) any later version.
#  
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#  
# You should have received a copy of the GNU Lesser General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.
#
# --------------------
#
# Based on:
# Airfoil Import and Scale 2.1.2
# (c) quick61
#
# --------------------

__Name__ = 'ImportAirfoil'
__Comment__ = 'Airfoil import macro'
__Author__ = 'Milos Petrasinovic <mpetrasinovic@mas.bg.ac.rs>'
__Version__ = '1.0.0'
__Date__ = '2022-01-06'
__License__ = 'GPL-3.0-or-later'
__Web__ = 'https://github.com/VAZMFB/FreeCAD-ImportAirfoil'
__Wiki__ = 'https://wiki.freecad.org/Macro_ImportAirfoil'
__Icon__ = 'https://wiki.freecad.org/images/3/37/ImportAirfoil.svg'
__Help__ = 'Run the macro program and follow the instructions!'
__Status__ = 'stable'
__Requires__ = 'Freecad >= 0.19'
__Communication__ = 'https://github.com/VAZMFB/FreeCAD-ImportAirfoil/issues/'
__Files__ = 'ImportAirfoil.svg'

import FreeCAD as App
from PySide import QtCore, QtGui
from PySide.QtGui import QFileDialog, QLineEdit, QRadioButton, QMessageBox 
import Draft, importAirfoilDAT
import numpy as np
import subprocess
import sys
import os
import re

global filename
global nameFile

msgBox = QtGui.QMessageBox()
msgBox.setWindowTitle("ImportAirfoil")
msgBox.setText("In the next window, select the file with the coordinates of the airfoil.")
msgBox.exec_()

try:
    filename, filefilter = QtGui.QFileDialog.getOpenFileName(QtGui.qApp.activeWindow(), 'Select the file with the coordinates:', '*.dat;*.txt;*.af')
except Exception:
    param = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Macro")
    path = param.GetString("MacroPath", "") + "/"
    filename, filefilter = QFileDialog.getOpenFileName(None, "Select the file with the coordinates:", path, "*.dat;*.txt;*.af")

nameFile = filename.split("/")[-1][:-4]

class DrawAP():
    def __init__(self):
        self.dialog = None
        self.lt = 0
        self.alpha = 0
        self.h0 = 0
        self.plane = None
        self.mirror = None
        self.dh = 0
        self.dv = 0
        self.db = 0
        self.sketch = None

        # Dialog window
        self.dialog = QtGui.QDialog()
        self.dialog.resize(350, 100)
        self.dialog.setWindowTitle("ImportAirfoil")
        la = QtGui.QVBoxLayout(self.dialog)
        tx = QtGui.QLabel("Length of airfoil chord [mm]:")
        la.addWidget(tx)
        self.lt = QtGui.QLineEdit("1000")
        la.addWidget(self.lt)
        tx = QtGui.QLabel("The angle of rotation [deg]:")
        la.addWidget(tx)
        self.alpha = QtGui.QLineEdit("0")
        la.addWidget(self.alpha)
        tx = QtGui.QLabel("The relative position of the axis of rotation [% of chord]:")
        la.addWidget(tx)
        self.h0 = QtGui.QLineEdit("25")
        la.addWidget(self.h0)
        tx = QtGui.QLabel("Plane selection [XY = 1, YZ = 2, ZX = 3]:")
        la.addWidget(tx)
        self.plane = QtGui.QLineEdit("1")
        la.addWidget(self.plane)
        tx = QtGui.QLabel("Vertical mirroring [NO = 0, YES = 1]:")
        la.addWidget(tx)
        self.mirror = QtGui.QLineEdit("0")
        la.addWidget(self.mirror)
        tx = QtGui.QLabel("Change axis [NO = 0, YES = 1]:")
        la.addWidget(tx)
        self.flip = QtGui.QLineEdit("0")
        la.addWidget(self.flip)
        tx = QtGui.QLabel("Translation along the horizontal axis [mm]:")
        la.addWidget(tx)
        self.dh = QtGui.QLineEdit("0")
        la.addWidget(self.dh)
        tx = QtGui.QLabel("Translation along the vertical axis [mm]:")
        la.addWidget(tx)
        self.dv = QtGui.QLineEdit("0")
        la.addWidget(self.dv)
        tx = QtGui.QLabel("Translation along the span [mm]:")
        la.addWidget(tx)
        self.db = QtGui.QLineEdit("0")
        la.addWidget(self.db)
        tx = QtGui.QLabel("Create a Sketch [NO = 0, YES = 1]:")
        la.addWidget(tx)
        self.sketch = QtGui.QLineEdit("0")
        la.addWidget(self.sketch)

        # Add OK / Cancel buttons
        okBox = QtGui.QDialogButtonBox(self.dialog)
        okBox.setOrientation(QtCore.Qt.Horizontal)
        okBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel

Links

The forum discussion New Macro: ImportAirfoil

This page is retrieved from https://wiki.freecad.org/Macro_ImportAirfoil

Get in touch!
Forum GitHub Mastodon Matrix IRC Gitter.im Discord Reddit Twitter Facebook LinkedIn

© The FreeCAD Team. Homepage image credits (top to bottom): ppemawm, r-frank, epileftric, regis, rider_mortagnais, bejant.

This project is supported by: , KiCad Services Corp. and other sponsors

GitHubImprove this page on GitHub