Table of Contents

Class MeshExtensions

Namespace
S1MAPI.Extensions
Assembly
S1MAPI_Mono.dll

Extension methods for Mesh operations.

public static class MeshExtensions
Inheritance
MeshExtensions
Inherited Members

Methods

ApplyFlatShading(Mesh)

Apply flat shading to a mesh by duplicating vertices. Creates a low-poly aesthetic by ensuring each triangle has unique vertices.

public static void ApplyFlatShading(this Mesh mesh)

Parameters

mesh Mesh

The mesh to apply flat shading to

CalculateNormals(Mesh, NormalCalculationMode)

Calculate normals for a mesh using a specific calculation mode.

public static void CalculateNormals(this Mesh mesh, NormalCalculationMode mode = NormalCalculationMode.Smooth)

Parameters

mesh Mesh

The mesh to calculate normals for

mode NormalCalculationMode

The normal calculation mode

Clone(Mesh)

Create a clone of this mesh.

public static Mesh Clone(this Mesh mesh)

Parameters

mesh Mesh

Returns

Mesh

GetCenter(Mesh)

Get the center point of the mesh based on bounds.

public static Vector3 GetCenter(this Mesh mesh)

Parameters

mesh Mesh

Returns

Vector3

IsValid(Mesh, bool)

Check if mesh has valid data for rendering.

public static bool IsValid(this Mesh mesh, bool checkVertexLimit = true)

Parameters

mesh Mesh

The mesh to validate

checkVertexLimit bool

Whether to check against Unity's vertex limit

Returns

bool

True if valid, false otherwise

Validate(Mesh)

Validate that a mesh is within Unity's limitations with detailed error reporting.

public static bool Validate(this Mesh mesh)

Parameters

mesh Mesh

The mesh to validate

Returns

bool

True if valid, false otherwise