Earcut.html 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Earcut - 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">Earcut</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>An implementation of the earcut polygon triangulation algorithm.
  16. The code is a port of <a href="https://github.com/mapbox/earcut">mapbox/earcut</a>.</p></div>
  17. </header>
  18. <article>
  19. <div class="container-overview">
  20. <h2>Constructor</h2>
  21. <h3 class="name name-method" id="Earcut" translate="no">new <a href="#Earcut">Earcut</a><span class="signature">()</span> </h3>
  22. <div class="method">
  23. <dl class="details">
  24. <dt class="tag-see">See:</dt>
  25. <dd class="tag-see">
  26. <ul>
  27. <li><a href="https://github.com/mapbox/earcut">https://github.com/mapbox/earcut</a></li>
  28. </ul>
  29. </dd>
  30. </dl>
  31. </div>
  32. </div>
  33. <h2 class="subsection-title">Static Methods</h2>
  34. <h3 class="name name-method" id=".triangulate" translate="no">.<a href="#.triangulate">triangulate</a><span class="signature">( data : <span class="param-type">Array.&lt;number></span>, holeIndices : <span class="param-type">Array.&lt;number></span>, dim : <span class="param-type">number</span> )</span><span class="type-signature"> : Array.&lt;number></span> </h3>
  35. <div class="method">
  36. <div class="description">
  37. <p>Triangulates the given shape definition by returning an array of triangles.</p>
  38. </div>
  39. <table class="params">
  40. <tbody>
  41. <tr>
  42. <td class="name"><code>data</code></td>
  43. <td class="description last"><p>An array with 2D points.</p></td>
  44. </tr>
  45. <tr>
  46. <td class="name"><code>holeIndices</code></td>
  47. <td class="description last"><p>An array with indices defining holes.</p></td>
  48. </tr>
  49. <tr>
  50. <td class="name"><code>dim</code></td>
  51. <td class="description last"><p>The number of coordinates per vertex in the input array.<br/>Default is <code>2</code>.</p></td>
  52. </tr>
  53. </tbody>
  54. </table>
  55. <dl class="details">
  56. <dt class="tag-returns"><strong>Returns:</strong> An array representing the triangulated faces. Each face is defined by three consecutive numbers
  57. representing vertex indices.</dt>
  58. </dl>
  59. </div>
  60. <h2 class="subsection-title">Source</h2>
  61. <p>
  62. <a href="https://github.com/mrdoob/three.js/blob/master/src/extras/Earcut.js" target="_blank" rel="noopener" translate="no">src/extras/Earcut.js</a>
  63. </p>
  64. </article>
  65. </section>
  66. <script src="../scripts/linenumber.js"></script>
  67. <script src="../scripts/page.js"></script>
  68. </body>
  69. </html>
粤ICP备19079148号