1
0

ParametricGeometry.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>ParametricGeometry - 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="EventDispatcher.html">EventDispatcher</a> → <a href="BufferGeometry.html">BufferGeometry</a> → </p>
  13. <h1 translate="no">ParametricGeometry</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>This class can be used to generate a geometry based on a parametric surface.</p>
  17. <p>Reference: <a href="https://prideout.net/blog/old/blog/index.html@p=44.html" target="_blank" rel="noopener">Mesh Generation with Python</a></p></div>
  18. <h2>Code Example</h2>
  19. <div translate="no"><pre><code class="language-js">const geometry = new THREE.ParametricGeometry( klein, 25, 25 );
  20. const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
  21. const klein = new THREE.Mesh( geometry, material );
  22. scene.add( klein );
  23. </code></pre></div>
  24. </header>
  25. <article>
  26. <h2 class="subsection-title">Import</h2>
  27. <p><span translate="no">ParametricGeometry</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>
  28. <pre><code class="language-js">import { ParametricGeometry } from 'three/addons/geometries/ParametricGeometry.js';</code></pre>
  29. <div class="container-overview">
  30. <h2>Constructor</h2>
  31. <h3 class="name name-method" id="ParametricGeometry" translate="no">new <a href="#ParametricGeometry">ParametricGeometry</a><span class="signature">( func : <span class="param-type"><a href="ParametricGeometry.html#~Func">ParametricGeometry~Func</a></span>, slices : <span class="param-type">number</span>, stacks : <span class="param-type">number</span> )</span> </h3>
  32. <div class="method">
  33. <div class="description">
  34. <p>Constructs a new parametric geometry.</p>
  35. </div>
  36. <table class="params">
  37. <tbody>
  38. <tr>
  39. <td class="name">
  40. <strong>func</strong>
  41. </td>
  42. <td class="description last">
  43. <p>The parametric function. Default is a function that generates a curved plane surface.</p>
  44. </td>
  45. </tr>
  46. <tr>
  47. <td class="name">
  48. <strong>slices</strong>
  49. </td>
  50. <td class="description last">
  51. <p>The number of slices to use for the parametric function.</p>
  52. <p>Default is <code>8</code>.</p>
  53. </td>
  54. </tr>
  55. <tr>
  56. <td class="name">
  57. <strong>stacks</strong>
  58. </td>
  59. <td class="description last">
  60. <p>The stacks of slices to use for the parametric function.</p>
  61. <p>Default is <code>8</code>.</p>
  62. </td>
  63. </tr>
  64. </tbody>
  65. </table>
  66. </div>
  67. </div>
  68. <h2 class="subsection-title">Properties</h2>
  69. <div class="member">
  70. <h3 class="name" id="parameters" translate="no">.<a href="#parameters">parameters</a><span class="type-signature"> : Object</span> </h3>
  71. <div class="description">
  72. <p>Holds the constructor parameters that have been
  73. used to generate the geometry. Any modification
  74. after instantiation does not change the geometry.</p>
  75. </div>
  76. </div>
  77. <h2 class="subsection-title">Type Definitions</h2>
  78. <h3 class="name name-method" id="~Func" translate="no">.<a href="#~Func">Func</a><span class="signature">( u : <span class="param-type">number</span>, v : <span class="param-type">number</span>, target : <span class="param-type"><a href="Vector3.html">Vector3</a></span> )</span> </h3>
  79. <div class="method">
  80. <div class="description">
  81. <p>Parametric function definition of <code>ParametricGeometry</code>.</p>
  82. </div>
  83. <table class="params">
  84. <tbody>
  85. <tr>
  86. <td class="name">
  87. <strong>u</strong>
  88. </td>
  89. <td class="description last">
  90. <p>The <code>u</code> coordinate on the surface in the range <code>[0,1]</code>.</p>
  91. </td>
  92. </tr>
  93. <tr>
  94. <td class="name">
  95. <strong>v</strong>
  96. </td>
  97. <td class="description last">
  98. <p>The <code>v</code> coordinate on the surface in the range <code>[0,1]</code>.</p>
  99. </td>
  100. </tr>
  101. <tr>
  102. <td class="name">
  103. <strong>target</strong>
  104. </td>
  105. <td class="description last">
  106. <p>The target vector that is used to store the method's result.</p>
  107. </td>
  108. </tr>
  109. </tbody>
  110. </table>
  111. </div>
  112. <h2 class="subsection-title">Source</h2>
  113. <p>
  114. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/geometries/ParametricGeometry.js" translate="no" target="_blank" rel="noopener">examples/jsm/geometries/ParametricGeometry.js</a>
  115. </p>
  116. </article>
  117. </section>
  118. <script src="../scripts/linenumber.js"></script>
  119. <script src="../scripts/page.js"></script>
  120. </body>
  121. </html>
粤ICP备19079148号