Lathe

Lathe

A lathed shape is created by defining a shape profile using vector3 coordinates in the xy plane. The shape profile will be rotated around the y axis to form the lather shape. It is recommended that all the x values are positive. You must set at least the shape option.

On creation the local origin of a lathed shape is coincident with the world origin. It is not possible to give a position relative to the constructed shape as this depends on the data sets used.

There in no instance option for lathed shapes

MeshBuilder

Usage :

const lathe = BABYLON.MeshBuilder.CreateLathe("lathe", options, scene); //scene is optional and defaults to the current scene
optionvaluedefault value
option
shape
value
(Vector3[]) array of Vector3, the shape you want to turn REQUIRED
default value
 
option
radius
value
(number) the value to radius of the lathe
default value
1
option
tessellation
value
(number) the number of iteration around the lathe
default value
64
option
arc
value
(number) ratio of the circumference between 0 and 1
default value
1
option
cap
value
(number) tube cap : NO_CAP, CAP_START, CAP_END, CAP_ALL
default value
NO_CAP
option
closed
value
(boolean) to open/close the lathe circumference, should be set to false when used with arc
default value
true
option
updatable
value
(boolean) true if the mesh is updatable
default value
false
option
sideOrientation
value
(number) side orientation
default value
DEFAULTSIDE
option
frontUVs
value
(Vector4) ONLY WHEN sideOrientation:BABYLON.Mesh.DOUBLESIDE is an option
default value
Vector4(0,0, 1,1)
option
backUVs
value
(Vector4) ONLY WHEN sideOrientation:BABYLON.Mesh.DOUBLESIDE is an option
default value
Vector4(0,0, 1,1)
option
invertUV
value
(boolean) to swap the U and V coordinates at geometry construction time (texture rotation of 90°)
default value
false

The radius value is a multiplier for the x values in the profile shape vector3s.

Examples

Lathed shape: Lathed Shape Example Hexagonal nut: Lathed Hexagonal Nut
Arc: Lathed Arc

Mesh

Usage:

let lathe = BABYLON.Mesh.CreateLathe("lathe", shape, radius, tessellation, scene);
let lathe = BABYLON.Mesh.CreateLathe("lathe", shape, radius, tessellation, scene, updatable, sideOrientation); //optional parameters after scene

Note the limited parameters for this method