# MeshPart record

> One piece of a ColliderShape.Mesh: triangles over corners of its own, and what they're made of, so one mesh can be concrete in one place and metal in another.

Namespace `EvilEngine.Formats.Collision`, assembly `EvilEngine.Formats`. Engine commit 4ff877b1.

```csharp
public sealed record MeshPart
```

One piece of a [ColliderShape.Mesh](/docs/api/collidershape-mesh): triangles over corners of its own, and what they're made of, so one mesh can be concrete in one place and metal in another.

```csharp
new MeshPart([new(-5, 0, -5), new(5, 0, -5), new(-5, 0, 5), new(5, 0, 5)], [0, 2, 1, 1, 2, 3], CollisionSurface.None)
```

## Members

### MeshPart (constructor)

```csharp
public MeshPart(Vector3[] Positions, uint[] Indices, CollisionSurface Surface)
```

Makes a part from its corners, its triangles and its surface.

### Positions (property)

```csharp
public Vector3[] Positions { get; init; }
```

The corners in metres, in the collider's own space.

### Indices (property)

```csharp
public uint[] Indices { get; init; }
```

The triangles, three indices into [Positions](#positions) each. A count that isn't a whole number of triangles, or an index past the corners, keeps the mesh from being written.

### Surface (property)

```csharp
public CollisionSurface Surface { get; init; }
```

What these triangles are made of, as a [CollisionSurface](/docs/api/collisionsurface). It's written with the part, where the mesh's own surface isn't.
