ShapeUtils.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>ShapeUtils - 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">ShapeUtils</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>A class containing utility functions for shapes.</p></div>
  16. </header>
  17. <article>
  18. <div class="container-overview">
  19. <div class="method">
  20. </div>
  21. </div>
  22. <h2 class="subsection-title">Static Methods</h2>
  23. <h3 class="name name-method" id=".area" translate="no">.<a href="#.area">area</a><span class="signature">( contour : <span class="param-type">Array.&lt;Vector2></span> )</span><span class="type-signature"> : number</span> </h3>
  24. <div class="method">
  25. <div class="description">
  26. <p>Calculate area of a ( 2D ) contour polygon.</p>
  27. </div>
  28. <table class="params">
  29. <tbody>
  30. <tr>
  31. <td class="name"><code>contour</code></td>
  32. <td class="description last"><p>An array of 2D points.</p></td>
  33. </tr>
  34. </tbody>
  35. </table>
  36. <dl class="details">
  37. <dt class="tag-returns"><strong>Returns:</strong> The area.</dt>
  38. </dl>
  39. </div>
  40. <h3 class="name name-method" id=".isClockWise" translate="no">.<a href="#.isClockWise">isClockWise</a><span class="signature">( pts : <span class="param-type">Array.&lt;Vector2></span> )</span><span class="type-signature"> : boolean</span> </h3>
  41. <div class="method">
  42. <div class="description">
  43. <p>Returns <code>true</code> if the given contour uses a clockwise winding order.</p>
  44. </div>
  45. <table class="params">
  46. <tbody>
  47. <tr>
  48. <td class="name"><code>pts</code></td>
  49. <td class="description last"><p>An array of 2D points defining a polygon.</p></td>
  50. </tr>
  51. </tbody>
  52. </table>
  53. <dl class="details">
  54. <dt class="tag-returns"><strong>Returns:</strong> Whether the given contour uses a clockwise winding order or not.</dt>
  55. </dl>
  56. </div>
  57. <h3 class="name name-method" id=".triangulateShape" translate="no">.<a href="#.triangulateShape">triangulateShape</a><span class="signature">( contour : <span class="param-type">Array.&lt;Vector2></span>, holes : <span class="param-type">Array.&lt;Array.&lt;Vector2>></span> )</span><span class="type-signature"> : Array.&lt;Array.&lt;number>></span> </h3>
  58. <div class="method">
  59. <div class="description">
  60. <p>Triangulates the given shape definition.</p>
  61. </div>
  62. <table class="params">
  63. <tbody>
  64. <tr>
  65. <td class="name"><code>contour</code></td>
  66. <td class="description last"><p>An array of 2D points defining the contour.</p></td>
  67. </tr>
  68. <tr>
  69. <td class="name"><code>holes</code></td>
  70. <td class="description last"><p>An array that holds arrays of 2D points defining the holes.</p></td>
  71. </tr>
  72. </tbody>
  73. </table>
  74. <dl class="details">
  75. <dt class="tag-returns"><strong>Returns:</strong> An array that holds for each face definition an array with three indices.</dt>
  76. </dl>
  77. </div>
  78. <h2 class="subsection-title">Source</h2>
  79. <p>
  80. <a href="https://github.com/mrdoob/three.js/blob/master/src/extras/ShapeUtils.js" target="_blank" rel="noopener" translate="no">src/extras/ShapeUtils.js</a>
  81. </p>
  82. </article>
  83. </section>
  84. <script src="../scripts/linenumber.js"></script>
  85. <script src="../scripts/page.js"></script>
  86. </body>
  87. </html>
粤ICP备19079148号