CGFoil

Version

CGFoil is a CGAL-based airfoil meshing tool for generating constrained Delaunay triangulations of airfoils with plies and webs.

Installation

Install with uv:

uv pip install .

Usage

CLI help

Help

Generate mesh from YAML:

cgfoil mesh examples/airfoil_mesh.yaml -o mesh.pkl

Plot existing mesh:

cgfoil plot mesh.pkl -f plot.png -s

Export to VTK:

cgfoil export vtk mesh.pkl -o output.vtk

Export to ANBA:

cgfoil export anba mesh.pkl -o output.json

Run with defaults:

cgfoil run -p -v output.vtk -f naca0018.dat -s

Options:

  • -p, --plot: Plot the triangulation
  • -v, --vtk FILE: Output VTK file
  • -f, --file FILE: Path to airfoil data file (.dat), default: naca0018.dat
  • -s, --split: Enable split view plotting
  • --plot-file FILE: Save plot to file

Examples

See the examples/ directory for programmatic usage, including loading from YAML.

Example output

Example

Development

Use uv for dependency management:

uv sync

Run tests:

uv run pytest

Format code:

uv run ruff format

Lint:

uv run ruff check