latheBuilder.d.ts 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import type { Scene } from "../../scene";
  2. import type { Vector4 } from "../../Maths/math.vector";
  3. import { Vector3 } from "../../Maths/math.vector";
  4. import { Mesh } from "../mesh";
  5. import type { Nullable } from "../../types";
  6. /**
  7. * Creates lathe mesh.
  8. * The lathe is a shape with a symmetry axis : a 2D model shape is rotated around this axis to design the lathe
  9. * * The parameter `shape` is a required array of successive Vector3. This array depicts the shape to be rotated in its local space : the shape must be designed in the xOy plane and will be rotated around the Y axis. It's usually a 2D shape, so the Vector3 z coordinates are often set to zero
  10. * * The parameter `radius` (positive float, default 1) is the radius value of the lathe
  11. * * The parameter `tessellation` (positive integer, default 64) is the side number of the lathe
  12. * * The parameter `clip` (positive integer, default 0) is the number of sides to not create without effecting the general shape of the sides
  13. * * The parameter `arc` (positive float, default 1) is the ratio of the lathe. 0.5 builds for instance half a lathe, so an opened shape
  14. * * The parameter `closed` (boolean, default true) opens/closes the lathe circumference. This should be set to false when used with the parameter "arc"
  15. * * The parameter `cap` sets 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_ALL
  16. * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
  17. * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation
  18. * * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture
  19. * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
  20. * @param name defines the name of the mesh
  21. * @param options defines the options used to create the mesh
  22. * @param scene defines the hosting scene
  23. * @returns the lathe mesh
  24. * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#lathe
  25. */
  26. export declare function CreateLathe(name: string, options: {
  27. shape: Vector3[];
  28. radius?: number;
  29. tessellation?: number;
  30. clip?: number;
  31. arc?: number;
  32. closed?: boolean;
  33. updatable?: boolean;
  34. sideOrientation?: number;
  35. frontUVs?: Vector4;
  36. backUVs?: Vector4;
  37. cap?: number;
  38. invertUV?: boolean;
  39. }, scene?: Nullable<Scene>): Mesh;
  40. /**
  41. * Class containing static functions to help procedurally build meshes
  42. * @deprecated use the function direction from the module
  43. */
  44. export declare const LatheBuilder: {
  45. CreateLathe: typeof CreateLathe;
  46. };