ShapeUtils.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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;<a href="Vector2.html">Vector2</a>></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">
  32. <strong>contour</strong>
  33. </td>
  34. <td class="description last">
  35. <p>An array of 2D points.</p>
  36. </td>
  37. </tr>
  38. </tbody>
  39. </table>
  40. <dl class="details">
  41. <dt class="tag-returns"><strong>Returns:</strong> The area.</dt>
  42. </dl>
  43. </div>
  44. <h3 class="name name-method" id=".isClockWise" translate="no">.<a href="#.isClockWise">isClockWise</a><span class="signature">( pts : <span class="param-type">Array.&lt;<a href="Vector2.html">Vector2</a>></span> )</span><span class="type-signature"> : boolean</span> </h3>
  45. <div class="method">
  46. <div class="description">
  47. <p>Returns <code>true</code> if the given contour uses a clockwise winding order.</p>
  48. </div>
  49. <table class="params">
  50. <tbody>
  51. <tr>
  52. <td class="name">
  53. <strong>pts</strong>
  54. </td>
  55. <td class="description last">
  56. <p>An array of 2D points defining a polygon.</p>
  57. </td>
  58. </tr>
  59. </tbody>
  60. </table>
  61. <dl class="details">
  62. <dt class="tag-returns"><strong>Returns:</strong> Whether the given contour uses a clockwise winding order or not.</dt>
  63. </dl>
  64. </div>
  65. <h3 class="name name-method" id=".triangulateShape" translate="no">.<a href="#.triangulateShape">triangulateShape</a><span class="signature">( contour : <span class="param-type">Array.&lt;<a href="Vector2.html">Vector2</a>></span>, holes : <span class="param-type">Array.&lt;Array.&lt;<a href="Vector2.html">Vector2</a>>></span> )</span><span class="type-signature"> : Array.&lt;Array.&lt;number>></span> </h3>
  66. <div class="method">
  67. <div class="description">
  68. <p>Triangulates the given shape definition.</p>
  69. </div>
  70. <table class="params">
  71. <tbody>
  72. <tr>
  73. <td class="name">
  74. <strong>contour</strong>
  75. </td>
  76. <td class="description last">
  77. <p>An array of 2D points defining the contour.</p>
  78. </td>
  79. </tr>
  80. <tr>
  81. <td class="name">
  82. <strong>holes</strong>
  83. </td>
  84. <td class="description last">
  85. <p>An array that holds arrays of 2D points defining the holes.</p>
  86. </td>
  87. </tr>
  88. </tbody>
  89. </table>
  90. <dl class="details">
  91. <dt class="tag-returns"><strong>Returns:</strong> An array that holds for each face definition an array with three indices.</dt>
  92. </dl>
  93. </div>
  94. <h2 class="subsection-title">Source</h2>
  95. <p>
  96. <a href="https://github.com/mrdoob/three.js/blob/master/src/extras/ShapeUtils.js" translate="no" target="_blank" rel="noopener">src/extras/ShapeUtils.js</a>
  97. </p>
  98. </article>
  99. </section>
  100. <script src="../scripts/linenumber.js"></script>
  101. <script src="../scripts/page.js"></script>
  102. </body>
  103. </html>
粤ICP备19079148号