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="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 neccessary to calculate separately for
  14. 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 neccessary to calculate separately for
  26. x, y components of a polygon.<br /><br />
  27. Used internally by [page:Path Path],
  28. [page:ExtrudeGeometry ExtrudeGeometry] and [page:ShapeGeometry ShapeGeometry].
  29. </p>
  30. <h3>[method:Array triangulateShape]( contour, holes )</h3>
  31. <p>
  32. contour -- 2D polygon.<br />
  33. holes -- array of holes<br /><br />
  34. Used internally by [page:ExtrudeGeometry ExtrudeGeometry] and [page:ShapeGeometry ShapeGeometry] to calculate faces in shapes with holes.
  35. </p>
  36. <h2>Source</h2>
  37. <p>
  38. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  39. </p>
  40. </body>
  41. </html>