> ## 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.

# .NET Examples

Examples of interacting with the nTop Core library from C#.

Note: At present these do not function with \*nix environments.

## Setup

These examples require [.NET 7](https://dotnet.microsoft.com/en-us/download/dotnet/7.0) on the host system.

If you are working from a Unix-like environment you will need to modify the variable `_dllLocation` in `CoreWrapper/ImplicitBody.cs` to point at the location of the shared object file.

All three examples share a common `CoreWrapper` project, which provides the P/Invoke bindings to the native nTop Core library.

### Mesher

This is a simple mesh generation implementation using marching cubes which highlights use of the `ntop_core_query_field` and `ntop_core_query_bounding_box`.

To run it from the `examples/dotnet` directory:

```shell theme={null}
dotnet run --project Mesher/Mesher.csproj
```

It will output the location of the STL which you can load in the viewer of your choice.

Note that the implementation may not produce closed or non-self-intersecting meshes.
This is just to highlight how you may integrate nTop Core into your workflow.

For a more production-ready implementation consider using [OpenVDB](https://www.openvdb.org/).

See the full source: [Mesher](/Product-Documentation/ntop-core/examples/dotnet/mesher).

### Slicer

This produces images of the contours of a slice of the median axis-aligned plane of the implicit body.
This highlights use of `ntop_core_query_contours`.

To run it from the `examples/dotnet` directory:

```shell theme={null}
dotnet run --project Slicer/Slicer.csproj
```

This will output `slice.png` in this directory.

See the full source: [Slicer](/Product-Documentation/ntop-core/examples/dotnet/slicer).

### Volume

This calculates the volume of an implicit body using a volumetric calculation.

To run it from the `examples/dotnet` directory:

```shell theme={null}
dotnet run --project Volume/Volume.csproj
```

See the full source: [Volume](/Product-Documentation/ntop-core/examples/dotnet/volume).
