ShapeUtils.html 1.4 KB

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