Click or drag to resize
Ab4d.SharpEngine logo

MeshFactoryCreateCircleMesh Method

Create a 3D mesh representing a flat 2D circle.

Namespace: Ab4d.SharpEngine.Meshes
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
Syntax
C#
public static StandardMesh CreateCircleMesh(
	Vector3 centerPosition,
	Vector3 normal,
	Vector3 upDirection,
	float radius,
	int segments,
	string? name = null
)

Parameters

centerPosition  Vector3
Position of the circle's center.
normal  Vector3
Direction of the normal vector (perpendicular to circle's surface).
upDirection  Vector3
Direction of vector along the circle's surface (the up vector of the 2D shape).
radius  Single
Radius of the circle.
segments  Int32
Number of segments/points comprising the circle's edge.
name  String  (Optional)
Mesh name (for debug purposes).

Return Value

StandardMesh
StandardMesh with filled vertices array and index array.
Exceptions
ExceptionCondition
ArgumentExceptionThrown when attempting to create circle with fewer than 3 segments (edge points).
See Also