EllipseCurve.html 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>EllipseCurve - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <p class="inheritance" translate="no"><a href="Curve.html">Curve</a> → </p>
  13. <h1 translate="no">EllipseCurve</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A curve representing an ellipse.</p></div>
  17. <h2>Code Example</h2>
  18. <div translate="no"><pre><code class="language-js">const curve = new THREE.EllipseCurve(
  19. 0, 0,
  20. 10, 10,
  21. 0, 2 * Math.PI,
  22. false,
  23. 0
  24. );
  25. const points = curve.getPoints( 50 );
  26. const geometry = new THREE.BufferGeometry().setFromPoints( points );
  27. const material = new THREE.LineBasicMaterial( { color: 0xff0000 } );
  28. // Create the final object to add to the scene
  29. const ellipse = new THREE.Line( geometry, material );
  30. </code></pre></div>
  31. </header>
  32. <article>
  33. <div class="container-overview">
  34. <h2>Constructor</h2>
  35. <h3 class="name name-method" id="EllipseCurve" translate="no">new <a href="#EllipseCurve">EllipseCurve</a><span class="signature">( aX : <span class="param-type">number</span>, aY : <span class="param-type">number</span>, xRadius : <span class="param-type">number</span>, yRadius : <span class="param-type">number</span>, aStartAngle : <span class="param-type">number</span>, aEndAngle : <span class="param-type">number</span>, aClockwise : <span class="param-type">boolean</span>, aRotation : <span class="param-type">number</span> )</span> </h3>
  36. <div class="method">
  37. <div class="description">
  38. <p>Constructs a new ellipse curve.</p>
  39. </div>
  40. <table class="params">
  41. <tbody>
  42. <tr>
  43. <td class="name">
  44. <strong>aX</strong>
  45. </td>
  46. <td class="description last">
  47. <p>The X center of the ellipse.</p>
  48. <p>Default is <code>0</code>.</p>
  49. </td>
  50. </tr>
  51. <tr>
  52. <td class="name">
  53. <strong>aY</strong>
  54. </td>
  55. <td class="description last">
  56. <p>The Y center of the ellipse.</p>
  57. <p>Default is <code>0</code>.</p>
  58. </td>
  59. </tr>
  60. <tr>
  61. <td class="name">
  62. <strong>xRadius</strong>
  63. </td>
  64. <td class="description last">
  65. <p>The radius of the ellipse in the x direction.</p>
  66. <p>Default is <code>1</code>.</p>
  67. </td>
  68. </tr>
  69. <tr>
  70. <td class="name">
  71. <strong>yRadius</strong>
  72. </td>
  73. <td class="description last">
  74. <p>The radius of the ellipse in the y direction.</p>
  75. <p>Default is <code>1</code>.</p>
  76. </td>
  77. </tr>
  78. <tr>
  79. <td class="name">
  80. <strong>aStartAngle</strong>
  81. </td>
  82. <td class="description last">
  83. <p>The start angle of the curve in radians starting from the positive X axis.</p>
  84. <p>Default is <code>0</code>.</p>
  85. </td>
  86. </tr>
  87. <tr>
  88. <td class="name">
  89. <strong>aEndAngle</strong>
  90. </td>
  91. <td class="description last">
  92. <p>The end angle of the curve in radians starting from the positive X axis.</p>
  93. <p>Default is <code>Math.PI*2</code>.</p>
  94. </td>
  95. </tr>
  96. <tr>
  97. <td class="name">
  98. <strong>aClockwise</strong>
  99. </td>
  100. <td class="description last">
  101. <p>Whether the ellipse is drawn clockwise or not.</p>
  102. <p>Default is <code>false</code>.</p>
  103. </td>
  104. </tr>
  105. <tr>
  106. <td class="name">
  107. <strong>aRotation</strong>
  108. </td>
  109. <td class="description last">
  110. <p>The rotation angle of the ellipse in radians, counterclockwise from the positive X axis.</p>
  111. <p>Default is <code>0</code>.</p>
  112. </td>
  113. </tr>
  114. </tbody>
  115. </table>
  116. </div>
  117. </div>
  118. <h2 class="subsection-title">Properties</h2>
  119. <div class="member">
  120. <h3 class="name" id="aClockwise" translate="no">.<a href="#aClockwise">aClockwise</a><span class="type-signature"> : boolean</span> </h3>
  121. <div class="description">
  122. <p>Whether the ellipse is drawn clockwise or not.</p>
  123. <p>Default is <code>false</code>.</p>
  124. </div>
  125. </div>
  126. <div class="member">
  127. <h3 class="name" id="aEndAngle" translate="no">.<a href="#aEndAngle">aEndAngle</a><span class="type-signature"> : number</span> </h3>
  128. <div class="description">
  129. <p>The end angle of the curve in radians starting from the positive X axis.</p>
  130. <p>Default is <code>Math.PI*2</code>.</p>
  131. </div>
  132. </div>
  133. <div class="member">
  134. <h3 class="name" id="aRotation" translate="no">.<a href="#aRotation">aRotation</a><span class="type-signature"> : number</span> </h3>
  135. <div class="description">
  136. <p>The rotation angle of the ellipse in radians, counterclockwise from the positive X axis.</p>
  137. <p>Default is <code>0</code>.</p>
  138. </div>
  139. </div>
  140. <div class="member">
  141. <h3 class="name" id="aStartAngle" translate="no">.<a href="#aStartAngle">aStartAngle</a><span class="type-signature"> : number</span> </h3>
  142. <div class="description">
  143. <p>The start angle of the curve in radians starting from the positive X axis.</p>
  144. <p>Default is <code>0</code>.</p>
  145. </div>
  146. </div>
  147. <div class="member">
  148. <h3 class="name" id="aX" translate="no">.<a href="#aX">aX</a><span class="type-signature"> : number</span> </h3>
  149. <div class="description">
  150. <p>The X center of the ellipse.</p>
  151. <p>Default is <code>0</code>.</p>
  152. </div>
  153. </div>
  154. <div class="member">
  155. <h3 class="name" id="aY" translate="no">.<a href="#aY">aY</a><span class="type-signature"> : number</span> </h3>
  156. <div class="description">
  157. <p>The Y center of the ellipse.</p>
  158. <p>Default is <code>0</code>.</p>
  159. </div>
  160. </div>
  161. <div class="member">
  162. <h3 class="name" id="isEllipseCurve" translate="no">.<a href="#isEllipseCurve">isEllipseCurve</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  163. <div class="description">
  164. <p>This flag can be used for type testing.</p>
  165. <p>Default is <code>true</code>.</p>
  166. </div>
  167. </div>
  168. <div class="member">
  169. <h3 class="name" id="xRadius" translate="no">.<a href="#xRadius">xRadius</a><span class="type-signature"> : number</span> </h3>
  170. <div class="description">
  171. <p>The radius of the ellipse in the x direction.
  172. Setting the this value equal to the <a href="EllipseCurve.html#yRadius">EllipseCurve#yRadius</a> will result in a circle.</p>
  173. <p>Default is <code>1</code>.</p>
  174. </div>
  175. </div>
  176. <div class="member">
  177. <h3 class="name" id="yRadius" translate="no">.<a href="#yRadius">yRadius</a><span class="type-signature"> : number</span> </h3>
  178. <div class="description">
  179. <p>The radius of the ellipse in the y direction.
  180. Setting the this value equal to the <a href="EllipseCurve.html#xRadius">EllipseCurve#xRadius</a> will result in a circle.</p>
  181. <p>Default is <code>1</code>.</p>
  182. </div>
  183. </div>
  184. <h2 class="subsection-title">Methods</h2>
  185. <h3 class="name name-method" id="getPoint" translate="no">.<a href="#getPoint">getPoint</a><span class="signature">( t : <span class="param-type">number</span>, optionalTarget : <span class="param-type"><a href="Vector2.html">Vector2</a></span> )</span><span class="type-signature"> : <a href="Vector2.html">Vector2</a></span> </h3>
  186. <div class="method">
  187. <div class="description">
  188. <p>Returns a point on the curve.</p>
  189. </div>
  190. <table class="params">
  191. <tbody>
  192. <tr>
  193. <td class="name">
  194. <strong>t</strong>
  195. </td>
  196. <td class="description last">
  197. <p>A interpolation factor representing a position on the curve. Must be in the range <code>[0,1]</code>.</p>
  198. </td>
  199. </tr>
  200. <tr>
  201. <td class="name">
  202. <strong>optionalTarget</strong>
  203. </td>
  204. <td class="description last">
  205. <p>The optional target vector the result is written to.</p>
  206. </td>
  207. </tr>
  208. </tbody>
  209. </table>
  210. <dl class="details">
  211. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Curve.html#getPoint">Curve#getPoint</a></dt>
  212. </dl>
  213. <dl class="details">
  214. <dt class="tag-returns"><strong>Returns:</strong> The position on the curve.</dt>
  215. </dl>
  216. </div>
  217. <h2 class="subsection-title">Source</h2>
  218. <p>
  219. <a href="https://github.com/mrdoob/three.js/blob/master/src/extras/curves/EllipseCurve.js" translate="no" target="_blank" rel="noopener">src/extras/curves/EllipseCurve.js</a>
  220. </p>
  221. </article>
  222. </section>
  223. <script src="../scripts/linenumber.js"></script>
  224. <script src="../scripts/page.js"></script>
  225. </body>
  226. </html>
粤ICP备19079148号