ShapeUtils.html 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. <h1>[name]</h1>
  11. <p class="desc">
  12. A class containing utility functions for shapes.<br /><br />
  13. Note that these are all linear functions so it is necessary to calculate
  14. separately for x, y (and z, w if present) components of a vector.
  15. </p>
  16. <h2>Methods</h2>
  17. <h3>[method:Number area]( contour )</h3>
  18. <p>
  19. contour -- 2D polygon. An array of THREE.Vector2()<br /><br />
  20. Calculate area of a ( 2D ) contour polygon.
  21. </p>
  22. <h3>[method:Boolean isClockWise]( pts )</h3>
  23. <p>
  24. pts -- points defining a 2D polygon<br /><br />
  25. Note that this is a linear function so it is necessary to calculate
  26. separately for x, y components of a polygon.<br /><br />
  27. Used internally by [page:Path Path], [page:ExtrudeGeometry ExtrudeGeometry] and [page:ShapeGeometry ShapeGeometry].
  28. </p>
  29. <h3>[method:Array triangulateShape]( contour, holes )</h3>
  30. <p>
  31. contour -- 2D polygon. An array of [page:Vector2].<br />
  32. holes -- An array that holds arrays of [page:Vector2]s. Each array
  33. represents a single hole definition.<br /><br />
  34. Used internally by [page:ExtrudeGeometry ExtrudeGeometry] and
  35. [page:ShapeGeometry ShapeGeometry] to calculate faces in shapes with
  36. holes.
  37. </p>
  38. <h2>Source</h2>
  39. <p>
  40. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  41. </p>
  42. </body>
  43. </html>