# File formats

Five files leave the site: DXF and DAT for a section, CSV for a polar, STEP and STL for a wing. One comes in: a DAT, on Compare and on the Kulfan canvas. This page says what each holds, in what units, and what reads it. Every description below was taken from the code that writes the file.

## DXF

![The Download row in the Properties panel, ringed: DXF, DAT and CSV buttons.](https://media.foil.tools/docs/shots/foil-page-downloads.9daae865e1b9.webp)

*The downloads are in the left column, under the geometry figures.*

A section as a 2D drawing in millimetres, for CAD. The chord is set by the page: 1000 mm from a section page, Search, Mission's results, Compare and Optimize; on the [Kulfan canvas](/kulfan-canvas) it is the chord you type. Scale it in your CAD program if you need another.

What is in the file:

- **Two cubic splines**, one per surface, on layers `UPPER` and `LOWER`. Each runs from the leading edge to the trailing edge through a dense sampling of the surface, denser near the nose. A control point is placed on the chord line at the leading edge so the two splines meet there with vertical tangents rather than a kink.
- **Reference points** on layer `POINTS`, a sparse set of the sampled coordinates from both surfaces, there to check the splines against if your CAD program resamples them.
- **A trailing-edge line** on `POINTS`, joining the two splines, only when the section has a blunt trailing edge. A sharp section closes at a point and gets no line.

The geometry is the drawn CST curve, the same one the viewer and the DAT carry, so the three agree. Fusion 360, Rhino, FreeCAD, SolidWorks and most 2D CAM programs read it; if yours draws the splines as polylines, the `POINTS` layer is the original data.

## DAT

Selig-format coordinates at unit chord, the form XFLR5, XFoil, OpenVSP, AeroSandbox and most other tools read.

- **Line 1** is the section name.
- **Then one point per line**, `x y` with six decimals, from the trailing edge forward over the upper surface to the leading edge and back along the lower surface to the trailing edge. The leading edge point is written once.
- **151 points** from a section page, Search, Mission's results and Compare. The Kulfan canvas writes the count you type. Optimize writes a denser file of the optimized shape.

A blunt trailing edge appears as the first and last points having different `y` at `x = 1`.

### Uploading a DAT

[Compare](/foil/compare) takes a `.dat` file and overlays it with the library; the [Kulfan canvas](/kulfan-canvas) fits CST parameters to one so it can be edited. Both read it the same way:

- Any line that is two numbers is a point; everything else, including the name line, is skipped.
- The chord is normalised: `x` is shifted to start at 0 and both axes are divided by the chord, so a file at 250 mm reads the same as one at unit chord.
- The file is split at its midpoint into the two surfaces, so it must be in Selig order with the surfaces of similar length. A Lednicer file (two blocks, each from the leading edge, with a count line) is not read correctly; convert it first.

![The left column of Compare: the Selected Foils panel listing n63412, sd8040 and e224 with their thickness and camber, an eye and a remove button on each, ringed; and the + Upload .dat button ringed.](https://media.foil.tools/docs/shots/compare-selected.5f3cbbecbc31.webp)

*The sections on the chart are listed at the top left: the eye hides one, × removes it. Your own .dat goes in under them.*

## CSV

Two pages write a polar as CSV. Both are plain text, one header line, one row per angle of attack, no units column: angles in degrees, coefficients dimensionless.

- **A section page** writes what the chart draws: the ticked Reynolds numbers at the selected Ncrit, stored rows and live runs alike, columns `Re,Ncrit,alpha,CL,CD,CM`. The file name carries the section and the Ncrit, so two downloads at different Ncrit do not land as one file and its copy. Angle of attack runs -20° to 25° in 0.5° steps for a stored row.
- **Wing analysis** writes the sweep of the last run, columns `alpha,CL,CD,CM,L_over_D`, as `wing_polar.csv`. The coefficients are for the whole wing, referenced to the S_ref the panel reports.

## STEP and STL

![The Generate 3D Wing card at the bottom of the designer with the Loft sections, TE thickness and Format inputs ringed as one row, and the Generate button ringed.](https://media.foil.tools/docs/shots/wing-generate.0751a562fa2c.webp)

*Export is the last card on the page: three settings, then Generate. The button needs you signed in.*

The [wing designer](/wing) exports the wing it draws. Both files are in millimetres and both hold the whole wing, both halves, as one closed solid: the half you edit lofted through the sections, then mirrored about the root.

- **STEP** is the exact loft, a B-rep surface through every station, for CAD. Open it in Fusion 360, Rhino, FreeCAD, Onshape or SolidWorks and it is a solid you can shell, split or cut moulds from.
- **STL** is the same solid as a triangle mesh, for slicers and mesh tools. The tessellation tolerance is the exporter's default, fine enough for printing at the sizes the designer allows; for machining, take the STEP.

What the loft contains:

- **The stations** are the section at each position along the span, blended from the root section to the tip section, placed on the leading and trailing edges you drew, twisted as the twist profile says. Loft sections, under Export, sets how many.
- **The tip** is flat unless Tip rondure is on, in which case a rounded cap continues the planform past the last station.
- **The trailing edge** is each section's own unless TE thickness, under Export, is set, in which case every station is opened to at least that. A wing that mixes a sharp section with a blunt one is lofted with every edge opened slightly, because the loft cannot take both.

Export needs a sign-in. The viewer and the file are the same loft, so what you see is what you get; where they can differ is the subject of the Wings pages on the [docs index](/docs#wings).
