getTriangles.lua 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. return {
  2. summary = 'Get all the triangles in the Model.',
  3. description = [[
  4. Returns 2 tables containing mesh data for the Model.
  5. The first table is a list of vertex positions and contains 3 numbers for the x, y, and z
  6. coordinate of each vertex. The second table is a list of triangles and contains 1-based indices
  7. into the first table representing the first, second, and third vertices that make up each
  8. triangle.
  9. The vertex positions will be affected by node transforms.
  10. ]],
  11. arguments = {},
  12. returns = {
  13. vertices = {
  14. type = 'table',
  15. description = [[
  16. The triangle vertex positions, returned as a flat (non-nested) table of numbers. The
  17. position of each vertex is given as an x, y, and z coordinate.
  18. ]]
  19. },
  20. indices = {
  21. type = 'table',
  22. description = 'The vertex indices. Every 3 indices describes a triangle.'
  23. }
  24. },
  25. variants = {
  26. {
  27. arguments = {},
  28. returns = { 'vertices', 'indices' }
  29. }
  30. },
  31. notes = 'After this function is called on a Model once, the result is cached (in its ModelData).',
  32. related = {
  33. 'Model:getTriangleCount',
  34. 'Model:getVertexCount',
  35. 'Model:getMesh',
  36. 'ModelData:getTriangles'
  37. }
  38. }