NURBSSurface.html 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>NURBSSurface - 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. <h1 translate="no">NURBSSurface</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>This class represents a NURBS surface.</p>
  16. <p>Implementation is based on <code>(x, y [, z=0 [, w=1]])</code> control points with <code>w=weight</code>.</p></div>
  17. </header>
  18. <article>
  19. <h2 class="subsection-title">Import</h2>
  20. <p><span translate="no">NURBSSurface</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank" rel="noopener">Installation#Addons</a>.</p>
  21. <pre><code class="language-js">import { NURBSSurface } from 'three/addons/curves/NURBSSurface.js';</code></pre>
  22. <div class="container-overview">
  23. <h2>Constructor</h2>
  24. <h3 class="name name-method" id="NURBSSurface" translate="no">new <a href="#NURBSSurface">NURBSSurface</a><span class="signature">( degree1 : <span class="param-type">number</span>, degree2 : <span class="param-type">number</span>, knots1 : <span class="param-type">Array.&lt;number></span>, knots2 : <span class="param-type">Array.&lt;number></span>, controlPoints : <span class="param-type">Array.&lt;Array.&lt;(<a href="Vector2.html">Vector2</a>|<a href="Vector3.html">Vector3</a>|<a href="Vector4.html">Vector4</a>)>></span> )</span> </h3>
  25. <div class="method">
  26. <div class="description">
  27. <p>Constructs a new NURBS surface.</p>
  28. </div>
  29. <table class="params">
  30. <tbody>
  31. <tr>
  32. <td class="name">
  33. <strong>degree1</strong>
  34. </td>
  35. <td class="description last">
  36. <p>The first NURBS degree.</p>
  37. </td>
  38. </tr>
  39. <tr>
  40. <td class="name">
  41. <strong>degree2</strong>
  42. </td>
  43. <td class="description last">
  44. <p>The second NURBS degree.</p>
  45. </td>
  46. </tr>
  47. <tr>
  48. <td class="name">
  49. <strong>knots1</strong>
  50. </td>
  51. <td class="description last">
  52. <p>The first knots as a flat array of numbers.</p>
  53. </td>
  54. </tr>
  55. <tr>
  56. <td class="name">
  57. <strong>knots2</strong>
  58. </td>
  59. <td class="description last">
  60. <p>The second knots as a flat array of numbers.</p>
  61. </td>
  62. </tr>
  63. <tr>
  64. <td class="name">
  65. <strong>controlPoints</strong>
  66. </td>
  67. <td class="description last">
  68. <p>An array^2 holding control points.</p>
  69. </td>
  70. </tr>
  71. </tbody>
  72. </table>
  73. </div>
  74. </div>
  75. <h2 class="subsection-title">Properties</h2>
  76. <div class="member">
  77. <h3 class="name" id="controlPoints" translate="no">.<a href="#controlPoints">controlPoints</a><span class="type-signature"> : Array.&lt;Array.&lt;(<a href="Vector2.html">Vector2</a>|<a href="Vector3.html">Vector3</a>|<a href="Vector4.html">Vector4</a>)>></span> </h3>
  78. <div class="description">
  79. <p>An array holding arrays of control points.</p>
  80. </div>
  81. </div>
  82. <div class="member">
  83. <h3 class="name" id="degree1" translate="no">.<a href="#degree1">degree1</a><span class="type-signature"> : number</span> </h3>
  84. <div class="description">
  85. <p>The first NURBS degree.</p>
  86. </div>
  87. </div>
  88. <div class="member">
  89. <h3 class="name" id="degree2" translate="no">.<a href="#degree2">degree2</a><span class="type-signature"> : number</span> </h3>
  90. <div class="description">
  91. <p>The second NURBS degree.</p>
  92. </div>
  93. </div>
  94. <div class="member">
  95. <h3 class="name" id="knots1" translate="no">.<a href="#knots1">knots1</a><span class="type-signature"> : Array.&lt;number></span> </h3>
  96. <div class="description">
  97. <p>The first knots as a flat array of numbers.</p>
  98. </div>
  99. </div>
  100. <div class="member">
  101. <h3 class="name" id="knots2" translate="no">.<a href="#knots2">knots2</a><span class="type-signature"> : Array.&lt;number></span> </h3>
  102. <div class="description">
  103. <p>The second knots as a flat array of numbers.</p>
  104. </div>
  105. </div>
  106. <h2 class="subsection-title">Methods</h2>
  107. <h3 class="name name-method" id="getPoint" translate="no">.<a href="#getPoint">getPoint</a><span class="signature">( t1 : <span class="param-type">number</span>, t2 : <span class="param-type">number</span>, target : <span class="param-type"><a href="Vector3.html">Vector3</a></span> )</span> </h3>
  108. <div class="method">
  109. <div class="description">
  110. <p>This method returns a vector in 3D space for the given interpolation factor. This vector lies on the NURBS surface.</p>
  111. </div>
  112. <table class="params">
  113. <tbody>
  114. <tr>
  115. <td class="name">
  116. <strong>t1</strong>
  117. </td>
  118. <td class="description last">
  119. <p>The first interpolation factor representing the <code>u</code> position on the surface. Must be in the range <code>[0,1]</code>.</p>
  120. </td>
  121. </tr>
  122. <tr>
  123. <td class="name">
  124. <strong>t2</strong>
  125. </td>
  126. <td class="description last">
  127. <p>The second interpolation factor representing the <code>v</code> position on the surface. Must be in the range <code>[0,1]</code>.</p>
  128. </td>
  129. </tr>
  130. <tr>
  131. <td class="name">
  132. <strong>target</strong>
  133. </td>
  134. <td class="description last">
  135. <p>The target vector the result is written to.</p>
  136. </td>
  137. </tr>
  138. </tbody>
  139. </table>
  140. </div>
  141. <h2 class="subsection-title">Source</h2>
  142. <p>
  143. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/curves/NURBSSurface.js" translate="no" target="_blank" rel="noopener">examples/jsm/curves/NURBSSurface.js</a>
  144. </p>
  145. </article>
  146. </section>
  147. <script src="../scripts/linenumber.js"></script>
  148. <script src="../scripts/page.js"></script>
  149. </body>
  150. </html>
粤ICP备19079148号