1
0

EdgeSplitModifier.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>EdgeSplitModifier - 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">EdgeSplitModifier</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>The modifier can be used to split faces at sharp edges. This allows to compute
  16. normals without smoothing the edges which can lead to an improved visual result.</p></div>
  17. <h2>Code Example</h2>
  18. <div translate="no"><pre><code class="language-js">const modifier = new EdgeSplitModifier();
  19. geometry = modifier.modify( geometry, Math.PI * 0.4 );
  20. </code></pre></div>
  21. </header>
  22. <article>
  23. <h2 class="subsection-title">Import</h2>
  24. <p><span translate="no">EdgeSplitModifier</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>
  25. <pre><code class="language-js">import { EdgeSplitModifier } from 'three/addons/modifiers/EdgeSplitModifier.js';</code></pre>
  26. <div class="container-overview">
  27. <h2>Constructor</h2>
  28. <h3 class="name name-method" id="EdgeSplitModifier" translate="no">new <a href="#EdgeSplitModifier">EdgeSplitModifier</a><span class="signature">()</span> </h3>
  29. <div class="method">
  30. </div>
  31. </div>
  32. <h2 class="subsection-title">Methods</h2>
  33. <h3 class="name name-method" id="modify" translate="no">.<a href="#modify">modify</a><span class="signature">( geometry : <span class="param-type"><a href="BufferGeometry.html">BufferGeometry</a></span>, cutOffAngle : <span class="param-type">number</span>, tryKeepNormals : <span class="param-type">boolean</span> )</span><span class="type-signature"> : <a href="BufferGeometry.html">BufferGeometry</a></span> </h3>
  34. <div class="method">
  35. <div class="description">
  36. <p>Returns a new, modified version of the given geometry by applying an edge-split operation.
  37. Please note that the resulting geometry is always indexed.</p>
  38. </div>
  39. <table class="params">
  40. <tbody>
  41. <tr>
  42. <td class="name">
  43. <strong>geometry</strong>
  44. </td>
  45. <td class="description last">
  46. <p>The geometry to modify.</p>
  47. </td>
  48. </tr>
  49. <tr>
  50. <td class="name">
  51. <strong>cutOffAngle</strong>
  52. </td>
  53. <td class="description last">
  54. <p>The cut off angle in radians.</p>
  55. </td>
  56. </tr>
  57. <tr>
  58. <td class="name">
  59. <strong>tryKeepNormals</strong>
  60. </td>
  61. <td class="description last">
  62. <p>Whether to try to keep normals or not.</p>
  63. <p>Default is <code>true</code>.</p>
  64. </td>
  65. </tr>
  66. </tbody>
  67. </table>
  68. <dl class="details">
  69. <dt class="tag-returns"><strong>Returns:</strong> A new, modified geometry.</dt>
  70. </dl>
  71. </div>
  72. <h2 class="subsection-title">Source</h2>
  73. <p>
  74. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/modifiers/EdgeSplitModifier.js" translate="no" target="_blank" rel="noopener">examples/jsm/modifiers/EdgeSplitModifier.js</a>
  75. </p>
  76. </article>
  77. </section>
  78. <script src="../scripts/linenumber.js"></script>
  79. <script src="../scripts/page.js"></script>
  80. </body>
  81. </html>
粤ICP备19079148号