goldbergBuilder.d.ts 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import type { Scene } from "../../scene";
  2. import { VertexData } from "../mesh.vertexData";
  3. import type { Nullable } from "../../types";
  4. import type { PolyhedronData } from "../geodesicMesh";
  5. import { GoldbergMesh } from "../goldbergMesh";
  6. /**
  7. * Defines the set of data required to create goldberg vertex data.
  8. */
  9. export type GoldbergVertexDataOption = {
  10. /**
  11. * the size of the Goldberg, optional default 1
  12. */
  13. size?: number;
  14. /**
  15. * allows stretching in the x direction, optional, default size
  16. */
  17. sizeX?: number;
  18. /**
  19. * allows stretching in the y direction, optional, default size
  20. */
  21. sizeY?: number;
  22. /**
  23. * allows stretching in the z direction, optional, default size
  24. */
  25. sizeZ?: number;
  26. /**
  27. * optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
  28. */
  29. sideOrientation?: number;
  30. };
  31. /**
  32. * Defines the set of data required to create a goldberg mesh.
  33. */
  34. export type GoldbergCreationOption = {
  35. /**
  36. * number of horizontal steps along an isogrid
  37. */
  38. m?: number;
  39. /**
  40. * number of angled steps along an isogrid
  41. */
  42. n?: number;
  43. /**
  44. * defines if the mesh must be flagged as updatable
  45. */
  46. updatable?: boolean;
  47. } & GoldbergVertexDataOption;
  48. /**
  49. * Creates the Mesh for a Goldberg Polyhedron
  50. * @param options an object used to set the following optional parameters for the polyhedron, required but can be empty
  51. * @param goldbergData polyhedronData defining the Goldberg polyhedron
  52. * @returns GoldbergSphere mesh
  53. */
  54. export declare function CreateGoldbergVertexData(options: GoldbergVertexDataOption, goldbergData: PolyhedronData): VertexData;
  55. /**
  56. * Creates the Mesh for a Goldberg Polyhedron which is made from 12 pentagonal and the rest hexagonal faces
  57. * @see https://en.wikipedia.org/wiki/Goldberg_polyhedron
  58. * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/polyhedra/goldberg_poly
  59. * @param name defines the name of the mesh
  60. * @param options an object used to set the following optional parameters for the polyhedron, required but can be empty
  61. * @param scene defines the hosting scene
  62. * @returns Goldberg mesh
  63. */
  64. export declare function CreateGoldberg(name: string, options: GoldbergCreationOption, scene?: Nullable<Scene>): GoldbergMesh;