Skip to main content
nTop Logo This document describes a library of functions called nTop Core. You can use these functions to derive information from implicit bodies exported from nTop, which can then be used in your own applications. In this way, you achieve interoperability between nTop and your application.

Implicit Bodies

The functions in nTop Core let you work with implicit bodies created in nTop. An implicit body is defined by a function F called its field. Given an implicit body S, and a 3D point P, the value F(P) provides a rough measure of the distance from P to the boundary of S, with F(P) < 0 when P is inside the body, and F(P) > 0 for points outside. Basic Example Diagram One of the functions in nTop Core computes F(P) at any given point P. By calling this function, you can decide which points are inside the body and which are outside, allowing you to implement a variety of applications. For example, you can compute the volume of the body, tessellate it, or slice it for additive manufacturing. The library operates in units of meters so when making queries against a .implicit be sure to convert from your native units.

Why a Library?

A more traditional approach to data interoperability is to have nTop export its models in some standard format that other applications can read. Typical export formats are polygonal meshes, voxel structures, boundary representations (b-reps), and planar slices. nTop has numerous data export functions to support this approach, but it does not work well for certain types of models. Some specific problems are:
  • Meshes, voxels, and slices are approximations with a “baked-in” error.
  • Meshes are extremely large, especially if they are accurate.
  • Exported meshes and b-reps are “dumb” and difficult to edit.
We created nTop Core to address these problems: it allows you to work with highly accurate representations that occupy very little space.

The Basic Idea

The basic flow is shown in the following diagram: Basic Flow Diagram The important steps are:
  1. The nTop user exports a .implicit file containing a representation of an implicit body.
  2. The functions in nTop Core interact with the .implicit file.
  3. Your code calls functions in nTop Core to get information about the implicit body.
Exporting is explained in more detail below; calling nTop Core functions is covered in the C++ API and Python Package sections.

Exporting a .implicit file

There is a block in nTop called “Export Implicit Body” that allows you to export a representation of an implicit body from within an nTop notebook. However, for the purpose of developing your application, it is not absolutely necessary to go through this export step, as we provide some simple .implicit files that you can use for initial testing.

Next steps

  • See the C++ API for calling nTop Core’s native functions directly, and its dependencies.
  • See the Python Package for the Pythonic, NumPy-native wrapper.