class_csgpolygon.rst 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the CSGPolygon.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_CSGPolygon:
  5. CSGPolygon
  6. ==========
  7. **Inherits:** :ref:`CSGPrimitive<class_CSGPrimitive>` **<** :ref:`CSGShape<class_CSGShape>` **<** :ref:`VisualInstance<class_VisualInstance>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Extrudes a 2D polygon shape to create a 3D mesh.
  12. Properties
  13. ----------
  14. +---------------------------------------------------+--------------------------------------------------------------+
  15. | :ref:`float<class_float>` | :ref:`depth<class_CSGPolygon_depth>` |
  16. +---------------------------------------------------+--------------------------------------------------------------+
  17. | :ref:`Material<class_Material>` | :ref:`material<class_CSGPolygon_material>` |
  18. +---------------------------------------------------+--------------------------------------------------------------+
  19. | :ref:`Mode<enum_CSGPolygon_Mode>` | :ref:`mode<class_CSGPolygon_mode>` |
  20. +---------------------------------------------------+--------------------------------------------------------------+
  21. | :ref:`bool<class_bool>` | :ref:`path_continuous_u<class_CSGPolygon_path_continuous_u>` |
  22. +---------------------------------------------------+--------------------------------------------------------------+
  23. | :ref:`float<class_float>` | :ref:`path_interval<class_CSGPolygon_path_interval>` |
  24. +---------------------------------------------------+--------------------------------------------------------------+
  25. | :ref:`bool<class_bool>` | :ref:`path_joined<class_CSGPolygon_path_joined>` |
  26. +---------------------------------------------------+--------------------------------------------------------------+
  27. | :ref:`bool<class_bool>` | :ref:`path_local<class_CSGPolygon_path_local>` |
  28. +---------------------------------------------------+--------------------------------------------------------------+
  29. | :ref:`NodePath<class_NodePath>` | :ref:`path_node<class_CSGPolygon_path_node>` |
  30. +---------------------------------------------------+--------------------------------------------------------------+
  31. | :ref:`PathRotation<enum_CSGPolygon_PathRotation>` | :ref:`path_rotation<class_CSGPolygon_path_rotation>` |
  32. +---------------------------------------------------+--------------------------------------------------------------+
  33. | :ref:`PoolVector2Array<class_PoolVector2Array>` | :ref:`polygon<class_CSGPolygon_polygon>` |
  34. +---------------------------------------------------+--------------------------------------------------------------+
  35. | :ref:`bool<class_bool>` | :ref:`smooth_faces<class_CSGPolygon_smooth_faces>` |
  36. +---------------------------------------------------+--------------------------------------------------------------+
  37. | :ref:`float<class_float>` | :ref:`spin_degrees<class_CSGPolygon_spin_degrees>` |
  38. +---------------------------------------------------+--------------------------------------------------------------+
  39. | :ref:`int<class_int>` | :ref:`spin_sides<class_CSGPolygon_spin_sides>` |
  40. +---------------------------------------------------+--------------------------------------------------------------+
  41. Enumerations
  42. ------------
  43. .. _enum_CSGPolygon_Mode:
  44. enum **Mode**:
  45. - **MODE_DEPTH** = **0** --- Shape is extruded to :ref:`depth<class_CSGPolygon_depth>`.
  46. - **MODE_SPIN** = **1** --- Shape is extruded by rotating it around an axis.
  47. - **MODE_PATH** = **2** --- Shape is extruded along a path set by a :ref:`Shape<class_Shape>` set in :ref:`path_node<class_CSGPolygon_path_node>`.
  48. .. _enum_CSGPolygon_PathRotation:
  49. enum **PathRotation**:
  50. - **PATH_ROTATION_POLYGON** = **0** --- Slice is not rotated.
  51. - **PATH_ROTATION_PATH** = **1** --- Slice is rotated around the up vector of the path.
  52. - **PATH_ROTATION_PATH_FOLLOW** = **2** --- Slice is rotate to match the path exactly.
  53. Description
  54. -----------
  55. This node takes a 2D polygon shape and extrudes it to create a 3D mesh.
  56. Property Descriptions
  57. ---------------------
  58. .. _class_CSGPolygon_depth:
  59. - :ref:`float<class_float>` **depth**
  60. +----------+------------------+
  61. | *Setter* | set_depth(value) |
  62. +----------+------------------+
  63. | *Getter* | get_depth() |
  64. +----------+------------------+
  65. Extrusion depth when :ref:`mode<class_CSGPolygon_mode>` is constant MODE_DEPTH.
  66. .. _class_CSGPolygon_material:
  67. - :ref:`Material<class_Material>` **material**
  68. +----------+---------------------+
  69. | *Setter* | set_material(value) |
  70. +----------+---------------------+
  71. | *Getter* | get_material() |
  72. +----------+---------------------+
  73. Material to use for the resulting mesh.
  74. .. _class_CSGPolygon_mode:
  75. - :ref:`Mode<enum_CSGPolygon_Mode>` **mode**
  76. +----------+-----------------+
  77. | *Setter* | set_mode(value) |
  78. +----------+-----------------+
  79. | *Getter* | get_mode() |
  80. +----------+-----------------+
  81. Extrusion mode.
  82. .. _class_CSGPolygon_path_continuous_u:
  83. - :ref:`bool<class_bool>` **path_continuous_u**
  84. +----------+------------------------------+
  85. | *Setter* | set_path_continuous_u(value) |
  86. +----------+------------------------------+
  87. | *Getter* | is_path_continuous_u() |
  88. +----------+------------------------------+
  89. If true the u component of our uv will continuously increase in unison with the distance traveled along our path when :ref:`mode<class_CSGPolygon_mode>` is constant MODE_PATH.
  90. .. _class_CSGPolygon_path_interval:
  91. - :ref:`float<class_float>` **path_interval**
  92. +----------+--------------------------+
  93. | *Setter* | set_path_interval(value) |
  94. +----------+--------------------------+
  95. | *Getter* | get_path_interval() |
  96. +----------+--------------------------+
  97. Interval at which a new extrusion slice is added along the path when :ref:`mode<class_CSGPolygon_mode>` is constant MODE_PATH.
  98. .. _class_CSGPolygon_path_joined:
  99. - :ref:`bool<class_bool>` **path_joined**
  100. +----------+------------------------+
  101. | *Setter* | set_path_joined(value) |
  102. +----------+------------------------+
  103. | *Getter* | is_path_joined() |
  104. +----------+------------------------+
  105. If true the start and end of our path are joined together ensuring there is no seam when :ref:`mode<class_CSGPolygon_mode>` is constant MODE_PATH.
  106. .. _class_CSGPolygon_path_local:
  107. - :ref:`bool<class_bool>` **path_local**
  108. +----------+-----------------------+
  109. | *Setter* | set_path_local(value) |
  110. +----------+-----------------------+
  111. | *Getter* | is_path_local() |
  112. +----------+-----------------------+
  113. If false we extrude centered on our path, if true we extrude in relation to the position of our CSGPolygon when :ref:`mode<class_CSGPolygon_mode>` is constant MODE_PATH.
  114. .. _class_CSGPolygon_path_node:
  115. - :ref:`NodePath<class_NodePath>` **path_node**
  116. +----------+----------------------+
  117. | *Setter* | set_path_node(value) |
  118. +----------+----------------------+
  119. | *Getter* | get_path_node() |
  120. +----------+----------------------+
  121. The :ref:`Shape<class_Shape>` object containing the path along which we extrude when :ref:`mode<class_CSGPolygon_mode>` is constant MODE_PATH.
  122. .. _class_CSGPolygon_path_rotation:
  123. - :ref:`PathRotation<enum_CSGPolygon_PathRotation>` **path_rotation**
  124. +----------+--------------------------+
  125. | *Setter* | set_path_rotation(value) |
  126. +----------+--------------------------+
  127. | *Getter* | get_path_rotation() |
  128. +----------+--------------------------+
  129. The method by which each slice is rotated along the path when :ref:`mode<class_CSGPolygon_mode>` is constant MODE_PATH.
  130. .. _class_CSGPolygon_polygon:
  131. - :ref:`PoolVector2Array<class_PoolVector2Array>` **polygon**
  132. +----------+--------------------+
  133. | *Setter* | set_polygon(value) |
  134. +----------+--------------------+
  135. | *Getter* | get_polygon() |
  136. +----------+--------------------+
  137. Point array that defines the shape that we'll extrude.
  138. .. _class_CSGPolygon_smooth_faces:
  139. - :ref:`bool<class_bool>` **smooth_faces**
  140. +----------+-------------------------+
  141. | *Setter* | set_smooth_faces(value) |
  142. +----------+-------------------------+
  143. | *Getter* | get_smooth_faces() |
  144. +----------+-------------------------+
  145. Generates smooth normals so smooth shading is applied to our mesh.
  146. .. _class_CSGPolygon_spin_degrees:
  147. - :ref:`float<class_float>` **spin_degrees**
  148. +----------+-------------------------+
  149. | *Setter* | set_spin_degrees(value) |
  150. +----------+-------------------------+
  151. | *Getter* | get_spin_degrees() |
  152. +----------+-------------------------+
  153. Degrees to rotate our extrusion for each slice when :ref:`mode<class_CSGPolygon_mode>` is constant MODE_SPIN.
  154. .. _class_CSGPolygon_spin_sides:
  155. - :ref:`int<class_int>` **spin_sides**
  156. +----------+-----------------------+
  157. | *Setter* | set_spin_sides(value) |
  158. +----------+-----------------------+
  159. | *Getter* | get_spin_sides() |
  160. +----------+-----------------------+
  161. Number of extrusion when :ref:`mode<class_CSGPolygon_mode>` is constant MODE_SPIN.