NURBSSurface.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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">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;(Vector2|Vector3|Vector4)>></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"><code>degree1</code></td>
  33. <td class="description last"><p>The first NURBS degree.</p></td>
  34. </tr>
  35. <tr>
  36. <td class="name"><code>degree2</code></td>
  37. <td class="description last"><p>The second NURBS degree.</p></td>
  38. </tr>
  39. <tr>
  40. <td class="name"><code>knots1</code></td>
  41. <td class="description last"><p>The first knots as a flat array of numbers.</p></td>
  42. </tr>
  43. <tr>
  44. <td class="name"><code>knots2</code></td>
  45. <td class="description last"><p>The second knots as a flat array of numbers.</p></td>
  46. </tr>
  47. <tr>
  48. <td class="name"><code>controlPoints</code></td>
  49. <td class="description last"><p>An array^2 holding control points.</p></td>
  50. </tr>
  51. </tbody>
  52. </table>
  53. </div>
  54. </div>
  55. <h2 class="subsection-title">Properties</h2>
  56. <div class="member">
  57. <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>
  58. <div class="description">
  59. <p>An array holding arrays of control points.</p>
  60. </div>
  61. </div>
  62. <div class="member">
  63. <h3 class="name" id="degree1" translate="no">.<a href="#degree1">degree1</a><span class="type-signature"> : number</span> </h3>
  64. <div class="description">
  65. <p>The first NURBS degree.</p>
  66. </div>
  67. </div>
  68. <div class="member">
  69. <h3 class="name" id="degree2" translate="no">.<a href="#degree2">degree2</a><span class="type-signature"> : number</span> </h3>
  70. <div class="description">
  71. <p>The second NURBS degree.</p>
  72. </div>
  73. </div>
  74. <div class="member">
  75. <h3 class="name" id="knots1" translate="no">.<a href="#knots1">knots1</a><span class="type-signature"> : Array.&lt;number></span> </h3>
  76. <div class="description">
  77. <p>The first knots as a flat array of numbers.</p>
  78. </div>
  79. </div>
  80. <div class="member">
  81. <h3 class="name" id="knots2" translate="no">.<a href="#knots2">knots2</a><span class="type-signature"> : Array.&lt;number></span> </h3>
  82. <div class="description">
  83. <p>The second knots as a flat array of numbers.</p>
  84. </div>
  85. </div>
  86. <h2 class="subsection-title">Methods</h2>
  87. <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">Vector3</span> )</span> </h3>
  88. <div class="method">
  89. <div class="description">
  90. <p>This method returns a vector in 3D space for the given interpolation factor. This vector lies on the NURBS surface.</p>
  91. </div>
  92. <table class="params">
  93. <tbody>
  94. <tr>
  95. <td class="name"><code>t1</code></td>
  96. <td class="description last"><p>The first interpolation factor representing the <code>u</code> position on the surface. Must be in the range <code>[0,1]</code>.</p></td>
  97. </tr>
  98. <tr>
  99. <td class="name"><code>t2</code></td>
  100. <td class="description last"><p>The second interpolation factor representing the <code>v</code> position on the surface. Must be in the range <code>[0,1]</code>.</p></td>
  101. </tr>
  102. <tr>
  103. <td class="name"><code>target</code></td>
  104. <td class="description last"><p>The target vector the result is written to.</p></td>
  105. </tr>
  106. </tbody>
  107. </table>
  108. </div>
  109. <h2 class="subsection-title">Source</h2>
  110. <p>
  111. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/curves/NURBSSurface.js" target="_blank" rel="noopener" translate="no">examples/jsm/curves/NURBSSurface.js</a>
  112. </p>
  113. </article>
  114. </section>
  115. <script src="../scripts/linenumber.js"></script>
  116. <script src="../scripts/page.js"></script>
  117. </body>
  118. </html>
粤ICP备19079148号