Click or drag to resize
Ab4d.SharpEngine logo

MeshFactoryCreateTorusKnotMesh Method

Create a mesh that represents a Torus knot. Torus knot is a special kind of knot that lies on the surface of an unknotted torus. Similarly, a torus link is a link which lies on the surface of a torus in the same way. Each torus knot is specified by a pair of coprime integers p and q. A torus link arises if p and q are not coprime. A torus knot is trivial (equivalent to the unknot) if and only if either p or q is equal to 1 or −1.

Namespace: Ab4d.SharpEngine.Meshes
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 3.0.9208+3b2441d6a11f923f2600f40f4296bdc3d8b46035
Syntax
C#
public static StandardMesh CreateTorusKnotMesh(
	Vector3 centerPosition,
	int p,
	int q,
	float radius1,
	float radius2,
	float radius3,
	int uSegmentsCount,
	int vSegmentsCount,
	string? name = null
)

Parameters

centerPosition  Vector3
center position
p  Int32
p parameter (number of rotations around its axis of rotational symmetry)
q  Int32
q parameter (number of rotations around a circle in the interior of the torus)
radius1  Single
first radius
radius2  Single
second radius
radius3  Single
third radius
uSegmentsCount  Int32
number of segments along the length of the knot
vSegmentsCount  Int32
number of segments around one knot segment
name  String  (Optional)
Mesh name (for debug purposes).

Return Value

StandardMesh
StandardMesh with filled vertices array and index array.
See Also