# Mesh Tools

{% hint style="success" %}

#### Like what you are seeing?

Support us as a [GitHub Sponsor](/old-kb/where-to-buy/become-a-sponsor.md) and get instant access to all our assets, exclusive tools and assets, escalated support and issue tracking and our gratitude.\
\
These articles are made possible by our [GitHub Sponsors](/old-kb/where-to-buy/become-a-sponsor.md) ... become a sponsor today!
{% endhint %}

## Introduction

```csharp
public static class MeshTools
```

Found in namespace:

```csharp
using HeathenEngineering.UnityPhysics.API;
```

{% hint style="info" %}
We recommend using aliases to reduce typing and simplify names. and reduce possible collisions with similarly named objects.

```csharp
using API = HeathenEngineering.UnityPhysics.API;
```

doing this you can fully qualify the name of this class as

```csharp
API.MeshTools
```

{% endhint %}

### What can it do?

Mesh tools is used to create convex hulls, calculate the volume of a mesh, find surface area and various other geometry functions handy when your working on physics problems.

## Convex Hull

The most common use of mesh tools is to create a convex hull. You can get a convex hull for a single mesh, multiple mesh or for any collection of points in space.

```csharp
var mesh = MeshTools.ConvexHull(meshfilters);
```

```csharp
var mesh = MeshTools.ConvexHull(meshes);
```

```csharp
var mesh = MeshTools.ConvexHull(vertexList);
```

## Mesh Volume

You can find the volume of a mesh, or find the convex hull of a mesh then find the volume of that

```csharp
var volume = MeshTools.VolumeOfConvexMesh(mesh, scale);
```

or

```csharp
var volume = MeshTools.VolumeOfMesh(mesh, scale);
```

## Surface Area

### Whole Mesh

```csharp
var surface = MeshTools.SurfaceArea(mesh);
```

### Cross Section area

```csharp
var surface = MeshTools.FacingSurfaceArea(mesh, direction);
```

## Area and Volume

A quick short cut to do both&#x20;

```csharp
MeshTools.GetAreaAndVolume(mesh, scale, out surface, out volume);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kb.heathen.group/old-kb/toolkit-for-physics/physkit/api/mesh-tools.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
