cylinder.lua 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. return {
  2. tag = 'graphicsPrimitives',
  3. summary = 'Draw a cylinder.',
  4. description = 'Draws a cylinder.',
  5. arguments = {
  6. material = {
  7. type = 'Material',
  8. description = 'The Material to apply to the cylinder.'
  9. },
  10. x = {
  11. type = 'number',
  12. default = '0',
  13. description = 'The x coordinate of the center of the cylinder.'
  14. },
  15. y = {
  16. type = 'number',
  17. default = '0',
  18. description = 'The y coordinate of the center of the cylinder.'
  19. },
  20. z = {
  21. type = 'number',
  22. default = '0',
  23. description = 'The z coordinate of the center of the cylinder.'
  24. },
  25. length = {
  26. type = 'number',
  27. default = '1',
  28. description = 'The length of the cylinder, in meters.'
  29. },
  30. angle = {
  31. type = 'number',
  32. default = '0',
  33. description = 'The rotation of the cylinder around its rotation axis, in radians.'
  34. },
  35. ax = {
  36. type = 'number',
  37. default = '0',
  38. description = 'The x coordinate of the cylinder\'s axis of rotation.'
  39. },
  40. ay = {
  41. type = 'number',
  42. default = '1',
  43. description = 'The y coordinate of the cylinder\'s axis of rotation.'
  44. },
  45. az = {
  46. type = 'number',
  47. default = '0',
  48. description = 'The z coordinate of the cylinder\'s axis of rotation.'
  49. },
  50. r1 = {
  51. type = 'number',
  52. default = '1',
  53. description = 'The radius of one end of the cylinder.'
  54. },
  55. r2 = {
  56. type = 'number',
  57. default = '1',
  58. description = 'The radius of the other end of the cylinder.'
  59. },
  60. capped = {
  61. type = 'boolean',
  62. default = 'true',
  63. description = 'Whether the top and bottom should be rendered.'
  64. },
  65. segments = {
  66. type = 'number',
  67. default = 'nil',
  68. description = [[
  69. The number of radial segments to use for the cylinder. If nil, the segment count is
  70. automatically determined from the radii.
  71. ]]
  72. }
  73. },
  74. returns = {},
  75. variants = {
  76. {
  77. arguments = { 'x', 'y', 'z', 'length', 'angle', 'ax', 'ay', 'az', 'r1', 'r2', 'capped', 'segments' },
  78. returns = {}
  79. },
  80. {
  81. arguments = { 'material', 'x', 'y', 'z', 'length', 'angle', 'ax', 'ay', 'az', 'r1', 'r2', 'capped', 'segments' },
  82. returns = {}
  83. }
  84. },
  85. notes = [[
  86. Currently, cylinders don't have UVs.
  87. ]]
  88. }