Skip to main content
This directory holds self-contained examples of common operations you may want to perform using nTop Core library. This is setup as a CMake project which will generate separate executables for each of the example application.

Setup

The examples have been tested against CMake. gnuplot is required to draw the images generated by the slicer example, being sure to add it to the PATH environment variable. Now compile the project:
mkdir build
cd build

# In windows (suggested)
cmake .. -DNTOP_CORE_LIB_DIR="C:/path/to/ntop_core_folder"
msbuild cppexamples.sln

# In *nix
cmake .. -DNTOP_CORE_LIB_DIR="/path/to/ntop_core_folder"
cmake --build .

Running the examples

You are now ready to run any of the examples using pattern similar to the following:
# Windows
.\bin\slice.exe

# *nix
# Note: Depending on your distro some programs may print extraneous warning messages
# in the slice demonstration due to a Qt implementation which may not be yet included
# by your package manager. It will not impact the behavior and is limited to visualization
# using matplotplusplus.

.\bin\slice

Example Applications

  • Bounding Box — computes the bounding box of an implicit body.
  • Closest Point — finds the closest point on an implicit body’s surface to a set of query points.
  • Slice — transforms an implicit body into a build orientation and slices it with a plane using dual contouring.
  • Slice (Legacy) — slices an implicit body with a plane using the legacy marching-squares algorithm.
  • Volume — computes the volume of an implicit body using a voxel-counting method.