Skip to content

NACA 4 Digit Airfoil Generator

KaiUR edited this page May 22, 2026 · 1 revision

NACA 4 Digit Airfoil Generator

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


Description

Generates a NACA 4-digit series airfoil profile in the active CATPart using GSD geometry. The user specifies a NACA code (e.g. 0010, 2412), chord length, point resolution, and output plane. Cosine spacing is used to cluster points near the leading and trailing edges where surface curvature is highest.

The script creates a geometric set containing:

  • A Points sub-set with all upper and lower surface points
  • A closed GSD spline (Airfoil_Spline) looping from LE → TE along the upper surface, then TE → LE along the lower surface

Settings are saved between sessions.


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. Enter the NACA code, chord length, resolution and output plane in the dialog
  4. Click OK — a progress bar shows while geometry is created
  5. A new geometric set is added to the part containing the point set and closed spline

Parameters

Parameter Description Default
NACA code 4-digit NACA designation (e.g. 0010, 2412) 0010
Chord Chord length in mm 1000.0
Points / side Number of sample points per surface (upper and lower) 50
Plane Output plane: XY, XZ, or YZ XY

NACA Code Format

The 4-digit designation has the form MPXX:

Digit(s) Meaning Example
M (1st) Maximum camber as % of chord 2 = 2% camber
P (2nd) Position of max camber in tenths of chord 4 = 40% chord
XX (3rd+4th) Maximum thickness as % of chord 12 = 12% thick

Examples:

  • 0010 → Symmetric, 10% thick (classic NACA 0010)
  • 2412 → 2% camber at 40% chord, 12% thick
  • 4415 → 4% camber at 40% chord, 15% thick

Dialog Buttons

Button Action
OK Validates inputs and generates the airfoil
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 NACA_XXXX_Chord_YYYmm is created at the top level of the part tree containing:

NACA_0010_Chord_1000mm
├── Points
│   ├── Upper_001  (leading edge)
│   ├── Upper_002
│   │   ...
│   ├── Upper_050  (trailing edge)
│   ├── Lower_001
│   │   ...
│   └── Lower_048  (back to leading edge)
└── Airfoil_Spline  (closed)

The spline passes through all upper points (LE → TE), then all lower points (TE → LE), forming a single closed loop ready to use as a pad or pocket profile.


Settings Persistence

Settings are saved automatically to:

%APPDATA%\pycatia_scripts\NACA_4_Digit_Airfoil_Generator\user_presets.json

The next time the script runs, your last-used values are pre-filled in the dialog.


Notes

  • The leading edge is placed at the origin; the trailing edge is at (chord, 0, 0) for XY and XZ planes
  • Cosine spacing: 50 points per side gives very smooth geometry; use 20–30 for lightweight models, 100+ for CFD/analysis work
  • The geometric set name encodes the NACA code and chord length for easy identification

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