> For the complete documentation index, see [llms.txt](https://kinematicsoup.gitbook.io/reactor/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kinematicsoup.gitbook.io/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.kscylindermeshfactory.md).

# Class ksCylinderMeshFactory

Namespace: [KS.Reactor.Client.Unity](/reactor/api-reference/ks.reactor.client.unity.md)\
Assembly: KSUnity-Source.dll

Factory for generating cylinder meshes. Caches meshes for resuse.

```csharp
public class ksCylinderMeshFactory
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ← [ksCylinderMeshFactory](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.kscylindermeshfactory.md)

#### Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object\)), [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object-system-object\)), [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype), [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Methods

### GenerateMesh(float, float, Axis, int) <a href="#ks_reactor_client_unity_kscylindermeshfactory_generatemesh_system_single_system_single_ks_reactor_ks" id="ks_reactor_client_unity_kscylindermeshfactory_generatemesh_system_single_system_single_ks_reactor_ks"></a>

Gets a cylinder mesh from the cache or generates one.

```csharp
public Mesh GenerateMesh(float radius, float height, ksShape.Axis direction, int numSides)
```

#### Parameters

`radius` [float](https://learn.microsoft.com/dotnet/api/system.single)

Radius of the cylinder.

`height` [float](https://learn.microsoft.com/dotnet/api/system.single)

Height of the cylinder.

`direction` [ksShape](/reactor/api-reference/ks.reactor/ks.reactor.ksshape.md).[Axis](/reactor/api-reference/ks.reactor/ks.reactor.ksshape/ks.reactor.ksshape.axis.md)

Axis alignment.

`numSides` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Number of sides used to appoximate the cylinder.

#### Returns

Mesh

Cylinder mesh

### GenerateTriangles(int) <a href="#ks_reactor_client_unity_kscylindermeshfactory_generatetriangles_system_int32" id="ks_reactor_client_unity_kscylindermeshfactory_generatetriangles_system_int32"></a>

```csharp
public static int[] GenerateTriangles(int numSides)
```

#### Parameters

`numSides` [int](https://learn.microsoft.com/dotnet/api/system.int32)

#### Returns

[int](https://learn.microsoft.com/dotnet/api/system.int32)\[]

### GenerateVertices(float, float, Axis, int) <a href="#ks_reactor_client_unity_kscylindermeshfactory_generatevertices_system_single_system_single_ks_reacto" id="ks_reactor_client_unity_kscylindermeshfactory_generatevertices_system_single_system_single_ks_reacto"></a>

```csharp
public static Vector3[] GenerateVertices(float radius, float height, ksShape.Axis direction, int numSides)
```

#### Parameters

`radius` [float](https://learn.microsoft.com/dotnet/api/system.single)

`height` [float](https://learn.microsoft.com/dotnet/api/system.single)

`direction` [ksShape](/reactor/api-reference/ks.reactor/ks.reactor.ksshape.md).[Axis](/reactor/api-reference/ks.reactor/ks.reactor.ksshape/ks.reactor.ksshape.axis.md)

`numSides` [int](https://learn.microsoft.com/dotnet/api/system.int32)

#### Returns

Vector3\[]

### GetMesh(float, float, Axis, int) <a href="#ks_reactor_client_unity_kscylindermeshfactory_getmesh_system_single_system_single_ks_reactor_ksshape" id="ks_reactor_client_unity_kscylindermeshfactory_getmesh_system_single_system_single_ks_reactor_ksshape"></a>

Gets a cylinder mesh from the cache or generates one.

```csharp
public static Mesh GetMesh(float radius, float height, ksShape.Axis direction, int numSides)
```

#### Parameters

`radius` [float](https://learn.microsoft.com/dotnet/api/system.single)

Radius of the cylinder.

`height` [float](https://learn.microsoft.com/dotnet/api/system.single)

Height of the cylinder.

`direction` [ksShape](/reactor/api-reference/ks.reactor/ks.reactor.ksshape.md).[Axis](/reactor/api-reference/ks.reactor/ks.reactor.ksshape/ks.reactor.ksshape.axis.md)

Axis alignment.

`numSides` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Number of sides used to appoximate the cylinder.

#### Returns

Mesh

Cylinder mesh
