API

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. The word disc is a bit of a misnomer, since you can use it to create any kind of regular polygon. The number of sides depends on the value given to tessellation. The larger this value, the closer it is to an actual disc. Using the arc option, you can create a sector.

MeshBuilder

Usage :

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

Examples

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

Mesh

Usage :

import { Mesh } from "@babylonjs/core/Meshes/mesh";
const disc = Mesh.CreateDisc("disc", radius, tessellation, scene);
const disc = Mesh.CreateDisc("disc", radius, tessellation, scene, updatable, sideOrientation); //optional parameters after scene