> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ntop.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Importing & Exporting Data

## Introduction

Engineering data rarely begins and ends in one application. nTop can import tabular data, meshes, and computer-aided design (CAD) geometry, then convert each source into a representation suited to downstream modeling or analysis. It can also export calculated results for use in other engineering tools.

In this lesson, you will import coordinates from a comma-separated values (CSV) file and turn them into a closed airfoil shape. You will calculate its area and export the result. You will also import mesh and CAD versions of the same bracket, convert each for downstream modeling, and verify how units, source quality, and conversion settings affect the result.

## Understanding External Data in nTop

External data enters nTop as a specific data type. A CSV file can store ordered coordinates, a mesh represents surfaces with discrete faces, and CAD geometry represents boundaries with mathematically defined curves and surfaces. These source data types are not interchangeable, and they determine which blocks are available for immediate downstream operations.

As discussed in previous lessons, many modeling operations in nTop use an implicit body. Converting imported geometry to this form makes it available to implicit modeling operations. The conversion is not a substitute for validation: units, point order, mesh quality, CAD detail, and conversion tolerance can all affect the result.

The workflow in this lesson follows external data in both directions: source file to nTop representation to calculation to exported result.

## Create a Profile From CSV Coordinates

A closed profile is a filled planar region bounded by one or more closed curves. Coordinate-driven geometry follows a reusable pattern: import numeric values as points, connect the points into a curve, and convert the closed curve into a profile. An airfoil is a useful example because you can inspect each stage, but the same workflow applies to other closed planar shapes described by ordered coordinates.

Please refer to the following files as you work through this section:

**Downloadable Files:**

