importAirfoilDAT Namespace Reference

Airfoil (.dat) file importer. More...

Functions

def decodeName (name)
 
def insert (filename, docname)
 
def open (filename)
 
def process (filename)
 
def translate (context, txt)
 

Variables

 pythonopen = open
 
bool useDraftWire = True
 

Detailed Description

Airfoil (.dat) file importer.

This module provides support for importing airfoil .dat files

Function Documentation

◆ decodeName()

def importAirfoilDAT.decodeName (   name)
Decode encoded name.

Parameters
----------
name : str
    The string to decode.

Returns
-------
tuple
(string)
    A tuple containing the decoded `name` in 'latin1',
    otherwise in 'utf8'.
    If it fails it returns the original `name`.

Referenced by insert(), and open().

◆ insert()

def importAirfoilDAT.insert (   filename,
  docname 
)
Get an active document and parse.

If no document exists, it is created.

Parameters
----------
filename : str
    The path to the filename to be opened.
docname : str
    The name of the active App::Document if one exists, or
    of the new one created.

Returns
-------
App::Document
    The active FreeCAD document, or the document created if none exists,
    with the parsed information.

References decodeName(), and process().

◆ open()

def importAirfoilDAT.open (   filename)
Open filename and parse.

Parameters
----------
filename : str
    The path to the filename to be opened.

Returns
-------
App::Document
    The new FreeCAD document object created, with the parsed information.

References decodeName(), and process().

◆ process()

def importAirfoilDAT.process (   filename)
Process the filename and create a Draft Wire from the data.

The common airfoil dat format has many flavors.
This code should work with almost every dialect.

Parameters
----------
filename : str
    The path to the filename to be opened.

Returns
-------
Part::Part2DObject or None.
    The created Draft Wire object or None if the file contains less
    than 3 points.

References pythonopen.

Referenced by insert(), and open().

◆ translate()

def importAirfoilDAT.translate (   context,
  txt 
)

Variable Documentation

◆ pythonopen

importAirfoilDAT.pythonopen = open

Referenced by process().

◆ useDraftWire

bool importAirfoilDAT.useDraftWire = True