Creating A Disc

Disc or Regular Polygon

The created disc is a flat surface parallel to the xy plane with its origin at the center of the disc. Disc is a little bit of a misnomer since you can use it to create any kind of regular polygon. The number of sides is dependent on the value given to tessellation. The larger this value the closer to an actual disc. Using the arc option you can create a sector.

MeshBuilder

Usage :

const disc = BABYLON.MeshBuilder.CreateDisc("disc", options, scene); //scene is optional and defaults to the current scene
optionvaluedefault value
option
radius
value
(number) the radius of the disc or polygon
default value
0.5
option
tessellation
value
(number) the number of disc/polygon sides
default value
64
option
arc
value
(number) ratio of the circumference between 0 and 1
default value
1
option
updatable
value
(boolean) true if the mesh is updatable
default value
false
option
sideOrientation
value
(number) side orientation
default value
DEFAULTSIDE

Examples

Disc: Create a Disc Triangle: Create a Triangle Sector: Create a Sector

Mesh

Usage :

const disc = BABYLON.Mesh.CreateDisc("disc", radius, tessellation, scene);
const disc = BABYLON.Mesh.CreateDisc("disc", radius, tessellation, scene, updatable, sideOrientation); //optional parameters after scene

.