TorusKnot.html 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>TorusKnot - 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">TorusKnot</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A torus knot.</p></div>
  17. </header>
  18. <article>
  19. <h2 class="subsection-title">Import</h2>
  20. <p><span translate="no">TorusKnot</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 { TorusKnot } from 'three/addons/curves/CurveExtras.js';</code></pre>
  22. <div class="container-overview">
  23. <h2>Constructor</h2>
  24. <h3 class="name name-method" id="TorusKnot" translate="no">new <a href="#TorusKnot">TorusKnot</a><span class="signature">( scale : <span class="param-type">number</span> )</span> </h3>
  25. <div class="method">
  26. <div class="description">
  27. <p>Constructs a new torus knot.</p>
  28. </div>
  29. <table class="params">
  30. <tbody>
  31. <tr>
  32. <td class="name">
  33. <strong>scale</strong>
  34. </td>
  35. <td class="description last">
  36. <p>The curve's scale.</p>
  37. <p>Default is <code>10</code>.</p>
  38. </td>
  39. </tr>
  40. </tbody>
  41. </table>
  42. </div>
  43. </div>
  44. <h2 class="subsection-title">Properties</h2>
  45. <div class="member">
  46. <h3 class="name" id="scale" translate="no">.<a href="#scale">scale</a><span class="type-signature"> : number</span> </h3>
  47. <div class="description">
  48. <p>The curve's scale.</p>
  49. <p>Default is <code>10</code>.</p>
  50. </div>
  51. </div>
  52. <h2 class="subsection-title">Methods</h2>
  53. <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="Vector3.html">Vector3</a></span> )</span><span class="type-signature"> : <a href="Vector3.html">Vector3</a></span> </h3>
  54. <div class="method">
  55. <div class="description">
  56. <p>This method returns a vector in 3D space for the given interpolation factor.</p>
  57. </div>
  58. <table class="params">
  59. <tbody>
  60. <tr>
  61. <td class="name">
  62. <strong>t</strong>
  63. </td>
  64. <td class="description last">
  65. <p>A interpolation factor representing a position on the curve. Must be in the range <code>[0,1]</code>.</p>
  66. </td>
  67. </tr>
  68. <tr>
  69. <td class="name">
  70. <strong>optionalTarget</strong>
  71. </td>
  72. <td class="description last">
  73. <p>The optional target vector the result is written to.</p>
  74. </td>
  75. </tr>
  76. </tbody>
  77. </table>
  78. <dl class="details">
  79. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Curve.html#getPoint">Curve#getPoint</a></dt>
  80. </dl>
  81. <dl class="details">
  82. <dt class="tag-returns"><strong>Returns:</strong> The position on the curve.</dt>
  83. </dl>
  84. </div>
  85. <h2 class="subsection-title">Source</h2>
  86. <p>
  87. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/curves/CurveExtras.js" translate="no" target="_blank" rel="noopener">examples/jsm/curves/CurveExtras.js</a>
  88. </p>
  89. </article>
  90. </section>
  91. <script src="../scripts/linenumber.js"></script>
  92. <script src="../scripts/page.js"></script>
  93. </body>
  94. </html>
粤ICP备19079148号