class_csgpolygon.rst 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the CSGPolygon.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_CSGPolygon:
  6. CSGPolygon
  7. ==========
  8. **Inherits:** :ref:`CSGPrimitive<class_CSGPrimitive>` **<** :ref:`CSGShape<class_CSGShape>` **<** :ref:`GeometryInstance<class_GeometryInstance>` **<** :ref:`VisualInstance<class_VisualInstance>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. Extrudes a 2D polygon shape to create a 3D mesh.
  10. Description
  11. -----------
  12. This node takes a 2D polygon shape and extrudes it to create a 3D mesh.
  13. Properties
  14. ----------
  15. +---------------------------------------------------+-----------------------------------------------------------------------+------------------------------------------------+
  16. | :ref:`float<class_float>` | :ref:`depth<class_CSGPolygon_property_depth>` | ``1.0`` |
  17. +---------------------------------------------------+-----------------------------------------------------------------------+------------------------------------------------+
  18. | :ref:`Material<class_Material>` | :ref:`material<class_CSGPolygon_property_material>` | |
  19. +---------------------------------------------------+-----------------------------------------------------------------------+------------------------------------------------+
  20. | :ref:`Mode<enum_CSGPolygon_Mode>` | :ref:`mode<class_CSGPolygon_property_mode>` | ``0`` |
  21. +---------------------------------------------------+-----------------------------------------------------------------------+------------------------------------------------+
  22. | :ref:`bool<class_bool>` | :ref:`path_continuous_u<class_CSGPolygon_property_path_continuous_u>` | |
  23. +---------------------------------------------------+-----------------------------------------------------------------------+------------------------------------------------+
  24. | :ref:`float<class_float>` | :ref:`path_interval<class_CSGPolygon_property_path_interval>` | |
  25. +---------------------------------------------------+-----------------------------------------------------------------------+------------------------------------------------+
  26. | :ref:`bool<class_bool>` | :ref:`path_joined<class_CSGPolygon_property_path_joined>` | |
  27. +---------------------------------------------------+-----------------------------------------------------------------------+------------------------------------------------+
  28. | :ref:`bool<class_bool>` | :ref:`path_local<class_CSGPolygon_property_path_local>` | |
  29. +---------------------------------------------------+-----------------------------------------------------------------------+------------------------------------------------+
  30. | :ref:`NodePath<class_NodePath>` | :ref:`path_node<class_CSGPolygon_property_path_node>` | |
  31. +---------------------------------------------------+-----------------------------------------------------------------------+------------------------------------------------+
  32. | :ref:`PathRotation<enum_CSGPolygon_PathRotation>` | :ref:`path_rotation<class_CSGPolygon_property_path_rotation>` | |
  33. +---------------------------------------------------+-----------------------------------------------------------------------+------------------------------------------------+
  34. | :ref:`PoolVector2Array<class_PoolVector2Array>` | :ref:`polygon<class_CSGPolygon_property_polygon>` | ``PoolVector2Array( 0, 0, 0, 1, 1, 1, 1, 0 )`` |
  35. +---------------------------------------------------+-----------------------------------------------------------------------+------------------------------------------------+
  36. | :ref:`bool<class_bool>` | :ref:`smooth_faces<class_CSGPolygon_property_smooth_faces>` | ``false`` |
  37. +---------------------------------------------------+-----------------------------------------------------------------------+------------------------------------------------+
  38. | :ref:`float<class_float>` | :ref:`spin_degrees<class_CSGPolygon_property_spin_degrees>` | |
  39. +---------------------------------------------------+-----------------------------------------------------------------------+------------------------------------------------+
  40. | :ref:`int<class_int>` | :ref:`spin_sides<class_CSGPolygon_property_spin_sides>` | |
  41. +---------------------------------------------------+-----------------------------------------------------------------------+------------------------------------------------+
  42. Enumerations
  43. ------------
  44. .. _enum_CSGPolygon_Mode:
  45. .. _class_CSGPolygon_constant_MODE_DEPTH:
  46. .. _class_CSGPolygon_constant_MODE_SPIN:
  47. .. _class_CSGPolygon_constant_MODE_PATH:
  48. enum **Mode**:
  49. - **MODE_DEPTH** = **0** --- Shape is extruded to :ref:`depth<class_CSGPolygon_property_depth>`.
  50. - **MODE_SPIN** = **1** --- Shape is extruded by rotating it around an axis.
  51. - **MODE_PATH** = **2** --- Shape is extruded along a path set by a :ref:`Shape<class_Shape>` set in :ref:`path_node<class_CSGPolygon_property_path_node>`.
  52. ----
  53. .. _enum_CSGPolygon_PathRotation:
  54. .. _class_CSGPolygon_constant_PATH_ROTATION_POLYGON:
  55. .. _class_CSGPolygon_constant_PATH_ROTATION_PATH:
  56. .. _class_CSGPolygon_constant_PATH_ROTATION_PATH_FOLLOW:
  57. enum **PathRotation**:
  58. - **PATH_ROTATION_POLYGON** = **0** --- Slice is not rotated.
  59. - **PATH_ROTATION_PATH** = **1** --- Slice is rotated around the up vector of the path.
  60. - **PATH_ROTATION_PATH_FOLLOW** = **2** --- Slice is rotate to match the path exactly.
  61. Property Descriptions
  62. ---------------------
  63. .. _class_CSGPolygon_property_depth:
  64. - :ref:`float<class_float>` **depth**
  65. +-----------+------------------+
  66. | *Default* | ``1.0`` |
  67. +-----------+------------------+
  68. | *Setter* | set_depth(value) |
  69. +-----------+------------------+
  70. | *Getter* | get_depth() |
  71. +-----------+------------------+
  72. Extrusion depth when :ref:`mode<class_CSGPolygon_property_mode>` is :ref:`MODE_DEPTH<class_CSGPolygon_constant_MODE_DEPTH>`.
  73. ----
  74. .. _class_CSGPolygon_property_material:
  75. - :ref:`Material<class_Material>` **material**
  76. +----------+---------------------+
  77. | *Setter* | set_material(value) |
  78. +----------+---------------------+
  79. | *Getter* | get_material() |
  80. +----------+---------------------+
  81. Material to use for the resulting mesh.
  82. ----
  83. .. _class_CSGPolygon_property_mode:
  84. - :ref:`Mode<enum_CSGPolygon_Mode>` **mode**
  85. +-----------+-----------------+
  86. | *Default* | ``0`` |
  87. +-----------+-----------------+
  88. | *Setter* | set_mode(value) |
  89. +-----------+-----------------+
  90. | *Getter* | get_mode() |
  91. +-----------+-----------------+
  92. Extrusion mode.
  93. ----
  94. .. _class_CSGPolygon_property_path_continuous_u:
  95. - :ref:`bool<class_bool>` **path_continuous_u**
  96. +----------+------------------------------+
  97. | *Setter* | set_path_continuous_u(value) |
  98. +----------+------------------------------+
  99. | *Getter* | is_path_continuous_u() |
  100. +----------+------------------------------+
  101. 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_property_mode>` is :ref:`MODE_PATH<class_CSGPolygon_constant_MODE_PATH>`.
  102. ----
  103. .. _class_CSGPolygon_property_path_interval:
  104. - :ref:`float<class_float>` **path_interval**
  105. +----------+--------------------------+
  106. | *Setter* | set_path_interval(value) |
  107. +----------+--------------------------+
  108. | *Getter* | get_path_interval() |
  109. +----------+--------------------------+
  110. Interval at which a new extrusion slice is added along the path when :ref:`mode<class_CSGPolygon_property_mode>` is :ref:`MODE_PATH<class_CSGPolygon_constant_MODE_PATH>`.
  111. ----
  112. .. _class_CSGPolygon_property_path_joined:
  113. - :ref:`bool<class_bool>` **path_joined**
  114. +----------+------------------------+
  115. | *Setter* | set_path_joined(value) |
  116. +----------+------------------------+
  117. | *Getter* | is_path_joined() |
  118. +----------+------------------------+
  119. If ``true`` the start and end of our path are joined together ensuring there is no seam when :ref:`mode<class_CSGPolygon_property_mode>` is :ref:`MODE_PATH<class_CSGPolygon_constant_MODE_PATH>`.
  120. ----
  121. .. _class_CSGPolygon_property_path_local:
  122. - :ref:`bool<class_bool>` **path_local**
  123. +----------+-----------------------+
  124. | *Setter* | set_path_local(value) |
  125. +----------+-----------------------+
  126. | *Getter* | is_path_local() |
  127. +----------+-----------------------+
  128. 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_property_mode>` is :ref:`MODE_PATH<class_CSGPolygon_constant_MODE_PATH>`.
  129. ----
  130. .. _class_CSGPolygon_property_path_node:
  131. - :ref:`NodePath<class_NodePath>` **path_node**
  132. +----------+----------------------+
  133. | *Setter* | set_path_node(value) |
  134. +----------+----------------------+
  135. | *Getter* | get_path_node() |
  136. +----------+----------------------+
  137. The :ref:`Shape<class_Shape>` object containing the path along which we extrude when :ref:`mode<class_CSGPolygon_property_mode>` is :ref:`MODE_PATH<class_CSGPolygon_constant_MODE_PATH>`.
  138. ----
  139. .. _class_CSGPolygon_property_path_rotation:
  140. - :ref:`PathRotation<enum_CSGPolygon_PathRotation>` **path_rotation**
  141. +----------+--------------------------+
  142. | *Setter* | set_path_rotation(value) |
  143. +----------+--------------------------+
  144. | *Getter* | get_path_rotation() |
  145. +----------+--------------------------+
  146. The method by which each slice is rotated along the path when :ref:`mode<class_CSGPolygon_property_mode>` is :ref:`MODE_PATH<class_CSGPolygon_constant_MODE_PATH>`.
  147. ----
  148. .. _class_CSGPolygon_property_polygon:
  149. - :ref:`PoolVector2Array<class_PoolVector2Array>` **polygon**
  150. +-----------+------------------------------------------------+
  151. | *Default* | ``PoolVector2Array( 0, 0, 0, 1, 1, 1, 1, 0 )`` |
  152. +-----------+------------------------------------------------+
  153. | *Setter* | set_polygon(value) |
  154. +-----------+------------------------------------------------+
  155. | *Getter* | get_polygon() |
  156. +-----------+------------------------------------------------+
  157. Point array that defines the shape that we'll extrude.
  158. ----
  159. .. _class_CSGPolygon_property_smooth_faces:
  160. - :ref:`bool<class_bool>` **smooth_faces**
  161. +-----------+-------------------------+
  162. | *Default* | ``false`` |
  163. +-----------+-------------------------+
  164. | *Setter* | set_smooth_faces(value) |
  165. +-----------+-------------------------+
  166. | *Getter* | get_smooth_faces() |
  167. +-----------+-------------------------+
  168. Generates smooth normals so smooth shading is applied to our mesh.
  169. ----
  170. .. _class_CSGPolygon_property_spin_degrees:
  171. - :ref:`float<class_float>` **spin_degrees**
  172. +----------+-------------------------+
  173. | *Setter* | set_spin_degrees(value) |
  174. +----------+-------------------------+
  175. | *Getter* | get_spin_degrees() |
  176. +----------+-------------------------+
  177. Degrees to rotate our extrusion for each slice when :ref:`mode<class_CSGPolygon_property_mode>` is :ref:`MODE_SPIN<class_CSGPolygon_constant_MODE_SPIN>`.
  178. ----
  179. .. _class_CSGPolygon_property_spin_sides:
  180. - :ref:`int<class_int>` **spin_sides**
  181. +----------+-----------------------+
  182. | *Setter* | set_spin_sides(value) |
  183. +----------+-----------------------+
  184. | *Getter* | get_spin_sides() |
  185. +----------+-----------------------+
  186. Number of extrusion when :ref:`mode<class_CSGPolygon_property_mode>` is :ref:`MODE_SPIN<class_CSGPolygon_constant_MODE_SPIN>`.
  187. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  188. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  189. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`