TorusKnotBuilder

Class containing static functions to help procedurally build meshes

Hierarchy

  • TorusKnotBuilder

Index

Methods

Methods

Static CreateTorusKnot

Find examples in Playground
  • CreateTorusKnot(name: string, options: object, scene: any): Mesh
  • Creates a torus knot mesh

    • The parameter radius sets the global radius size (float) of the torus knot (default 2)
    • The parameter radialSegments sets the number of sides on each tube segments (positive integer, default 32)
    • The parameter tubularSegments sets the number of tubes to decompose the knot into (positive integer, default 32)
    • The parameters p and q are the number of windings on each axis (positive integers, default 2 and 3)
    • You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
    • If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters frontUVs and backUVs (Vector4). Detail here : https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
    • The mesh can be set to updatable with the boolean parameter updatable (default false) if its internal geometry is supposed to change once created.
    see

    https://doc.babylonjs.com/how_to/set_shapes#torus-knot

    Parameters

    • name: string

      defines the name of the mesh

    • options: object

      defines the options used to create the mesh

      • Optional backUVs?: Vector4
      • Optional frontUVs?: Vector4
      • Optional p?: number
      • Optional q?: number
      • Optional radialSegments?: number
      • Optional radius?: number
      • Optional sideOrientation?: number
      • Optional tube?: number
      • Optional tubularSegments?: number
      • Optional updatable?: boolean
    • scene: any

      defines the hosting scene

    Returns Mesh

    the torus knot mesh

Generated using TypeDoc