circle.lua 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. return {
  2. tag = 'drawing',
  3. summary = 'Draw a circle.',
  4. description = 'Draws a circle.',
  5. arguments = {
  6. x = {
  7. type = 'number',
  8. default = '0',
  9. description = 'The x coordinate of the center of the circle.'
  10. },
  11. y = {
  12. type = 'number',
  13. default = '0',
  14. description = 'The y coordinate of the center of the circle.'
  15. },
  16. z = {
  17. type = 'number',
  18. default = '0',
  19. description = 'The z coordinate of the center of the circle.'
  20. },
  21. radius = {
  22. type = 'number',
  23. default = '1',
  24. description = 'The radius of the circle.'
  25. },
  26. angle = {
  27. type = 'number',
  28. default = '0',
  29. description = 'The rotation of the circle around its rotation axis, in radians.'
  30. },
  31. ax = {
  32. type = 'number',
  33. default = '0',
  34. description = 'The x component of the axis of rotation.'
  35. },
  36. ay = {
  37. type = 'number',
  38. default = '1',
  39. description = 'The y component of the axis of rotation.'
  40. },
  41. az = {
  42. type = 'number',
  43. default = '0',
  44. description = 'The z component of the axis of rotation.'
  45. },
  46. position = {
  47. type = 'Vec3',
  48. description = 'The position of the circle.'
  49. },
  50. orientation = {
  51. type = 'Quat',
  52. description = 'The orientation of the circle.'
  53. },
  54. transform = {
  55. type = 'Mat4',
  56. description = 'The transform of the circle.'
  57. },
  58. style = {
  59. type = 'DrawStyle',
  60. default = [['fill']],
  61. description = 'Whether the circle should be filled or outlined.'
  62. },
  63. angle1 = {
  64. type = 'number',
  65. default = '0',
  66. description = 'The angle of the beginning of the arc.'
  67. },
  68. angle2 = {
  69. type = 'number',
  70. default = '2 * math.pi',
  71. description = 'angle of the end of the arc.'
  72. },
  73. segments = {
  74. type = 'number',
  75. default = '64',
  76. description = 'The number of segments to render.'
  77. }
  78. },
  79. returns = {},
  80. variants = {
  81. {
  82. arguments = { 'x', 'y', 'z', 'radius', 'angle', 'ax', 'ay', 'az', 'style', 'angle1', 'angle2', 'segments' },
  83. returns = {}
  84. },
  85. {
  86. arguments = { 'position', 'radius', 'orientation', 'style', 'angle1', 'angle2', 'segments' },
  87. returns = {}
  88. },
  89. {
  90. arguments = { 'transform', 'style', 'angle1', 'angle2', 'segments' },
  91. returns = {}
  92. }
  93. },
  94. notes = [[
  95. The local origin of the circle is in its center. The local z axis is perpendicular to the
  96. circle.
  97. ]]
  98. }