DiscBuilder

Class containing static functions to help procedurally build meshes

Hierarchy

  • DiscBuilder

Index

Methods

Methods

Static CreateDisc

Find examples in Playground
  • Creates a plane polygonal mesh. By default, this is a disc

    • The parameter radius sets the radius size (float) of the polygon (default 0.5)
    • The parameter tessellation sets the number of polygon sides (positive integer, default 64). So a tessellation valued to 3 will build a triangle, to 4 a square, etc
    • You can create an unclosed polygon with the parameter arc (positive float, default 1), valued between 0 and 1, what is the ratio of the circumference : 2 x PI x ratio
    • 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#disc-or-regular-polygon

    Parameters

    • name: string

      defines the name of the mesh

    • options: object

      defines the options used to create the mesh

      • Optional arc?: number
      • Optional backUVs?: Vector4
      • Optional frontUVs?: Vector4
      • Optional radius?: number
      • Optional sideOrientation?: number
      • Optional tessellation?: number
      • Optional updatable?: boolean
    • Optional scene: Nullable<Scene>

      defines the hosting scene

    Returns Mesh

    the plane polygonal mesh

Generated using TypeDoc