[Example File Download](https://files.learn.ntop.com/Courses/nTop%20Foundational%20Learning%20Course/Course%203/nTop%20Files/Profile%20from%20CSV.ntop)

*This file was last updated in nTop 6.03*

CSV Example File: **[Airfoil CSV Download](https://files.learn.ntop.com/Courses/nTop%20Foundational%20Learning%20Course/Course%203/nTop%20Files/Airfoil%20CSV.csv)**

### Prepare the CSV File

Use the provided airfoil CSV to follow the workflow, but structure the file as you would for any ordered point dataset: one point per row, three numeric columns in x, y, z order, and no header or metadata. For a closed profile, keep all z values equal, as the only way for the profile to remain closed is for the profile to remain planar.

<Frame>
  <img src="https://files.learn.ntop.com/Courses/nTop%20Foundational%20Learning%20Course/Course%203/Images/prepare%20the%20csv.jpg" />
</Frame>

*Sample point data arranged as x, y, and z columns. The z values remain 0 because this example creates a planar profile*

1. Open the CSV file and confirm that every row contains three numeric coordinate values.
2. Confirm the units used by the coordinate values. Assign these units when you import the file.
3. Check for duplicated points and points separated by distances that are negligible for the intended geometry. Nearly coincident values can create unstable or self-intersecting curves.
4. Inspect the first and last rows. They should describe the profile closure without creating a duplicated or nearly duplicated trailing-edge point.

### Overview of the CSV to Profile Workflow

The workflow uses three standard blocks that you can add directly to any notebook. The custom block shown below packages them for convenience. In the reusable data path, the CSV values become points, the points define a spline, the periodic input closes the airfoil boundary, and the closed spline becomes a profile. For the custom block, the inputs are the airfoil root point, the airfoil CSV path, and the units. The main body contains a **Spline Through Points** block that processes the CSV points and a **Profile from Curves** block that converts the spline into a profile. The custom block outputs the airfoil profile generated from the CSV.

<Frame>
  <img src="https://files.learn.ntop.com/Courses/nTop%20Foundational%20Learning%20Course/Course%203/Images/csv%20airfoil%20cb.jpg" />
</Frame>

*The custom block packages the general workflow. Notice how the imported point list feeds* ***Spline Through Points*** *and how its closed curve feeds* ***Profile from Curves***

* **Import Points** reads coordinate rows from the *Path* input, interprets them using the *Units* input, and returns points.
* **Spline Through Points** connects the *Points* input in row order. A spline is a smooth curve fitted through those points. Set *Degree* to 3 as a common starting point and enable *Periodic* when the boundary must close.
* **Profile from Curves** converts coplanar *Curves* into a planar profile. Correct an open, self-intersecting, or non-coplanar curve before this step.

<Frame>
  <img src="https://files.learn.ntop.com/Courses/nTop%20Foundational%20Learning%20Course/Course%203/Images/airfoil%20points.jpg" />
</Frame>

***Spline Through Points*** *uses Degree 3 with Periodic enabled to close the airfoil boundary*

<Frame>
  <img src="https://files.learn.ntop.com/Courses/nTop%20Foundational%20Learning%20Course/Course%203/Images/airfoil%20profile%20block.jpg" />
</Frame>

***Profile from Curves*** *converts the closed spline into the Airfoil Profile output*

This pattern is not specific to airfoils. Any ordered coordinate file can drive a similar workflow when you define its units, point order, curve closure, and planarity correctly. The file supplies values; the notebook determines how those values become geometry.

### Assemble the Workflow

1. Add an **Import Points** block, select the CSV file with the *Path* input, and set *Units* to match the coordinate values.
2. Add a **Spline Through Points** block, connect the imported points to the *Points* input, set *Degree* to 3, and enable *Periodic* for the closed boundary.
3. Add a **Profile from Curves** block, connect the spline to the *Curves* input, calculate the workflow, and display the resulting profile.

<Frame>
  <img src="https://files.learn.ntop.com/Courses/nTop%20Foundational%20Learning%20Course/Course%203/Images/airfoil%20profile.jpg" />
</Frame>

*The completed profile. The shaded interior confirms that the CSV-to-points-to-curve workflow produced a closed planar region*

**Profile from Curves** outputs a reusable planar profile, not an airfoil-specific data type. The same workflow can create other closed planar profiles, and its output can connect to any downstream block that accepts a profile.

### Alternative Method: Import the CSV as a Table

**Import Points** is the shortest path for a coordinate-only CSV without a header. The **Import Table** block is useful when the file has named columns or additional tabular values that you want to access independently.

Please refer to the following files as you work through this section:

**Downloadable Files:**

[Example File Download](https://files.learn.ntop.com/Courses/nTop%20Foundational%20Learning%20Course/Course%203/nTop%20Files/Profile%20from%20Import%20Table.ntop)

*This file was last updated in nTop 6.03*

CSV Example File: **[Airfoil Table Download](https://files.learn.ntop.com/Courses/nTop%20Foundational%20Learning%20Course/Course%203/nTop%20Files/Airfoil%20Table.csv)**

For this alternate route, use a copy of the airfoil CSV with x, y, and z headers in the first row.

* Add an **Import Table** block, select the headered CSV with the Path input, and enable Include Headers.
* Add three **Extract Column as Text** blocks and assign the x, y, and z column headers to them.
* Connect each extracted text list with **Scalar from Text**. Multiply each resulting scalar list by 1 mm, or by the length unit used in the source file, so the coordinates carry units.
* Add a **Point** block and connect the unit-bearing scalar lists to its X, Y, and Z inputs. nTop list processing creates one point for each table row.
* Connect the point list using **Spline Through Points**, set Degree to 3, enable Periodic, and generate the profile from the resulting curve using **Profile from Curves**.

<Frame>
  <img src="https://files.learn.ntop.com/Courses/nTop%20Foundational%20Learning%20Course/Course%203/Images/import%20table%20example.jpg" />
</Frame>

***Import Table** reads the headered CSV, and **Extract Column as Text** separates the x, y, and z columns before **Scalar from Text** converts each column into a scalar list*

<Frame>
  <img src="https://files.learn.ntop.com/Courses/nTop%20Foundational%20Learning%20Course/Course%203/Images/airfoil%20spline%20block.jpg" />
</Frame>

*Point combines the unit-bearing coordinate lists. **Spline Through Points** creates the periodic boundary, and **Profile from Curves** creates the planar profile*

<Frame>
  <img src="https://files.learn.ntop.com/Courses/nTop%20Foundational%20Learning%20Course/Course%203/Images/airfoil%20profile%20with%20points.jpg" />
</Frame>

*The completed airfoil profile generated through the **Import Table** workflow. To confirm their order around the boundary, display the imported points*

Both import methods produce the same downstream point-list-to-profile workflow. Use **Import Points** for a coordinate-only file and **Import Table** when individual columns or additional tabular data must remain accessible.

### Verify the Resulting Profile

Before using imported data downstream, verify that nTop interpreted it as intended. Check that:

* The profile occupies the intended region inside the boundary.
* The curve is smooth wherever the source data should be smooth.
* The profile closes cleanly at both the leading and trailing edges.
* No loop, spike, or unintended region appears outside the boundary.

If the profile does not close correctly, inspect the point order, duplicated or nearly coincident rows, and the *Periodic* setting before changing downstream blocks. These issues can cause the spline to loop back on itself or create an unintended region.

## Calculate and Export a Scalar Result

The **Surface Area** block accepts a profile, mesh, or implicit body and returns an area value. When you use the airfoil profile directly, the result is the enclosed area of the two-dimensional profile, not the exterior surface area of a three-dimensional wing. The result is a scalar: a single magnitude with an associated unit.

### Calculate the Surface Area

1. Add a **Surface Area** block to the notebook.
2. Set the Profile input of the **Surface Area** block to Airfoil Profile.
3. Review the calculated value and its units.

### Export the Scalar Value

nTop retains units as part of a scalar. A plain-text file does not retain nTop's data type, so the value must first be formatted as text with an explicit reference and precision.

1. Add a **Text from Scalar** block and connect the area to its *Value* input.
2. Set *Reference* to the desired area unit, such as 1 mm². The exported number will be expressed relative to this value.
3. Set *Precision* to the number of significant digits needed by the downstream workflow.
4. Add an **Export Text** block, connect the formatted value to its *Text* input, and choose the output *Path*.
5. Open the exported file and confirm that the number corresponds to the value displayed in nTop.

**Export Text** keeps the workflow compact for a single result. For larger datasets, use **Export Table** for organized tabular values or **Export Point Map** for values associated with spatial points. Both blocks can export data in CSV format.

<Frame>
  <img src="https://files.learn.ntop.com/Courses/nTop%20Foundational%20Learning%20Course/Course%203/Images/airfoil%20surface%20area%20block.jpg" />
</Frame>

*Complete scalar-export workflow: Surface Area evaluates the airfoil profile, **Text from Scalar** formats the value in mm², and **Export Text** writes the result to a neutral lesson path*

<Frame>
  <img src="https://files.learn.ntop.com/Courses/nTop%20Foundational%20Learning%20Course/Course%203/Images/surface%20area%20text%20file.jpg" />
</Frame>

*The exported text file contains the formatted surface-area value*

## Import Mesh and CAD Geometry

Mesh and CAD files can describe the same physical part, but they represent its boundary differently. A mesh approximates the boundary with discrete faces. CAD geometry uses mathematically defined curves and surfaces. Converting either source to an implicit body gives subsequent implicit modeling blocks a common data type. The steps below use explicit import and conversion blocks so that each data-type change is visible. You can also drag supported files into nTop and access available conversion operations by right-clicking selected geometry.

Please refer to the following files as you work through this section:

Example Mesh: [Mesh File Download](https://files.learn.ntop.com/Courses/nTop%20Foundational%20Learning%20Course/Course%203/nTop%20Files/Example%20Bracket%20mesh.STL)

Example CAD: [CAD File Download](https://files.learn.ntop.com/Courses/nTop%20Foundational%20Learning%20Course/Course%203/nTop%20Files/Example%20Bracket%20CAD.STEP)

### Import and Convert a Mesh

1. Add an **Import Mesh** block, select the provided file with the *Path* input, and set *Units* to the units used when the mesh was exported. Alternatively, drag the mesh file into nTop, then confirm that the imported mesh uses the correct units.
2. Inspect the imported mesh for obvious holes or disconnected regions. In the Properties panel, confirm that it is closed, manifold, oriented, and not self-intersecting. Closed means no open boundary edges; manifold means each edge has an unambiguous surface connection; oriented means the face directions are consistent; and non-self-intersecting means no faces cross one another.
3. Add an **Implicit Body from Mesh** block and connect the imported mesh to its *Mesh* input.
4. Toggle the visibility of the mesh and implicit body, or use a section view, to compare their boundaries.

<Frame>
  <img src="https://files.learn.ntop.com/Courses/nTop%20Foundational%20Learning%20Course/Course%203/Images/import%20mesh.jpg" />
</Frame>

***Import Mesh** loads the bracket in millimeters, and **Implicit Body from Mesh** converts it for downstream implicit operations*

<Frame>
  <img src="https://files.learn.ntop.com/Courses/nTop%20Foundational%20Learning%20Course/Course%203/Images/imported%20mesh%20body.jpg" />
</Frame>

*The imported bracket displayed with facet edges visible, making its triangulated surface representation clear*

The **Import Mesh** block may report that duplicate or very close vertices were merged and that unreferenced or invalid vertices were removed. This is automatic cleanup, not proof that the mesh is valid. Recheck the Properties panel before continuing.

The implicit conversion uses the triangulated mesh boundary as its source. It cannot restore detail missing from the original triangles, so mesh resolution and topology remain important.

### Import and Convert CAD Geometry

1. Add an **Import Part** block and select the provided CAD file with the *Path* input.
2. Extract a single CAD body from the imported part. You can drag the individual body property into the notebook or use **Get CAD Bodies** when a block-based selection is more appropriate. Do not pass a CAD body list to an input that expects one body. Refer to the image below on where to find the body in the properties menu.

<Frame>
  <img src="https://files.learn.ntop.com/Courses/nTop%20Foundational%20Learning%20Course/Course%203/Images/imported%20bracket%20properties.jpg" />
</Frame>

*The properties panel showing where the single CAD Body can be found under List Elements*

3. Add an **Implicit Body from CAD Body** block and connect the selected body to the *CAD Body* input.
4. Set the *Tolerance* to the maximum permitted deviation between the CAD source and the implicit result. Use a smaller value when the part contains important small features or thin regions.
5. Compare the CAD and implicit boundaries to confirm that small features and thin regions were captured.

The images below show the same bracket in the original CAD platform and after being imported into nTop. Compare the overall shape, holes, fillets, and thin regions before relying on the geometry downstream.

<Frame>
  <img src="https://files.learn.ntop.com/Courses/nTop%20Foundational%20Learning%20Course/Course%203/Images/CAD%20bracket.jpg" />
</Frame>

*The example bracket in the source CAD application before export*

<Frame>
  <img src="https://files.learn.ntop.com/Courses/nTop%20Foundational%20Learning%20Course/Course%203/Images/CAD%20in%20nTop%20bracket.jpg" />
</Frame>

*The same bracket displayed in nTop after import, confirming that the intended CAD geometry was loaded*

<Frame>
  <img src="https://files.learn.ntop.com/Courses/nTop%20Foundational%20Learning%20Course/Course%203/Images/Import%20part%20bracket.jpg" />
</Frame>

*Import Part loads a single bracket body, which is connected to **Implicit Body from CAD Body** with a 0.01 mm tolerance*

If the implicit result softens or merges a small feature, reduce the *Tolerance* and recalculate. Smaller values generally preserve more detail but require more computation.

## Compare the Data Paths

The three workflows produce nTop data types that can be used in downstream operations, but each has a different source of uncertainty:

* CSV coordinates depend on formatting, units, point order, and clean profile closure.
* Mesh geometry depends on tessellation resolution and mesh topology.
* CAD-to-implicit conversion depends on the selected body and conversion tolerance.

Conversion does not correct problems in the source data. Incorrectly ordered CSV points, a coarse or invalid mesh, or CAD features smaller than the selected tolerance can affect the converted result. Verification is therefore part of importing data, not an optional cleanup step.

## What to Take Away

* External files enter nTop as specific data types, and those types determine which downstream operations are available.
* A coordinate CSV becomes geometry only after nTop interprets its values as ordered points, a curve, and a profile.
* Mesh and CAD geometry can both be converted to implicit bodies, but source quality and conversion settings affect the fidelity of the result.
* The **Surface Area** block returns a scalar value that can be formatted with controlled units and precision before export.
* Every imported or converted result should be checked before it is used downstream.

## What's Next

You can now bring coordinate, mesh, and CAD data into nTop, convert each source into a usable representation, verify the result, and export a calculated value. These skills provide the data-handling foundation for workflows that connect nTop with other engineering tools.

Next, you will apply this workflow in a knowledge check by identifying the appropriate import, conversion, validation, and export steps for different external data types.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.