Function CreateCylinder
-
CreateCylinder(
name: string,
options?: {
arc?: number;
backUVs?: Vector4;
cap?: number;
diameter?: number;
diameterBottom?: number;
diameterTop?: number;
enclose?: boolean;
faceColors?: Color4[];
faceUV?: Vector4[];
frontUVs?: Vector4;
hasRings?: boolean;
height?: number;
sideOrientation?: number;
subdivisions?: number;
tessellation?: number;
updatable?: boolean;
},
scene?: Nullable<Scene>,
): MeshParameters
- name: string
defines the name of the mesh
- options: {
arc?: number;
backUVs?: Vector4;
cap?: number;
diameter?: number;
diameterBottom?: number;
diameterTop?: number;
enclose?: boolean;
faceColors?: Color4[];
faceUV?: Vector4[];
frontUVs?: Vector4;
hasRings?: boolean;
height?: number;
sideOrientation?: number;
subdivisions?: number;
tessellation?: number;
updatable?: boolean;
} = {}defines the options used to create the mesh
Optionalscene: Nullable<Scene>defines the hosting scene
Returns Mesh
the cylinder mesh
- name: string
Creates a cylinder or a cone mesh
heightsets the height size (float) of the cylinder/cone (float, default 2).diametersets the diameter of the top and bottom cap at once (float, default 1).diameterTopanddiameterBottomoverwrite the parameterdiameterand set respectively the top cap and bottom cap diameter (floats, default 1). The parameter "diameterBottom" can't be zero.tessellationsets the number of cylinder sides (positive integer, default 24). Set it to 3 to get a prism for instance.subdivisionssets the number of rings along the cylinder height (positive integer, default 1).hasRings(boolean, default false) makes the subdivisions independent from each other, so they become different faces.enclose(boolean, default false) adds two extra faces per subdivision to a sliced cylinder to close it around its height axis.capsets the way the cylinder is capped. Possible values : BABYLON.Mesh.NO_CAP, BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL (default).arc(float, default 1) is the ratio (max 1) to apply to the circumference to slice the cylinder.faceColors(an array of n Color3 elements) andfaceUV(an array of n Vector4 elements).encloseis false, a ring surface is one element.encloseis true, a ring surface is 3 successive elements in the array : the tubular surface, then the two closing faces.frontUVsandbackUVs(Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientationupdatable(default false) if its internal geometry is supposed to change once created.