ShapeUtils.html 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. <div class="desc">
  13. A class containing utility functions for shapes.<br />
  14. Note that these are all linear functions so it is neccessary to calculate seperately for
  15. x, y (an z, w if present) components of a vector.
  16. </div>
  17. <h2>Methods</h2>
  18. <h3>[method:Number area]( contour )</h3>
  19. <div>
  20. contour -- 2D polygon.<br /><br />
  21. Calculate area of a ( 2D ) contour polygon.<br /><br />
  22. </div>
  23. <h3>[method:Number b2]( t, p0, p1, p2 )</h3>
  24. <div>
  25. t -- number<br />
  26. p0, p1, p2 -- x, y, z or w components of a quadratic bezier curve.<br /><br />
  27. Note that this is a linear function so it is neccessary to calculate seperately for
  28. x, y (and z for 3D curves) components of a curve.<br /><br />
  29. Used internally by [page:QuadraticBezierCurve QuadraticBezierCurve],
  30. [page:QuadraticBezierCurve3 QuadraticBezierCurve3] and [page:Font Font].
  31. </div>
  32. <h3>[method:Number b3]( t, p0, p1, p2, p3 )</h3>
  33. <div>
  34. t -- number. <br />
  35. p0, p1, p2, p3 -- x, y or z components of a cubic bezier curve..<br /><br />
  36. Note that this is a linear function so it is neccessary to calculate seperately for
  37. x, y (and z for 3D curves) components of a curve.<br /><br />
  38. Used internally by [page:CubicBezierCurve CubicBezierCurve],
  39. [page:CubicBezierCurve3 CubicBezierCurve3] and [page:Font Font].
  40. </div>
  41. <h3>[method:Boolean isClockwise]( pts )</h3>
  42. <div>
  43. pts -- points defining a 2D polygon<br /><br />
  44. Note that this is a linear function so it is neccessary to calculate seperately for
  45. x, y components of a polygon.<br /><br />
  46. Used internally by [page:Path Path],
  47. [page:ExtrudeGeometry ExtrudeGeometry] and [page:ShapeBufferGeometry ShapeBufferGeometry].
  48. </div>
  49. <h3>[method:null triangulate]( contour, indices )</h3>
  50. <div>
  51. contour -- 2D polygon.<br />
  52. indices -- <br /><br />
  53. Used internally by [page:ExtrudeGeometry ExtrudeGeometry]
  54. and [page:ShapeBufferGeometry ShapeBufferGeometry] to calculate faces.
  55. </div>
  56. <h3>[method:null triangulateShape]( contour, holes )</h3>
  57. <div>
  58. contour -- 2D polygon.<br />
  59. holes -- array of holes<br /><br />
  60. Used internally by [page:ExtrudeGeometry ExtrudeGeometry]
  61. and [page:ShapeBufferGeometry ShapeBufferGeometry] to calculate faces in shapes with holes.
  62. </div>
  63. <h2>Source</h2>
  64. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  65. </body>
  66. </html>