Function CreateTube
-
CreateTube(
name: string,
options: {
arc?: number;
backUVs?: Vector4;
cap?: number;
frontUVs?: Vector4;
instance?: Mesh;
invertUV?: boolean;
path: Vector3[];
radius?: number;
radiusFunction?: (i: number, distance: number) => number;
sideOrientation?: number;
tessellation?: number;
updatable?: boolean;
},
scene?: Nullable<Scene>,
): MeshParameters
- name: string
defines the name of the mesh
- options: {
arc?: number;
backUVs?: Vector4;
cap?: number;
frontUVs?: Vector4;
instance?: Mesh;
invertUV?: boolean;
path: Vector3[];
radius?: number;
radiusFunction?: (i: number, distance: number) => number;
sideOrientation?: number;
tessellation?: number;
updatable?: boolean;
}defines the options used to create the mesh
- scene: Nullable<Scene> = null
defines the hosting scene
Returns Mesh
the tube mesh
- name: string
Creates a tube mesh. The tube is a parametric shape. It has no predefined shape. Its final shape will depend on the input parameters
pathis a required array of successive Vector3. It is the curve used as the axis of the tuberadius(positive float, default 1) sets the tube radius sizetessellation(positive float, default 64) is the number of sides on the tubular surfaceradiusFunction(javascript function, default null) is a vanilla javascript function. If it is not null, it overrides the parameterradiusiof the i-th point and the distance of this point from the first point of the path. It must return a radius value (positive float)arc(positive float, maximum 1, default 1) is the ratio to apply to the tube circumference : 2 x PI x arccapsets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALLinstanceis an instance of an existing Tube object to be updated with the passedpathArrayparameter. ThepathArray HAS to have the SAME number of points as the previous one: https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#tubefrontUVsandbackUVs(Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientationinvertUV(boolean, default false) swaps in the geometry the U and V coordinates to apply a textureupdatable(default false) if its internal geometry is supposed to change once created. The NUMBER of points CAN'T CHANGE, only their positions.