Lathe
Lathe
A lathed shape is created by defining a shape profile using Vector3 coordinates in the xy plane. The shape profile is rotated around the y axis to form the lathed shape. It is recommended that all 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 is no instance option for lathed shapes.
MeshBuilder
Usage :
import { MeshBuilder } from "@babylonjs/core/Meshes/meshBuilder";const lathe = MeshBuilder.CreateLathe("lathe", options, scene); //scene is optional and defaults to the current scene| option | value | default value |
|---|---|---|
| shape | (Vector3[]) array of Vector3, the shape you want to turn REQUIRED | |
| radius | (number) the radius value of the lathe | 1 |
| tessellation | (number) the number of iterations around the lathe | 64 |
| arc | (number) ratio of the circumference between 0 and 1 | 1 |
| cap | (number) tube cap : NO_CAP, CAP_START, CAP_END, CAP_ALL | NO_CAP |
| closed | (boolean) to open/close the lathe circumference, should be set to false when used with arc | true |
| updatable | (boolean) true if the mesh is updatable | false |
| sideOrientation | (number) side orientation | DEFAULTSIDE |
| frontUVs | (Vector4) ONLY WHEN sideOrientation:BABYLON.Mesh.DOUBLESIDE is an option | Vector4(0,0, 1,1) |
| backUVs | (Vector4) ONLY WHEN sideOrientation:BABYLON.Mesh.DOUBLESIDE is an option | Vector4(0,0, 1,1) |
| invertUV | (boolean) to swap the U and V coordinates at geometry construction time (texture rotation of 90°) | 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:
import { Mesh } from "@babylonjs/core/Meshes/mesh";let lathe = Mesh.CreateLathe("lathe", shape, radius, tessellation, scene);let lathe = Mesh.CreateLathe("lathe", shape, radius, tessellation, scene, updatable, sideOrientation); //optional parameters after sceneNote the limited parameters for this method.