Skip to content

Navigation Menu

Sign in
Sign up

Custom Coordinate Airfoil Generator

KaiUR edited this page May 22, 2026 · 1 revision

Custom Coordinate Airfoil Generator

File: Shape_Generation_Scripts/Custom_Coordinate_Airfoil_Generator.py
Version: 1.0
Document Type: Part


Description

Creates a GSD point set and spline in the active CATPart from arbitrary X Y (or X Y Z) coordinates. Coordinates can be loaded from a .dat, .csv, or .txt file, or pasted directly into a text area in the dialog. Selig .dat format is supported — the airfoil name header line is automatically skipped.

The script creates a geometric set containing:

  • A Points sub-set with all input points
  • A GSD spline (Airfoil_Spline) through all points — open or closed at the user's option

The output plane (XY, XZ, YZ) and an optional chord scale are user-selectable. Plane and scale settings are persisted between runs.


Requirements

Requirement Value
Python >= 3.10
pycatia >= 0.8.3
wxPython Required
Open document Part

Usage

  1. Open a CATPart document
  2. Run the script
  3. Choose input mode (File or Paste Text) and supply your coordinates
  4. Set the chord scale, close spline option, and output plane
  5. Click OK — a progress bar shows while geometry is created
  6. A new geometric set is added to the part containing the point set and spline

Input Formats

File (.dat / .csv / .txt)

Click Browse to select a coordinate file. Supported formats:

Format Description
Selig .dat First line is the airfoil name (skipped automatically), followed by X Y pairs
CSV Comma-separated X,Y or X,Y,Z values
Whitespace Space- or tab-separated X Y or X Y Z values

Lines beginning with # are treated as comments and skipped. Any line that cannot be parsed as numbers is silently ignored.

Paste Text

Switch to Paste Text mode and type or paste coordinates directly into the text area. Each line should contain one point:

1.00000 0.00000
0.95063 0.00624
0.80003 0.01223
...

Columns may be separated by spaces, tabs, or commas.


Parameters

Parameter Description Default
Input mode File or Paste Text File
Chord scale Chord length in mm (0 = use raw coordinate values) 0.0
Close spline Connect the last point back to the first Enabled
Plane Output plane for 2-D input: XY, XZ, or YZ XY

Chord Scale

When set to a positive value, the input coordinates are normalised to their X-range (max X − min X = 1) and scaled so the chord equals the specified length in mm.

Set to 0 to skip scaling and use the raw coordinate values as-is. This is the correct setting when coordinates are already in mm.

Close Spline

Connects the last point back to the first point to form a closed loop.

  • Enable for complete airfoil profiles that list coordinates around the full contour (e.g. Selig .dat files running TE → upper → LE → lower → TE)
  • Disable for open curves or when only one surface is provided

Plane (2-D input only)

Determines which 3-D plane the 2-D (X Y) input is placed on:

Plane Point mapping
XY (X, Y, 0)
XZ (X, 0, Y)
YZ (0, X, Y)

If 3-column (X Y Z) input is supplied, this setting is ignored and coordinates are used directly.


Dialog Buttons

Button Action
OK Validates inputs and generates the spline
Cancel Exits without generating
Reset Defaults Restores factory default values
Clear Saved Deletes the saved user presets file
Help Opens the full in-script user manual

Output

A geometric set named Custom_Airfoil is created at the top level of the part tree containing:

Custom_Airfoil
├── Points
│ ├── Point_001
│ ├── Point_002
│ │ ...
│ └── Point_NNN
└── Airfoil_Spline (open or closed)

Settings Persistence

Plane, scale, and close-spline settings are saved automatically to:

%APPDATA%\pycatia_scripts\Custom_Coordinate_Airfoil_Generator\user_presets.json

The raw coordinate data is not saved.


Notes

  • At least 3 valid coordinate pairs are required to create a spline
  • The script handles mixed Selig .dat files where the header is a non-numeric string — it is silently skipped during parsing
  • If 3-D (X Y Z) coordinates are detected in any row, the plane selection is ignored and all rows are treated as 3-D
  • The geometric set is always named Custom_Airfoil; rename it in the CATIA tree after generation if needed

Home


Getting Started


Contributing


Any Document Scripts


Drawing Document Scripts


Part Document Scripts


Shape Generation Scripts


Process Document Scripts


Product Document Scripts


Utility Scripts


Legal

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /